char/avril

(wip) why'd you have to go and make things so complicaaaaated?

git clone https://git.t4t.associates/char/avril

Charlotte Somexperiment: port fjson module to ts and generate .d.ts via compiler8ee750c

main
801 B19 linesraw
1import { apply, parse, stringify } from "avril:fjson";
2
3const value: unknown = parse("answer: 42");
4const source: string = stringify(value);
5const unchanged: string = apply(source);
6const changed: string = apply(source, { answer: 43 }, { obsolete: undefined });
7
8// @ts-expect-error The parsed value is unknown, not any.
9const unchecked: string = parse(source);
10// @ts-expect-error Source text is required.
11parse();
12// @ts-expect-error Runtime coercion does not broaden the public string contract.
13parse(123);
14// @ts-expect-error Runtime coercion does not broaden the public string contract.
15apply(123, {});
16// @ts-expect-error Overrides must be records.
17apply(source, 123);
18// @ts-expect-error Internal ops are not part of the public declaration graph.
19import { op_fjson_parse } from "ext:core/ops";