From: likui <2218301630@qq.com> Date: Mon, 20 Jan 2020 18:22:18 +0000 (+0800) Subject: types: refactor ref unwrapping (#646) X-Git-Tag: v3.0.0-alpha.3~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0c42a6d8fa0d1447636cbbf39af6a5b8e15f78fa;p=thirdparty%2Fvuejs%2Fcore.git types: refactor ref unwrapping (#646) --- diff --git a/packages/reactivity/src/ref.ts b/packages/reactivity/src/ref.ts index 10e577fe5f..5b99194b2e 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']