Catalog npm
Back to packageRELEASE DETAILS

0.1.0

npm

1d

Make multi-dimensional arrays as flat as a pancake

arrayflatflattenreduce
Published18 Feb 2018
Direct dependencies2
Transitive dependenciesNot calculated

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.

Declared dependencies 2

Native requirements
2 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
tap-spec
Environment
{
  "local_name": "tap-spec",
  "alias": false,
  "peer_metadata": null
}
^4.1.1development
tape
Environment
{
  "local_name": "tape",
  "alias": false,
  "peer_metadata": null
}
^4.8.0development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-NMFgUKF9XRvmfrKxT/H3ABg8zgxnIws605MC++t5dchPrZZ5weApz8gh15vVVF5+wYdlMASDCRlq/u/6l70RYw==",
  "shasum": "a58d7e3484cec9bd36109bddcb3c06af418370f2",
  "tarball": "https://registry.npmjs.org/1d/-/1d-0.1.0.tgz",
  "fileCount": 4,
  "unpackedSize": 7711,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEQCICYJdfM5+rbCjpWmSEB2LkwJQWRqV7kvarM1GvwBfbekAiBFOATQDKQ9ydySVwM6t+x2K5b5yqkZsyJ58S9KOO3HJA=="
    }
  ]
}

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_version:ced6b5a6f0595634b6fa7b4f9357421b0f51bf6bc2fcd2d5be8ef8b60739eb76

Other collected versions

1.0.018 Mar0.1.15 AugView all collected versions →