This repository was archived by the owner on Oct 30, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -22,11 +22,11 @@ const allWordsRegexp = /^\w+$/i;
22
22
export const filterNonWordClasses = ( cssModuleKeys ) => {
23
23
const filteredClassNames = cssModuleKeys . filter ( classname => allWordsRegexp . test ( classname ) ) ;
24
24
if ( filteredClassNames . length === cssModuleKeys . length ) {
25
- return [ filteredClassNames , [ ] ] ;
25
+ return [ filteredClassNames , [ ] , ] ;
26
26
}
27
27
const nonWordClassNames = cssModuleKeys . filter ( classname => ! allWordsRegexp . test ( classname ) ) ;
28
- return [ filteredClassNames , nonWordClassNames ] ;
29
- }
28
+ return [ filteredClassNames , nonWordClassNames , ] ;
29
+ } ;
30
30
31
31
export const filenameToTypingsFilename = ( filename ) => {
32
32
const dirName = path . dirname ( filename ) ;
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ module.exports = function(input) {
43
43
if ( ! query . namedExport ) {
44
44
cssModuleDefinition = generateGenericExportInterface ( cssModuleKeys , filename ) ;
45
45
} else {
46
- const [ cleanedDefinitions , skippedDefinitions ] = filterNonWordClasses ( cssModuleKeys ) ;
46
+ const [ cleanedDefinitions , skippedDefinitions , ] = filterNonWordClasses ( cssModuleKeys ) ;
47
47
if ( skippedDefinitions . length > 0 && ! query . camelCase ) {
48
48
console . warn ( `Typings for CSS-Modules: option 'namedExport' was set but 'camelCase' for the css-loader not.
49
49
The following classes will not be available as named exports:
@@ -57,4 +57,4 @@ ${skippedDefinitions.map(sd => ` - "${sd}"`).join('\n').red}
57
57
delegateToCssLoader ( this , input , callback ) ;
58
58
} ;
59
59
cssLocalsLoader . call ( this , input ) ;
60
- }
60
+ } ;
Original file line number Diff line number Diff line change @@ -4,13 +4,12 @@ import crypto from 'crypto';
4
4
export const writeToFileIfChanged = ( filename , content ) => {
5
5
try {
6
6
const currentInput = fs . readFileSync ( filename , 'utf-8' ) ;
7
- const oldHash = crypto . createHash ( 'md5' ) . update ( currentInput ) . digest ( " hex" ) ;
8
- const newHash = crypto . createHash ( 'md5' ) . update ( content ) . digest ( " hex" ) ;
7
+ const oldHash = crypto . createHash ( 'md5' ) . update ( currentInput ) . digest ( ' hex' ) ;
8
+ const newHash = crypto . createHash ( 'md5' ) . update ( content ) . digest ( ' hex' ) ;
9
9
// the definitions haven't changed - ignore this
10
10
if ( oldHash === newHash ) {
11
11
return false ;
12
12
}
13
- } catch ( e ) {
14
13
} finally {
15
14
fs . writeFileSync ( filename , content ) ;
16
15
}
You can’t perform that action at this time.
0 commit comments