(value: unknown)
| 30 | JSON.stringify(value).replaceAll("\u2028", "\\u2028").replaceAll("\u2029", "\\u2029"); |
| 31 | |
| 32 | export const jsLiteral = (value: unknown): string => |
| 33 | `JSON.parse(${JSON.stringify(JSON.stringify(value ?? null)) |
| 34 | .replaceAll("\u2028", "\\u2028") |
| 35 | .replaceAll("\u2029", "\\u2029")})`; |
| 36 | |
| 37 | /** |
| 38 | * Wrap a program body so it runs in its own scope and reports one JSON value. |
no outgoing calls
no test coverage detected