Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/bombshell-dev/configliere. A statically typed entry-point router for command-line applications
Something went wrong. Try again.
393 B · 14 lines
TypeScript
123456789101112131415import assert from "node:assert";import type { Done, Fail, Input, Parser, Step } from "./types.ts";
export function parseSync<V, D>( parser: Parser<[Step<V, D>]>, input: Input = {},): Done<V, D> | Fail { let result = parser.parse(input); assert( !("parse" in result && typeof result.parse === "function"), "parser did not complete in a single step", ); return result;}