1.0.0 • Published 5 years ago

@ngard/tiny-flatten v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

tiny-flatten

source bundle size build status license

A minimal-weight utility equivalent to lodash.flatten. For when every byte counts!

lodash.flatten bundle size tiny-flatten bundle size

Syntax

flatten(/* array */)

Parameters

array - An array to flatten

Return

Flattens an array a single level deep.

Example

import { flatten } from '@ngard/tiny-flatten';

const value = flatten([1, [2, 3], [4, [5]]]);
// returns [1, 2, 3, 4, [5]]