@lsdsoftware/utils 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,7 +13,7 @@ function makeLineReader(lineCallback) {
13
13
  write(chunk, encoding, callback) {
14
14
  // encoding param here is irrelevant because it applies only to string chunks
15
15
  const chunkStr = remainder + decoder.write(chunk);
16
- const lines = chunkStr.split('\n');
16
+ const lines = chunkStr.split(/\r?\n/);
17
17
  // Keep the last line in remainder if it doesn't end with a newline character.
18
18
  remainder = lines.pop();
19
19
  // Push each complete line.
@@ -16,7 +16,7 @@ exports.default = {
16
16
  return __awaiter(this, void 0, void 0, function* () {
17
17
  const lines = [];
18
18
  const splitter = (0, line_reader_1.makeLineReader)(line => lines.push(line));
19
- splitter.write('This is a line\nThis is another line\nAnd this is a line as well');
19
+ splitter.write('This is a line\nThis is another line\r\nAnd this is a line as well');
20
20
  splitter.end();
21
21
  assert(lines[0] == "This is a line" &&
22
22
  lines[1] == "This is another line" &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lsdsoftware/utils",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Useful JavaScript utilities",
5
5
  "main": "dist/index.js",
6
6
  "files": [