@kingjs/descriptor.nested.array.to-paths

1.0.5 • Public • Published

@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
): NestedDescriptor

Interfaces

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-paths

License

MIT

Analytics

Readme

Keywords

none

Package Sidebar

Install

npm i @kingjs/descriptor.nested.array.to-paths

Weekly Downloads

1

Version

1.0.5

License

MIT

Unpacked Size

3.29 kB

Total Files

4

Last publish

Collaborators

  • kingces95