This package has been deprecated

Author message:

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

@kingjs/array.nested.to-array

1.0.5 • Public • Published

@kingjs/array.nested.to-array

Returns an array containing the non-array leafs of a tree whose internal nodes are nested arrays.

Usage

Flatten nested arrays like this:

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

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

result;

result:

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

API

declare function toArray(
  target: any | any[]
): any[]

Parameters

  • target: An non-array leaf or an array of nested array nodes interspersed with non-array leafs.

Returns

Returns an array containing the non-array leafs of a tree whose internal nodes are nested arrays.

Install

With npm installed, run

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

License

MIT

Analytics

Readme

Keywords

none

Package Sidebar

Install

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

Weekly Downloads

0

Version

1.0.5

License

MIT

Unpacked Size

2.91 kB

Total Files

4

Last publish

Collaborators

  • kingces95