Kaynağa Gözat

fix: reactive and immutable should warn for undefined

Evan You 6 yıl önce
ebeveyn
işleme
e53874f7e7
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. 2 2
      packages/reactivity/src/reactive.ts

+ 2 - 2
packages/reactivity/src/reactive.ts

@@ -42,7 +42,7 @@ const canObserve = (value: any): boolean => {
 
 type ObservableFactory = <T>(target?: T) => UnwrapRef<T>
 
-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)) {