free-types-core 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/unwrap.d.ts +1 -1
- package/package.json +1 -1
package/dist/unwrap.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ declare global {
|
|
|
23
23
|
}
|
|
24
24
|
export { unwrap, Unwrapped, Search };
|
|
25
25
|
/** Decompose a type into its constituents */
|
|
26
|
-
type unwrap<T, From extends Search =
|
|
26
|
+
type unwrap<T, From extends Search = TypesMap> = IsAny<T> extends true ? Any : (T extends readonly unknown[] ? From extends _Type | _Type[] ? null : unwrapLists<T> : null) extends infer R extends Unwrapped ? R : _unwrap<T, From extends _Type ? [From] : TypesMap extends From ? Omit<TypesMap, ArrayURIs> : From>;
|
|
27
27
|
type unwrapLists<T extends readonly unknown[]> = T extends unknown[] ? any[] extends T ? Unwrapped<'Array', Array, [T[0]]> : Unwrapped<'Tuple', Tuple, T> : readonly any[] extends T ? Unwrapped<'ReadonlyArray', ReadonlyArray, [T[0]]> : Unwrapped<'ReadonlyTuple', ReadonlyTuple, Mutable<T>>;
|
|
28
28
|
type Mutable<T> = {
|
|
29
29
|
-readonly [K in keyof T]: T[K];
|
package/package.json
CHANGED