From: Carlos Rodrigues Date: Wed, 15 Apr 2020 15:07:07 +0000 (+0100) Subject: Apply suggestions from code review X-Git-Tag: v3.0.0-alpha.13~2^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70b55d797f2f1f6db8c7047ac30207cfc98bf58f;p=thirdparty%2Fvuejs%2Fcore.git Apply suggestions from code review Co-Authored-By: Evan You --- diff --git a/packages/reactivity/src/ref.ts b/packages/reactivity/src/ref.ts index 2eef093e7d..569e4e0d40 100644 --- a/packages/reactivity/src/ref.ts +++ b/packages/reactivity/src/ref.ts @@ -129,7 +129,7 @@ export function toRef( type BaseTypes = string | number | boolean | Node | Window // Super simple tuple checker -type Tupple> = T[0] extends T[1] +type IsTuple> = T[0] extends T[1] ? T[1] extends T[2] ? never : true : true @@ -145,10 +145,10 @@ type UnwrapRefSimple = T extends | Element ? T : T extends Array - ? Tupple extends never ? Array : UnwrapTupple + ? IsTuple extends true ? UnwrapTuple : Array : T extends object ? UnwrappedObject : T -export type UnwrapTupple = { [P in keyof T]: T[P] } & { +export type UnwrapTuple = { [P in keyof T]: T[P] } & { length: number [Symbol.iterator]: any [Symbol.unscopables]: any