(type: JSONValueType)
| 8 | } from "@jsonhero/json-infer-types"; |
| 9 | |
| 10 | export 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 | |
| 29 | export type FormatValueOptions = { |
| 30 | leafNodesOnly?: boolean; |
no outgoing calls
no test coverage detected