MCPcopy
hub / github.com/loggerhead/json4u / doStringify

Function doStringify

src/lib/worker/command/urlToJSON.ts:76–90  ·  view source on GitHub ↗
(m: Map<string, any>)

Source from the content-addressed store, hash-verified

74
75function mapStringify(m: Map<string, any>) {
76 const doStringify = (m: Map<string, any>): string => {
77 if (m instanceof Map) {
78 const ss = [];
79
80 for (const [k, v] of m) {
81 ss.push(`"${k}":${doStringify(v)}`);
82 }
83
84 return `{${ss.join(",")}}`;
85 } else if (typeof m === "number") {
86 return `${m}`;
87 } else {
88 return JSON.stringify(m);
89 }
90 };
91
92 return doStringify(m);
93}

Callers 1

mapStringifyFunction · 0.85

Calls 1

stringifyMethod · 0.80

Tested by

no test coverage detected