Skip to content

Commit

Permalink
refactor: rename
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzhonghe committed Oct 12, 2022
1 parent fc336da commit 0005195
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/compiler-core/src/utils.ts
Expand Up @@ -398,7 +398,7 @@ export function injectProp(
const first = props.arguments[0] as string | JSChildNode
if (!isString(first) && first.type === NodeTypes.JS_OBJECT_EXPRESSION) {
// #6631
if (!isAlreadyExists(prop, first)) {
if (!isPropExists(prop, first)) {
first.properties.unshift(prop)
}
} else {
Expand All @@ -414,7 +414,7 @@ export function injectProp(
}
!propsWithInjection && (propsWithInjection = props)
} else if (props.type === NodeTypes.JS_OBJECT_EXPRESSION) {
if (!isAlreadyExists(prop, props)) {
if (!isPropExists(prop, props)) {
props.properties.unshift(prop)
}
propsWithInjection = props
Expand Down Expand Up @@ -447,7 +447,7 @@ export function injectProp(
}

// check existing key to avoid overriding user provided keys
function isAlreadyExists(prop: Property, props: ObjectExpression) {
function isPropExists(prop: Property, props: ObjectExpression) {
let result = false
if (prop.key.type === NodeTypes.SIMPLE_EXPRESSION) {
const propKeyName = prop.key.content
Expand Down

0 comments on commit 0005195

Please sign in to comment.