Optionaloptions: CreateParserOptions<readonly []>
Default locale (en-US), application context, and additional codecs.
A parser with inferred specification and result types.
index!DuplicateFormatError for duplicate kinds, including built-in kinds.
import { createFormatter } from "@neutrium/formatter";
import { createParser } from "@neutrium/formatter/parse";
const display = createFormatter({ locale: "de-DE" });
const input = createParser({ locale: "de-DE" });
const spec = { kind: "number" } as const;
input.parse(display.format("1234.5", spec), spec); // "1234.5"
Creates an independent parser with all built-in domains and additional custom codecs.
Use Parser from @neutrium/formatter/extensions/parse for an isolated registry.
Default locale (en-US), application context, and additional codecs.
A parser with inferred specification and result types.
index!DuplicateFormatError for duplicate kinds, including built-in kinds.
import { createFormatter } from "@neutrium/formatter";
import { createParser } from "@neutrium/formatter/parse";
const display = createFormatter({ locale: "de-DE" });
const input = createParser({ locale: "de-DE" });
const spec = { kind: "number" } as const;
input.parse(display.format("1234.5", spec), spec); // "1234.5"
Creates an independent parser with all built-in domains and additional custom codecs. Use
Parserfrom@neutrium/formatter/extensions/parsefor an isolated registry.