Explorar o código

types: refactor ref unwrapping (#646)

likui %!s(int64=6) %!d(string=hai) anos
pai
achega
0c42a6d8fa
Modificáronse 1 ficheiros con 5 adicións e 7 borrados
  1. 5 7
      packages/reactivity/src/ref.ts

+ 5 - 7
packages/reactivity/src/ref.ts

@@ -98,10 +98,8 @@ export type UnwrapRef<T> = {
   object: { [K in keyof T]: UnwrapRef<T[K]> }
 }[T extends ComputedRef<any>
   ? 'cRef'
-  : T extends Ref
-    ? 'ref'
-    : T extends Array<any>
-      ? 'array'
-      : T extends Function | CollectionTypes | BaseTypes
-        ? 'ref' // bail out on types that shouldn't be unwrapped
-        : T extends object ? 'object' : 'ref']
+  : T extends Array<any>
+    ? 'array'
+    : T extends Ref | Function | CollectionTypes | BaseTypes
+      ? 'ref' // bail out on types that shouldn't be unwrapped
+      : T extends object ? 'object' : 'ref']