From f077714f80916936ab50df03e2802c039c9e39a9 Mon Sep 17 00:00:00 2001 From: likui <2218301630@qq.com> Date: Mon, 20 Jan 2020 18:21:26 +0800 Subject: [PATCH] types: perf ref type --- packages/reactivity/src/ref.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/reactivity/src/ref.ts b/packages/reactivity/src/ref.ts index 10e577fe5f0..5b99194b2e0 100644 --- a/packages/reactivity/src/ref.ts +++ b/packages/reactivity/src/ref.ts @@ -98,10 +98,8 @@ export type UnwrapRef = { object: { [K in keyof T]: UnwrapRef } }[T extends ComputedRef ? 'cRef' - : T extends Ref - ? 'ref' - : T extends Array - ? 'array' - : T extends Function | CollectionTypes | BaseTypes - ? 'ref' // bail out on types that shouldn't be unwrapped - : T extends object ? 'object' : 'ref'] + : T extends Array + ? 'array' + : T extends Ref | Function | CollectionTypes | BaseTypes + ? 'ref' // bail out on types that shouldn't be unwrapped + : T extends object ? 'object' : 'ref']