Skip to content

Commit

Permalink
fix: missing last tags
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Jul 26, 2023
1 parent 8f7f9a6 commit 928a4d7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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) || [];
const cells = _str.match(/([A-Z]+(?=[A-Z]|$))|([A-Z]?[^A-Z]+)/g) || [];
return cells.map(c => c.toLowerCase()).join(symbol);
}

Expand Down
8 changes: 8 additions & 0 deletions test/fixtures/sample-ui/actual.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { SampleUI } from 'antd';

switch(SampleUI){
case SampleUI:
console.log('foo');
default:
console.log('bar')
}
7 changes: 7 additions & 0 deletions test/fixtures/sample-ui/expected.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import _SampleUI from "antd/lib/sample-ui";
switch (_SampleUI) {
case _SampleUI:
console.log('foo');
default:
console.log('bar');
}

0 comments on commit 928a4d7

Please sign in to comment.