1
0
Fork 0
management/front/dkha-web-sz-main/node_modules/traverse/examples/scrub.js

13 lines
253 B
JavaScript

'use strict';
// scrub out circular references
var traverse = require('traverse');
var obj = { a: 1, b: 2, c: [3, 4] };
obj.c.push(obj);
var scrubbed = traverse(obj).map(function () {
if (this.circular) { this.remove(); }
});
console.dir(scrubbed);