1.0.5 • Published 5 years ago
@kingjs/descriptor.nested.array.to-array v1.0.5
@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
NestedArray
: see @kingjs/descriptor/nested/array
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