Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More →
Socket
Sign inDemoInstall
Socket

@waiting/shared-types

Package Overview
Dependencies
Maintainers
0
Versions
139
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@waiting/shared-types - npm Package Compare versions

Comparing version 23.17.0 to 23.18.0

12

dist/lib/tuple.d.ts

@@ -35,3 +35,15 @@ /** Get the first element */

}[Tuple extends [] ? 1 : 0];
export type FlattenNestedTuple<T extends (readonly any[])> = {
[K in keyof T]: FlattenTuple<T[K]>;
};
/**
* Convert const type to type const input = [1, 2] as const
* @example ```ts
* const input = [1, [2, 3]] as const // note the `as const`
* type Result = FlattenTuple<typeof input> // [1, 2 | 3]
* ```
*
*/
type FlattenTuple<T> = T extends readonly (infer U)[] ? U extends ((any)[]) ? TupleToUnion<U> : U : T;
export {};
//# sourceMappingURL=tuple.d.ts.map

4

package.json
{
"name": "@waiting/shared-types",
"author": "waiting",
"version": "23.17.0",
"version": "23.18.0",
"description": "shared typescript types",

@@ -70,3 +70,3 @@ "keywords": [

},
"gitHead": "aa31a7a6971b1cabbd7e0d93a04956721fdac759"
"gitHead": "d924f37d896368b0c2caa2a592afbb9b7df0b806"
}

@@ -63,1 +63,21 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

export type FlattenNestedTuple<T extends (readonly any[])> = {
[K in keyof T]: FlattenTuple<T[K]>
}
/**
* Convert const type to type const input = [1, 2] as const
* @example ```ts
* const input = [1, [2, 3]] as const // note the `as const`
* type Result = FlattenTuple<typeof input> // [1, 2 | 3]
* ```
*
*/
type FlattenTuple<T> = T extends readonly (infer U)[]
? U extends ((any)[])
? TupleToUnion<U>
// ? U extends ((infer V)[])
// ? FlattenTuple<U> | FlattenTuple<V>
: U
: T

Sorry, the diff of this file is not supported yet

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