1.0.5 • Published 5 years ago

@kingjs/descriptor.nested.array.to-array v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

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

Returns an array values found in an array tree.

Usage

Return an array of pet names like this:

var toArray = require('@kingjs/descriptor.nested.array.to-array');

toArray([
  'a', [
    'b', [
      'c'
    ], 'd'
  ], 'e'
]);

result:

[ 'a', 'b', 'c', 'd', 'e' ]

API

declare function toArray(
  tree: NestedArray,
): array

Interfaces

Parameters

  • tree: An array tree.

Returns

Returns an array of values or null if no values are found.

Install

With npm installed, run

$ npm install @kingjs/descriptor.nested.array.to-array

License

MIT

Analytics