@@ -28,7 +28,8 @@ class DtsContent {
28
28
rInputPath,
29
29
rawTokenList,
30
30
resultList,
31
- messageList
31
+ messageList,
32
+ EOL
32
33
} ) {
33
34
this . dropExtension = dropExtension ;
34
35
this . rootDir = rootDir ;
@@ -38,6 +39,7 @@ class DtsContent {
38
39
this . rawTokenList = rawTokenList ;
39
40
this . resultList = resultList ;
40
41
this . messageList = messageList ;
42
+ this . EOL = EOL ;
41
43
}
42
44
43
45
get contents ( ) {
@@ -46,7 +48,7 @@ class DtsContent {
46
48
47
49
get formatted ( ) {
48
50
if ( ! this . resultList || ! this . resultList . length ) return '' ;
49
- return this . resultList . join ( os . EOL ) ;
51
+ return this . resultList . join ( this . EOL ) ;
50
52
}
51
53
52
54
get tokens ( ) {
@@ -68,7 +70,7 @@ class DtsContent {
68
70
mkdirp . sync ( outPathDir ) ;
69
71
}
70
72
return new Promise ( ( resolve , reject ) => {
71
- fs . writeFile ( this . outputFilePath , this . formatted + os . EOL , 'utf8' , ( err ) => {
73
+ fs . writeFile ( this . outputFilePath , this . formatted + this . EOL , 'utf8' , ( err ) => {
72
74
if ( err ) {
73
75
reject ( err ) ;
74
76
} else {
@@ -90,6 +92,7 @@ export class DtsCreator {
90
92
this . outputDirectory = path . join ( this . rootDir , this . outDir ) ;
91
93
this . camelCase = options . camelCase ;
92
94
this . dropExtension = ! ! options . dropExtension ;
95
+ this . EOL = options . EOL || os . EOL ;
93
96
}
94
97
95
98
create ( filePath , initialContents , clearCache = false ) {
@@ -132,7 +135,8 @@ export class DtsCreator {
132
135
rInputPath,
133
136
rawTokenList : keys ,
134
137
resultList : result ,
135
- messageList
138
+ messageList,
139
+ EOL : this . EOL
136
140
} ) ;
137
141
138
142
resolve ( content ) ;
0 commit comments