1.0.1 • Published 5 years ago

@recursive/flatten v1.0.1

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

flatten npm.io npm.io npm.io

🍳 Flatten arrays of arrays, as long as all the members are arrays

const flatten = require('@recursive/flatten');

flatten([
	[
		[1, 2, 3],
		[4, 5, 6],
	],
	[
		[1, 2, 3],
		[4, 5, 6],
	],
	[
		[1, 2, 3],
		[4, 5, 6],
	],
]);
// [1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6]

Transpiled version

Environments which exclude node_modules from the transpiling pipeline should include the "browser" entry instead of "main". This exposes an ES5 commonjs module.

Also available for explicit import:

const flatten = require('@recursive/flatten/dist');