@leafygreen-ui/lib
Advanced tools
Comparing version 13.6.0 to 13.6.1
# @leafygreen-ui/lib | ||
## 13.6.1 | ||
### Patch Changes | ||
- cfa830701: Fixes `RecursiveRecord` type | ||
## 13.6.0 | ||
@@ -4,0 +10,0 @@ |
@@ -26,4 +26,4 @@ /** | ||
infer Key, | ||
...infer Rest | ||
] ? Strict extends true ? Record<Key & string, RecursiveRecord<Rest, Strict>> : Partial<Record<Key & string, RecursiveRecord<Rest, Strict>>> : Keys; | ||
...infer Rest extends [infer _K, ...infer _R] | ||
] ? Strict extends true ? Record<Key & string, RecursiveRecord<Rest, Strict>> : Partial<Record<Key & string, RecursiveRecord<Rest, Strict>>> : Keys extends [infer Key] ? Key : never; | ||
//# sourceMappingURL=RecursiveRecord.types.d.ts.map |
{ | ||
"name": "@leafygreen-ui/lib", | ||
"version": "13.6.0", | ||
"version": "13.6.1", | ||
"description": "leafyGreen UI Kit Internal Library", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -27,9 +27,14 @@ /** | ||
Strict extends boolean = true, | ||
> = Keys extends [ | ||
infer Key, // the current union of keys | ||
...infer Rest, | ||
] | ||
? Strict extends true | ||
? Record<Key & string, RecursiveRecord<Rest, Strict>> | ||
: Partial<Record<Key & string, RecursiveRecord<Rest, Strict>>> | ||
: Keys; | ||
> = | ||
// If `Keys` is an array with at least 2 indexes | ||
Keys extends [ | ||
infer Key, // the current union of keys | ||
...infer Rest extends [infer _K, ...infer _R], // (`Keys` has at least 2 indexes if 2nd argument can also be inferred) | ||
] | ||
? // If this is strict, then don't use Partial | ||
Strict extends true | ||
? Record<Key & string, RecursiveRecord<Rest, Strict>> | ||
: Partial<Record<Key & string, RecursiveRecord<Rest, Strict>>> | ||
: Keys extends [infer Key] // If Keys has only 1 index | ||
? Key // return that index | ||
: never; // otherwise there's an error |
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
183980
2510