Skip to content

Commit

Permalink
fix: === match transform
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-He95 committed Jun 4, 2024
1 parent 22894a6 commit 14d777d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,9 @@ function jsxAstDfs(children: any, result: { classAttr: any[], attrs: any[] } = {
column: prop.exp.loc.start.column - 1,
line: prop.exp.loc.start.line,
}
/** #26 将 === 条件的右边拿掉 */
result.classAttr.push({
content: prop.exp.content,
content: prop.exp.content.replace(/\s*===?\s*['"][^"']*['"]/, (_: string) => ' '.repeat(_.length)),
line: prop.exp.loc.start.line,
charater: prop.exp.loc.start.column,
start,
Expand Down

0 comments on commit 14d777d

Please sign in to comment.