primitive-path
v1.0.1
Published
Finds the path to the primitive values in a nested object.
Downloads
8
Maintainers
Readme
primitive-path
Given an object finds the path to a primitive or array values.
Install
$ npm install --save primitive-path
Usage
const findPrimitives = require('primitive-path');
function log(val, name, path) {
console.log(path.join('.') + '.' + name + '=' + value);
}
findPrimitives(deep, log, 'foo' /* opt_name */, ['window'] /* opt path prefix */);