source: node_modules/traverse/examples/json.js@ d24f17c

main
Last change on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 378 bytes
Line 
1'use strict';
2
3var traverse = require('traverse');
4
5var id = 54;
6var callbacks = {};
7var obj = { moo: function () {}, foo: [2, 3, 4, function () {}] };
8
9var scrubbed = traverse(obj).map(function (x) {
10 if (typeof x === 'function') {
11 callbacks[id] = { id: id, f: x, path: this.path };
12 this.update('[Function]');
13 id++;
14 }
15});
16
17console.dir(scrubbed);
18console.dir(callbacks);
Note: See TracBrowser for help on using the repository browser.