Skip to content

Commit

Permalink
refactor: use isObject
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Aug 10, 2022
1 parent 592361b commit c1c606e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions packages/runtime-core/src/componentEmits.ts
Expand Up @@ -7,6 +7,7 @@ import {
hyphenate,
isArray,
isFunction,
isObject,
isOn,
toNumber,
UnionToIntersection
Expand Down Expand Up @@ -226,7 +227,7 @@ export function normalizeEmitsOptions(
}

if (!raw && !hasExtends) {
if (comp && typeof comp === 'object') {
if (isObject(comp)) {
cache.set(comp, null)
}
return null
Expand All @@ -238,7 +239,7 @@ export function normalizeEmitsOptions(
extend(normalized, raw)
}

if (comp && typeof comp === 'object') {
if (isObject(comp)) {
cache.set(comp, normalized)
}
return normalized
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-core/src/componentOptions.ts
Expand Up @@ -966,7 +966,7 @@ export function resolveMergedOptions(
}
mergeOptions(resolved, base, optionMergeStrategies)
}
if (base && typeof base === 'object') {
if (isObject(base)) {
cache.set(base, resolved)
}
return resolved
Expand Down
4 changes: 2 additions & 2 deletions packages/runtime-core/src/componentProps.ts
Expand Up @@ -494,7 +494,7 @@ export function normalizePropsOptions(
}

if (!raw && !hasExtends) {
if (comp && typeof comp === 'object') {
if (isObject(comp)) {
cache.set(comp, EMPTY_ARR as any)
}
return EMPTY_ARR as any
Expand Down Expand Up @@ -536,7 +536,7 @@ export function normalizePropsOptions(
}

const res: NormalizedPropsOptions = [normalized, needCastKeys]
if (comp && typeof comp === 'object') {
if (isObject(comp)) {
cache.set(comp, res)
}
return res
Expand Down

0 comments on commit c1c606e

Please sign in to comment.