From e53874f7e72a50fa41e050198521b3a964b83659 Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 19 Aug 2019 15:01:50 -0400 Subject: [PATCH] fix: reactive and immutable should warn for undefined --- packages/reactivity/src/reactive.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/reactivity/src/reactive.ts b/packages/reactivity/src/reactive.ts index a965ceac..e09882bb 100644 --- a/packages/reactivity/src/reactive.ts +++ b/packages/reactivity/src/reactive.ts @@ -42,7 +42,7 @@ const canObserve = (value: any): boolean => { type ObservableFactory = (target?: T) => UnwrapRef -export const reactive = ((target: any = {}): any => { +export const reactive = ((target: unknown): any => { // if trying to observe an immutable proxy, return the immutable version. if (immutableToRaw.has(target)) { return target @@ -60,7 +60,7 @@ export const reactive = ((target: any = {}): any => { ) }) as ObservableFactory -export const immutable = ((target: any = {}): any => { +export const immutable = ((target: unknown): any => { // value is a mutable observable, retrive its original and return // a readonly version. if (observedToRaw.has(target)) {