From efb41955961e27af2d0377c0fd986c6134eef7db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?null=E4=BB=94?= <308241863@qq.com> Date: Fri, 2 Jul 2021 15:52:01 +0800 Subject: [PATCH] fix(types): use AnyObject insteads of any (#742) Co-authored-by: webfansplz <> --- src/reactivity/del.ts | 3 ++- src/reactivity/set.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/reactivity/del.ts b/src/reactivity/del.ts index d7a9607b..aceb324c 100644 --- a/src/reactivity/del.ts +++ b/src/reactivity/del.ts @@ -1,10 +1,11 @@ +import { AnyObject } from '../types/basic' import { getVueConstructor } from '../runtimeContext' import { hasOwn, isPrimitive, isUndef, isValidArrayIndex } from '../utils' /** * Delete a property and trigger change if necessary. */ -export function del(target: any, key: any) { +export function del(target: AnyObject, key: any) { const Vue = getVueConstructor() const { warn } = Vue.util diff --git a/src/reactivity/set.ts b/src/reactivity/set.ts index 669487cf..d1baecf2 100644 --- a/src/reactivity/set.ts +++ b/src/reactivity/set.ts @@ -1,3 +1,4 @@ +import { AnyObject } from '../types/basic' import { getVueConstructor } from '../runtimeContext' import { isArray, isPrimitive, isUndef, isValidArrayIndex } from '../utils' import { defineAccessControl } from './reactive' @@ -7,7 +8,7 @@ import { defineAccessControl } from './reactive' * notification and intercept it's subsequent access if the property doesn't * already exist. */ -export function set(target: any, key: any, val: T): T { +export function set(target: AnyObject, key: any, val: T): T { const Vue = getVueConstructor() const { warn, defineReactive } = Vue.util if (__DEV__ && (isUndef(target) || isPrimitive(target))) {