MCPcopy
hub / github.com/reduxjs/redux-devtools / tryCatchStringify

Function tryCatchStringify

packages/redux-devtools-utils/src/index.ts:118–135  ·  view source on GitHub ↗
(obj: unknown)

Source from the content-addressed store, hash-verified

116/* eslint-enable */
117
118function 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
137export function stringify(
138 obj: unknown,

Callers 1

stringifyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…