👁️🗨️ Parsers without nonsense.
Instead of throwing or returning values like NaN
, the parsers in this library
either return the expected parsed value or undefined
(making use of the
Maybe type).
First:
# If you use npm
npm install @vangware/parsers
# If you use pnpm
pnpm add @vangware/parsers
# If you use yarn
yarn add @vangware/parsers
And then:
import { parseDecimal } from "@vangware/parsers";
parseDecimal("101"); // 101
parseDecimal("nope"); // undefined
import { parseDecimal } from "https://cdn.skypack.dev/@vangware/parsers?dts";
parseDecimal("101"); // 101
parseDecimal("nope"); // undefined
Documentation is available HERE. It is auto-generated with typedoc based on the JSDocs and the types in the source. It shouldn't be necessary to read this. Code editors like VS Code integrate the documentation in the UI.
Changelog can be found HERE.
Test coverage can be found HERE.