Skip to content

Commit 0c42a6d

Browse files
underfinyyx990803
authored andcommitted
types: refactor ref unwrapping (#646)
1 parent 98d50d8 commit 0c42a6d

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

packages/reactivity/src/ref.ts

+5-7
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,8 @@ export type UnwrapRef<T> = {
9898
object: { [K in keyof T]: UnwrapRef<T[K]> }
9999
}[T extends ComputedRef<any>
100100
? 'cRef'
101-
: T extends Ref
102-
? 'ref'
103-
: T extends Array<any>
104-
? 'array'
105-
: T extends Function | CollectionTypes | BaseTypes
106-
? 'ref' // bail out on types that shouldn't be unwrapped
107-
: T extends object ? 'object' : 'ref']
101+
: T extends Array<any>
102+
? 'array'
103+
: T extends Ref | Function | CollectionTypes | BaseTypes
104+
? 'ref' // bail out on types that shouldn't be unwrapped
105+
: T extends object ? 'object' : 'ref']

0 commit comments

Comments
 (0)