helpertypes
Advanced tools
Comparing version 0.0.17 to 0.0.18
@@ -63,4 +63,5 @@ /** | ||
*/ | ||
export declare type ObjectLookupTuple<T, MaxDepth extends number = 10, CurrentDepth extends number = 0> = { | ||
[Key in keyof T]: CurrentDepth extends MaxDepth ? [Key] : T[Key] extends IgnoredLookupValue ? [Key] : T[Key] extends (infer El)[] | readonly (infer El)[] ? [Key] | [Key, keyof T[Key], ...ObjectLookupTuple<El, MaxDepth, Next<CurrentDepth>>] : [Key] | [Key, ...ObjectLookupTuple<T[Key], MaxDepth, Next<CurrentDepth>>]; | ||
export declare type ObjectLookupTuple<T, MaxDepth extends number = 10> = ObjectLookupTupleHelper<T, [], MaxDepth>; | ||
declare type ObjectLookupTupleHelper<T, Acc extends PropertyKey[], MaxDepth extends number, CurrentDepth extends number = 0> = { | ||
[Key in keyof T]: CurrentDepth extends MaxDepth ? [...Acc, Key] : T[Key] extends IgnoredLookupValue ? [...Acc, Key] : T[Key] extends (infer El)[] | readonly (infer El)[] ? [...Acc, Key] | ObjectLookupTupleHelper<El, [...Acc, Key, number], MaxDepth, Next<CurrentDepth>> : [...Acc, Key] | ObjectLookupTupleHelper<NonNullable<T[Key]>, [...Acc, Key, number], MaxDepth, Next<CurrentDepth>>; | ||
}[keyof T]; | ||
@@ -71,4 +72,5 @@ /** | ||
*/ | ||
export declare type ArrayPiercingObjectLookupTuple<T, MaxDepth extends number = 10, CurrentDepth extends number = 0> = { | ||
[Key in keyof T]: CurrentDepth extends MaxDepth ? [Key] : T[Key] extends IgnoredLookupValue ? [Key] : T[Key] extends (infer El)[] | readonly (infer El)[] ? [Key] | [Key, ...ArrayPiercingObjectLookupTuple<El, MaxDepth, Next<CurrentDepth>>] : [Key] | [Key, ...ArrayPiercingObjectLookupTuple<T[Key], MaxDepth, Next<CurrentDepth>>]; | ||
export declare type ArrayPiercingObjectLookupTuple<T, MaxDepth extends number = 10> = ArrayPiercingObjectLookupTupleHelper<T, [], MaxDepth>; | ||
declare type ArrayPiercingObjectLookupTupleHelper<T, Acc extends PropertyKey[], MaxDepth extends number, CurrentDepth extends number = 0> = { | ||
[Key in keyof T]: CurrentDepth extends MaxDepth ? [...Acc, Key] : T[Key] extends IgnoredLookupValue ? [...Acc, Key] : T[Key] extends (infer El)[] | readonly (infer El)[] ? [...Acc, Key] | ArrayPiercingObjectLookupTupleHelper<El, [...Acc, Key], MaxDepth, Next<CurrentDepth>> : [...Acc, Key] | ArrayPiercingObjectLookupTupleHelper<NonNullable<T[Key]>, [...Acc, Key], MaxDepth, Next<CurrentDepth>>; | ||
}[keyof T]; | ||
@@ -389,2 +391,3 @@ /** | ||
export declare type IgnoredLookupValue = string | number | bigint | symbol | boolean | undefined | null | Date | RegExp | CallableFunction | Set<unknown> | WeakSet<never> | Map<unknown, unknown> | WeakMap<never, unknown>; | ||
export {}; | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "helpertypes", | ||
"version": "0.0.17", | ||
"version": "0.0.18", | ||
"description": "A collection of TypeScript helper types", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32813
394