File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ const camelCase = require("camelcase");
7
7
* @returns {string[] }
8
8
*/
9
9
const getCssModuleKeys = ( content ) => {
10
- const keyRegex = / " ( [ ^ : " ) ] [ ^ " ) ] * ) " : / g;
10
+ const keyRegex = / " ( [ ^ " \n ] + ) " : / g;
11
11
let match ;
12
12
const cssModuleKeys = [ ] ;
13
13
Original file line number Diff line number Diff line change @@ -70,4 +70,13 @@ describe("getCssModuleKeys", () => {
70
70
const actual = getCssModuleKeys ( content ) ;
71
71
expect ( actual ) . toEqual ( [ "øæå" , "+~@" , "f\\'o\\'o" ] ) ;
72
72
} ) ;
73
+
74
+ it ( "CSS module with newline in class names should be ignored" , ( ) => {
75
+ const content = `.locals = {
76
+ "line1
77
+ line2": "twolinesdoesnotmakesense"
78
+ };` ;
79
+ const actual = getCssModuleKeys ( content ) ;
80
+ expect ( actual ) . toEqual ( [ ] ) ;
81
+ } ) ;
73
82
} ) ;
You can’t perform that action at this time.
0 commit comments