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

Function stringify

packages/redux-devtools-utils/src/index.ts:137–167  ·  view source on GitHub ↗
(
  obj: unknown,
  serialize?:
    | {
        replacer?: (key: string, value: unknown) => unknown;
        options?: unknown | boolean;
      }
    | true
)

Source from the content-addressed store, hash-verified

135}
136
137export function stringify(
138 obj: unknown,
139 serialize?:
140 | {
141 replacer?: (key: string, value: unknown) => unknown;
142 options?: unknown | boolean;
143 }
144 | true
145) {
146 if (typeof serialize === 'undefined') {
147 return tryCatchStringify(obj);
148 }
149 if (serialize === true) {
150 return jsan.stringify(
151 obj,
152 function (key, value) {
153 if (value && typeof (value as any).toJS === 'function')
154 return (value as any).toJS();
155 return value;
156 },
157 null as unknown as undefined,
158 true
159 );
160 }
161 return jsan.stringify(
162 obj,
163 serialize.replacer,
164 null as unknown as undefined,
165 serialize.options as boolean
166 );
167}
168
169export function getSeralizeParameter(
170 config: {

Callers 10

monitoringFunction · 0.50
stringifyDataMethod · 0.50
stringifyAndShrinkFunction · 0.50
generateFunction · 0.50
getMethodMethod · 0.50
getActionMethod · 0.50
generateTestMethod · 0.50
DevToolsEnhancerClass · 0.50
relayMethod · 0.50
immutable.spec.tsFile · 0.50

Calls 1

tryCatchStringifyFunction · 0.70

Tested by

no test coverage detected