]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor(types): remove unnecessary as any (#1411)
authorAlbert Liu <814921718@qq.com>
Thu, 25 Jun 2020 15:05:39 +0000 (23:05 +0800)
committerGitHub <noreply@github.com>
Thu, 25 Jun 2020 15:05:39 +0000 (11:05 -0400)
packages/runtime-core/src/componentProps.ts
packages/runtime-core/src/vnode.ts

index 28f5ed00ea022fb6ed5cab54e5949edaf9845a46..6cb22f0bea3832cb9ae4877f5d494e5a5a41a71d 100644 (file)
@@ -278,7 +278,7 @@ function resolvePropValue(
   key: string,
   value: unknown
 ) {
-  const opt = options[key] as any
+  const opt = options[key]
   if (opt != null) {
     const hasDefault = hasOwn(opt, 'default')
     // default values
index 9967d90ea480596a3b91504736cfa906a7f80089..83d401783f12878308e67850ea5c7d2bfcb4aa57 100644 (file)
@@ -408,11 +408,11 @@ export function cloneVNode<T, U>(
   vnode: VNode<T, U>,
   extraProps?: Data & VNodeProps
 ): VNode<T, U> {
-  const props = (extraProps
+  const props = extraProps
     ? vnode.props
       ? mergeProps(vnode.props, extraProps)
       : extend({}, extraProps)
-    : vnode.props) as any
+    : vnode.props
   // This is intentionally NOT using spread or extend to avoid the runtime
   // key enumeration cost.
   return {
@@ -571,7 +571,7 @@ export function mergeProps(...args: (Data & VNodeProps)[]) {
         const incoming = toMerge[key]
         if (existing !== incoming) {
           ret[key] = existing
-            ? [].concat(existing as any, toMerge[key] as any)
+            ? [].concat(existing as any, toMerge[key])
             : incoming
         }
       } else {