Huge News!Announcing our $40M Series B led by Abstract Ventures.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 5.1.1 to 5.1.2

6

CHANGELOG.md
# just-flatten-it
## 5.1.2
### Patch Changes
- Type improvements
## 5.1.1

@@ -4,0 +10,0 @@

4

index.d.ts

@@ -1,2 +0,2 @@

type RecursiveList<T> = (T | T[] | RecursiveList<T>)[];
type RecursiveList<T> = readonly (T | readonly T[] | RecursiveList<T>)[];

@@ -14,3 +14,3 @@ /**

*/
declare function flatten<T>(arr: RecursiveList<T>, depth? : number): T[];
declare function flatten<T>(arr: RecursiveList<T>, depth?: number): T[];
export default flatten;
import flatten from './index'
// OK
flatten([1, 2, 3]);
flatten([1, [2, 3], 4]);
flatten([1, [2, [3]], 4]);
flatten([1, [2, [3]], [[[[[4]]]]]]);
const numbers: readonly number[] = [1, 2, 3]
flatten(numbers);
flatten([1, numbers, 4]);
flatten([1, [2, numbers], 4]);
flatten([1, [2, [3]], [[[[numbers]]]]]);
flatten([1, [2, [3]], [[[[[4]]]]]], 2);

@@ -19,3 +20,3 @@ flatten([1, [2, [3]], [[[[[4]]]]]], undefined);

// @ts-expect-error
flatten({a: 5});
flatten({ a: 5 });
// @ts-expect-error

@@ -22,0 +23,0 @@ flatten([1], true);

{
"name": "just-flatten-it",
"version": "5.1.1",
"version": "5.1.2",
"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