(obj: unknown)
| 116 | /* eslint-enable */ |
| 117 | |
| 118 | function tryCatchStringify(obj: unknown) { |
| 119 | try { |
| 120 | return JSON.stringify(obj); |
| 121 | } catch (err) { |
| 122 | /* eslint-disable no-console */ |
| 123 | if (process.env.NODE_ENV !== 'production') |
| 124 | console.log('Failed to stringify', err); |
| 125 | /* eslint-enable no-console */ |
| 126 | return jsan.stringify( |
| 127 | obj, |
| 128 | null as unknown as undefined, |
| 129 | null as unknown as undefined, |
| 130 | { |
| 131 | circular: '[CIRCULAR]', |
| 132 | } as unknown as boolean |
| 133 | ); |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | export function stringify( |
| 138 | obj: unknown, |
no outgoing calls
no test coverage detected
searching dependent graphs…