MCPcopy Create free account
hub / github.com/observablehq/framework / stringify

Function stringify

test/javascript/parse-test.ts:20–22  ·  view source on GitHub ↗
(key: string, value: any)

Source from the content-addressed store, hash-verified

18
19// Convert to a serializable representation.
20function stringify(key: string, value: any): any {
21 return typeof value === "bigint" ? value.toString() : value instanceof Map ? [...value] : value;
22}
23
24function runTests(inputRoot: string, outputRoot: string, filter: (name: string) => boolean = () => true) {
25 for (const name of readdirSync(inputRoot)) {

Callers

nothing calls this directly

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected