(text, reviver)
| 205 | * const data = jsonParse(jsonString) |
| 206 | */ |
| 207 | export const jsonParse: typeof JSON.parse = (text, reviver) => { |
| 208 | using _ = slowLogging`JSON.parse(${text})` |
| 209 | // V8 de-opts JSON.parse when a second argument is passed, even if undefined. |
| 210 | // Branch explicitly so the common (no-reviver) path stays on the fast path. |
| 211 | return typeof reviver === 'undefined' |
| 212 | ? JSON.parse(text) |
| 213 | : JSON.parse(text, reviver) |
| 214 | } |
| 215 | |
| 216 | /** |
| 217 | * Wrapped structuredClone with slow operation logging. |
no outgoing calls
no test coverage detected