From 0c42a6d8fa0d1447636cbbf39af6a5b8e15f78fa Mon Sep 17 00:00:00 2001 From: likui <2218301630@qq.com> Date: Tue, 21 Jan 2020 02:22:18 +0800 Subject: [PATCH] types: refactor ref unwrapping (#646) --- 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 10e577fe..5b99194b 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']