types: refactor ref unwrapping (#646)

This commit is contained in:
likui 2020-01-21 02:22:18 +08:00 committed by Evan You
parent 98d50d874d
commit 0c42a6d8fa

View File

@ -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 : T extends Array<any>
? 'ref' ? 'array'
: T extends Array<any> : T extends Ref | Function | CollectionTypes | BaseTypes
? 'array' ? 'ref' // bail out on types that shouldn't be unwrapped
: T extends Function | CollectionTypes | BaseTypes : T extends object ? 'object' : 'ref']
? 'ref' // bail out on types that shouldn't be unwrapped
: T extends object ? 'object' : 'ref']