Catalog npm
PACKAGE EXPLORERView in registry

1d

npm

Make multi-dimensional arrays as flat as a pancake

arrayflatflattenreduce
Versions collected3
Direct dependencies2From release 1.0.0
Last observed20 Oct, 18:27 UTC

README

Current package documentation
1D

1D

Make multi-dimensional arrays as flat as a pancake

Installation

npm install 1d

Usage

const flatten = require('1d');

flatten( [['a'], 'b', ['c', ['d']]] );
// ['a', 'b', 'c', 'd']

OBS: This is a built-in feature from Node.js 11.15.0 and up. Check out Array.prototype.flat

API

oned(arr, res)

Flatten an array into a sweet 1D array

arr

Type: Array

Input array to flatten

res

Type: Array
Default: []

Initial array.

Note: The inital array is not being flattened

License

MIT © Terkel Gjervig

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 3

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.0Registry latest18 Mar 20202
0.1.15 Aug 20192
0.1.018 Feb 20182

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
terkelg/1d

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 18:27 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:c58efbc889d0a22a593540d197ea882c641043030af40afaec7bf1097d15f7eb