Skip to content

Commit

Permalink
fixed codecov issue
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmadFaraz-crypto committed May 1, 2024
1 parent 6d23873 commit d819b74
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/unminify/src/transformations/un-jsx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ function toJSX(j: JSCodeshift, path: ASTPath<CallExpression>, pragmas: string[],
},
}).forEach((path: any) => {
const { id: { loc: { identifierName } } } = path.node
if (identifierName && path.node?.init?.value) {
if (identifierName && path.node.init.value && tag.name) {
if (tag.name === identifierName) {
tag = { ...tag, name: path.node?.init?.value }
tag = { ...tag, name: path.node.init.value }
}
}

Check warning on line 147 in packages/unminify/src/transformations/un-jsx.ts

View check run for this annotation

Codecov / codecov/patch

packages/unminify/src/transformations/un-jsx.ts#L144-L147

Added lines #L144 - L147 were not covered by tests
})
Expand All @@ -167,7 +167,9 @@ function toJSX(j: JSCodeshift, path: ASTPath<CallExpression>, pragmas: string[],
tag = { ...tag, name: variableDeclaration.declarations[0].init.consequent.value }
}
else {
tag = { ...tag, name: variableDeclaration.declarations[0].init.alternate.value }
if (variableDeclaration.declarations[0].init.alternate.value) {
tag = { ...tag, name: variableDeclaration.declarations[0].init.alternate.value }
}
}

Check warning on line 173 in packages/unminify/src/transformations/un-jsx.ts

View check run for this annotation

Codecov / codecov/patch

packages/unminify/src/transformations/un-jsx.ts#L169-L173

Added lines #L169 - L173 were not covered by tests
})
}
Expand Down

0 comments on commit d819b74

Please sign in to comment.