File tree Expand file tree Collapse file tree 2 files changed +14
-13
lines changed Expand file tree Collapse file tree 2 files changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -15,12 +15,12 @@ import {
15
15
findImportPath ,
16
16
genImportRegExp ,
17
17
getCurrentDirFromUri ,
18
+ getEOL ,
18
19
getPosition ,
19
20
getTransformer ,
20
21
getWords ,
21
22
isImportLineMatch ,
22
23
stringifyClassname ,
23
- getEOL ,
24
24
} from './utils' ;
25
25
26
26
export class CSSModulesDefinitionProvider {
Original file line number Diff line number Diff line change @@ -456,16 +456,17 @@ export function stringifyClassname(
456
456
457
457
// https://github.com/wkillerud/some-sass/blob/main/vscode-extension/src/utils/string.ts
458
458
export function getEOL ( text : string ) : string {
459
- for ( let i = 0 ; i < text . length ; i ++ ) {
460
- const ch = text . charAt ( i ) ;
461
- if ( ch === "\r" ) {
462
- if ( i + 1 < text . length && text . charAt ( i + 1 ) === "\n" ) {
463
- return "\r\n" ;
464
- }
465
- return "\r" ;
466
- } else if ( ch === "\n" ) {
467
- return "\n" ;
468
- }
469
- }
470
- return "\n" ;
459
+ for ( let i = 0 ; i < text . length ; i ++ ) {
460
+ const ch = text . charAt ( i ) ;
461
+ if ( ch === '\r' ) {
462
+ if ( i + 1 < text . length && text . charAt ( i + 1 ) === '\n' ) {
463
+ return '\r\n' ;
464
+ }
465
+ return '\r' ;
466
+ }
467
+ if ( ch === '\n' ) {
468
+ return '\n' ;
469
+ }
470
+ }
471
+ return '\n' ;
471
472
}
You can’t perform that action at this time.
0 commit comments