🚨 Latest Research:Tanstack npm Packages Compromised in Ongoing Mini Shai-Hulud Supply-Chain Attack.Learn More
Socket
Book a DemoSign in
Socket

@extra-array/flatten.min

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@extra-array/flatten.min

Flattens nested array to given depth.

Source
npmnpm
Version
2.3.4
Version published
Weekly downloads
177
2112.5%
Maintainers
1
Weekly downloads
 
Created
Source

Flattens nested array to given depth.

This is part of package extra-array.

This is browserified, minified version of @extra-array/flatten.
It is exported as global variable array_flatten.
CDN: unpkg, jsDelivr.

array.flatten(x, [dep]);
// x:   a nested array
// dep: maximum depth (-1)
// --> flattened
const array = require('extra-array');

var x = [[1, 2], [3, [4, [5]]]];
array.flatten(x);
// [1, 2, 3, 4, 5]

array.flatten(x, 1);
// [1, 2, 3, [4, [5]]]

array.flatten(x, 2);
// [1, 2, 3, 4, [5]]

references

Keywords

extra

FAQs

Package last updated on 21 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts