MCPcopy Create free account
hub / github.com/BridgeAR/safe-stable-stringify / circularReplacer

Function circularReplacer

test.js:324–326  ·  view source on GitHub ↗

* @this {object} * @param {string} key * @param {unknown} value

(key, value)

Source from the content-addressed store, hash-verified

322 * @param {unknown} value
323 */
324 function circularReplacer (key, value) {
325 return key === 'self' ? this : value
326 }
327 const root = { child: { self: 0 }, self: 0 }
328 const expected = { child: { self: '[Circular: 1]' }, self: '[Circular: 0]' }
329 for (const space of [undefined, 2]) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected