New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

just-flatten-it

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

just-flatten-it - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

13

index.d.ts
type RecursiveList<T> = (T | T[] | RecursiveList<T>)[];
declare function flatten<T>(list: RecursiveList<T>, depth? : number): T[];
/**
* Flattens an array
* @param arr the arary to flatten
* @param depth number of times to flatten the array. Flattens fully if omitted.
*
* @example
* flatten([[1, [2, 3]], [[4, 5], 6, 7, [8, 9]]]);
* // => [1, 2, 3, 4, 5, 6, 7, 8, 9]
* flatten([[1, [2, 3]], [[4, 5], 6, 7, [8, 9]]], 1);
* // => [1, [2, 3], [[4, 5], 6, 7, [8, 9]]]
*/
declare function flatten<T>(arr: RecursiveList<T>, depth? : number): T[];
export default flatten;

2

package.json
{
"name": "just-flatten-it",
"version": "4.0.0",
"version": "4.1.0",
"description": "return a flattened array",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc