mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-11-27 02:30:56 -05:00
17 lines
390 B
JavaScript
17 lines
390 B
JavaScript
|
var Traverse = require('traverse');
|
||
|
|
||
|
var id = 54;
|
||
|
var callbacks = {};
|
||
|
var obj = { moo : function () {}, foo : [2,3,4, function () {}] };
|
||
|
|
||
|
var scrubbed = Traverse(obj).map(function (x) {
|
||
|
if (typeof x === 'function') {
|
||
|
callbacks[id] = { id : id, f : x, path : this.path };
|
||
|
this.update('[Function]');
|
||
|
id++;
|
||
|
}
|
||
|
});
|
||
|
|
||
|
console.dir(scrubbed);
|
||
|
console.dir(callbacks);
|