]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
types: refactor ref unwrapping (#646)
authorlikui <2218301630@qq.com>
Mon, 20 Jan 2020 18:22:18 +0000 (02:22 +0800)
committerEvan You <yyx990803@gmail.com>
Mon, 20 Jan 2020 18:22:18 +0000 (13:22 -0500)
packages/reactivity/src/ref.ts

index 10e577fe5f01ed10b4130cdfbc8fe725c38c167f..5b99194b2e022ec3af12691b62ced68dd1bdf6aa 100644 (file)
@@ -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']