
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Another implementation of array flatterization. Works recursivly down every nested array.
var flat = require('flatit');
flat([]); // []
flat([1,2,3,4,5]); // [1,2,3,4,5]
flat([1,2,3,[],4,5]); // [1,2,3,4,5]
flat([1,2,3,[4,[5],6],7,8]); // [1,2,3,4,5,6,7,8]
Returns flattened array.
Run npm run bench to test it yourself.
flatten empty array
11,242,685 op/s » recursive
10,897,869 op/s » lodash
2,562,129 op/s » flatten
14,829,264 op/s » flatit
15,150,337 op/s » shifting
11,902,776 op/s » pop
flatten array of empty arrays
1,813,326 op/s » recursive
558,774 op/s » lodash
123,880 op/s » flatten
2,273,380 op/s » flatit
297,519 op/s » shifting
395,793 op/s » pop
flatten already flat array
1,009,670 op/s » recursive
2,070,110 op/s » lodash
28,762 op/s » flatten
2,083,666 op/s » flatit
648,079 op/s » shifting
921,404 op/s » pop
flatten single nested array
876,355 op/s » recursive
1,051,872 op/s » lodash
22,871 op/s » flatten
10,293,846 op/s » flatit
526,062 op/s » shifting
873,115 op/s » pop
flatten nested array
1,361,593 op/s » recursive
531,594 op/s » lodash
29,133 op/s » flatten
768,345 op/s » flatit
331,482 op/s » shifting
554,377 op/s » pop
flatten big array (depth 2)
6,990 op/s » recursive
3,761 op/s » lodash
60 op/s » flatten
4,237 op/s » flatit
1,717 op/s » shifting
3,419 op/s » pop
Suites: 6
Benches: 36
Elapsed: 59,500.93 ms
MIT (c) 2014 Vsevolod Strukchinsky (floatdrop@gmail.com)
FAQs
Faltten array
We found that flatit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.