Skip to content

Commit

Permalink
refactor: use-template-literals: reuse isStringLiteral (#1275)
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser authored Aug 28, 2024
1 parent daea47d commit 9026802
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ const transformHelper = (node: BinaryExpression, api: API) => {
const leftNode = node.left;
const rightNode = node.right;
const left =
leftNode && leftNode.type === "StringLiteral"
isStringLiteral(leftNode)
? j.literal(leftNode.value)
: leftNode;
const right =
rightNode && rightNode.type === "StringLiteral"
isStringLiteral(rightNode)
? j.literal(rightNode.value)
: rightNode;

Expand Down

0 comments on commit 9026802

Please sign in to comment.