All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.examples.json.js Maven / Gradle / Ivy

The newest version!
'use strict';

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);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy