strtok3 10.4.0 → 10.4.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.
@@ -24,7 +24,12 @@ export class StreamReader extends AbstractStreamReader {
24
24
  }
25
25
  });
26
26
  this.s.once('error', err => this.reject(err));
27
- this.s.once('close', () => this.abort());
27
+ this.s.once('close', () => {
28
+ // Normal EOF may leave peeked bytes that the caller still needs to consume.
29
+ if (!this.endOfStream) {
30
+ void this.abort();
31
+ }
32
+ });
28
33
  }
29
34
  /**
30
35
  * Read chunk from stream
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strtok3",
3
- "version": "10.4.0",
3
+ "version": "10.4.1",
4
4
  "description": "A promise based streaming tokenizer",
5
5
  "author": {
6
6
  "name": "Borewit",