MCPcopy Index your code
hub / github.com/triggerdotdev/jsonhero-web / formatRawValue

Function formatRawValue

app/utilities/formatter.ts:10–27  ·  view source on GitHub ↗
(type: JSONValueType)

Source from the content-addressed store, hash-verified

8} from "@jsonhero/json-infer-types";
9
10export function formatRawValue(type: JSONValueType): string {
11 switch (type.name) {
12 case "string":
13 return type.value;
14 case "int":
15 return type.value.toString();
16 case "float":
17 return type.value.toString();
18 case "bool":
19 return type.value ? "true" : "false";
20 case "null":
21 return "null";
22 case "array":
23 return "[]";
24 case "object":
25 return "{}";
26 }
27}
28
29export type FormatValueOptions = {
30 leafNodesOnly?: boolean;

Callers 2

InfoHeaderFunction · 0.90
formatValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected