1.0.5 • Published 7 years ago
@kingjs/descriptor.nested.array.to-paths v1.0.5
@kingjs/descriptor.nested.array.to-paths
Returns paths constructed of nodes that satisfy a predicate.
Usage
Return an array of pet names like this:
var toPaths = require('@kingjs/descriptor.nested.array.to-paths');
var pets = [
['tiger'],
['snuggles'],
['spike'],
];
var result = toPaths(
pets,
null
);result:
{
'0': { '0': null },
'1': { '0': null },
'2': { '0': null },
}API
declare function toPaths(
tree: NestedArray,
value?: any
): NestedDescriptorInterfaces
NestedArray: see @kingjs/descriptor/nested/arrayNestedDescriptor: see @kingjs/descriptor/nested
Parameters
tree: An array tree whose paths are returned.value: Optional leaf value.
Returns
Returns paths of the array tree.
Install
With npm installed, run
$ npm install @kingjs/descriptor.nested.array.to-pathsLicense
MIT