@recursive/flatten

1.0.1 • Public • Published

flatten

🍳 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');

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    1
  • 1.0.0
    0
  • 0.0.0
    0

Package Sidebar

Install

npm i @recursive/flatten

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

2.63 kB

Total Files

4

Last publish

Collaborators

  • omrilotan