mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2025-09-26 23:10:18 +00:00
push all website files
This commit is contained in:
10
website/functions/node_modules/traverse/examples/scrub.js
generated
vendored
Normal file
10
website/functions/node_modules/traverse/examples/scrub.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
// 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 (x) {
|
||||
if (this.circular) this.remove()
|
||||
});
|
||||
console.dir(scrubbed);
|
Reference in New Issue
Block a user