Skip to content

Commit a4cdae1

Browse files
committed
fix: support all kinds of newlines
1 parent 3f4bed4 commit a4cdae1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/properties.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ export const empty = (): Properties => ({lines: []})
3434
* @return Parsed configuration.
3535
*/
3636
export const parse = (contents: string): Properties => {
37-
const lines = contents.split(/\r?\n/)
37+
// NOTE all line separators are valid - LF, CRLF, CR
38+
const lines = contents.split(/\r|\r?\n/)
3839

3940
// Remove last line, if empty
4041
if (lines.length > 0 && lines[lines.length - 1].length === 0) {

0 commit comments

Comments
 (0)