Skip to content

Commit

Permalink
Revert "fix: camel case match (#632)"
Browse files Browse the repository at this point in the history
This reverts commit ffa05f7.
  • Loading branch information
sorrycc committed Jul 26, 2023
1 parent 3da6418 commit ea3c579
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 20 deletions.
7 changes: 2 additions & 5 deletions src/Plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ import { join } from 'path';
import { addSideEffect, addDefault, addNamed } from '@babel/helper-module-imports';

function transCamel(_str, symbol) {
// e.g. QRCode
// First match: QR
// Second match: Code
const cells = _str.match(/([A-Z]+(?=[A-Z]))|([A-Z]?[^A-Z]+)/g) || [];
return cells.map(c => c.toLowerCase()).join(symbol);
const str = _str[0].toLowerCase() + _str.substr(1);
return str.replace(/([A-Z])/g, $1 => `${symbol}${$1.toLowerCase()}`);
}

function winPath(path) {
Expand Down
8 changes: 0 additions & 8 deletions test/fixtures/qr-code/actual.js

This file was deleted.

7 changes: 0 additions & 7 deletions test/fixtures/qr-code/expected.js

This file was deleted.

0 comments on commit ea3c579

Please sign in to comment.