8000 GitHub - uzmoi/parsea: parser combinator library for parsing array-like
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

uzmoi/parsea

Repository files navigation

parsea

NPM Version JSR Version License npm bundle size Codecov

parsea is a parser combinator library for parsing ArrayLike with TypeScript.

import * as P from "parsea";

const parser = P.seq([
    P.regex(/-?\d+(\.\d+)?/).map(Number.parseFloat),
    P.regex(/[A-Z]+/i),
]).map(([value, unit]) => ({ value, unit }));

P.parseA(parser, "273.15K"); // => { value: 273.15, unit: "K" }

See also examples/ directory.

Inspired by

About

parser combinator library for parsing array-like

Topics

Resources

License

Stars

Watchers

Forks

0