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 |
|
---|
3 | var traverse = require('traverse');
|
---|
4 |
|
---|
5 | var id = 54;
|
---|
6 | var callbacks = {};
|
---|
7 | var obj = { moo: function () {}, foo: [2, 3, 4, function () {}] };
|
---|
8 |
|
---|
9 | var 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 |
|
---|
17 | console.dir(scrubbed);
|
---|
18 | console.dir(callbacks);
|
---|
Note:
See
TracBrowser
for help on using the repository browser.