types: refactor ref unwrapping (#646)
This commit is contained in:
parent
98d50d874d
commit
0c42a6d8fa
@ -98,10 +98,8 @@ export type UnwrapRef<T> = {
|
|||||||
object: { [K in keyof T]: UnwrapRef<T[K]> }
|
object: { [K in keyof T]: UnwrapRef<T[K]> }
|
||||||
}[T extends ComputedRef<any>
|
}[T extends ComputedRef<any>
|
||||||
? 'cRef'
|
? 'cRef'
|
||||||
: T extends Ref
|
|
||||||
? 'ref'
|
|
||||||
: T extends Array<any>
|
: T extends Array<any>
|
||||||
? 'array'
|
? 'array'
|
||||||
: T extends Function | CollectionTypes | BaseTypes
|
: T extends Ref | Function | CollectionTypes | BaseTypes
|
||||||
? 'ref' // bail out on types that shouldn't be unwrapped
|
? 'ref' // bail out on types that shouldn't be unwrapped
|
||||||
: T extends object ? 'object' : 'ref']
|
: T extends object ? 'object' : 'ref']
|
||||||
|
Loading…
Reference in New Issue
Block a user