fix(types): should unwrap array -> object -> ref

This commit is contained in:
Evan You
2020-06-29 12:26:28 -04:00
parent 028a8c20df
commit 82b28a5ecb
3 changed files with 21 additions and 3 deletions

View File

@@ -165,10 +165,11 @@ type UnwrapRefSimple<T> = T extends
| CollectionTypes
| BaseTypes
| Ref
| Array<any>
| RefUnwrapBailTypes[keyof RefUnwrapBailTypes]
? T
: T extends object ? UnwrappedObject<T> : T
: T extends Array<any>
? { [K in keyof T]: T[K] extends Ref ? T[K] : UnwrapRefSimple<T[K]> }
: T extends object ? UnwrappedObject<T> : T
// Extract all known symbols from an object
// when unwrapping Object the symbols are not `in keyof`, this should cover all the