Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit d6b59f8

Browse files
authored
Merge pull request #77 from GabrielCastro/master
Use os.EOL to detect line endings
2 parents 55cb872 + 6831120 commit d6b59f8

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

lib/index.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var defaults = {
2929
parsers: {},
3030
workers: {},
3131

32-
lineEnding: detectLineEnding(),
32+
lineEnding: os.EOL,
3333
encoding: 'utf8'
3434
};
3535

@@ -134,19 +134,6 @@ function getSpecificationVersion() {
134134
return SPECIFICATION_VERSION;
135135
}
136136

137-
/**
138-
* Detect and return OS specific line ending.
139-
*
140-
* @returns {String}
141-
*/
142-
function detectLineEnding() {
143-
if ( os.platform() === 'win32' )
144-
return '\r\n';
145-
if ( os.platform() === 'darwin' )
146-
return '\r';
147-
return '\n';
148-
}
149-
150137
/**
151138
* Parser
152139
*

0 commit comments

Comments
 (0)