mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
parent
29137c69f1
commit
cd7388f4da
|
@ -9,6 +9,8 @@ export const splitNewLines = () => new StreamSplitter('\n'.charCodeAt(0));
|
|||
|
||||
/**
|
||||
* Copied and simplified from src\vs\base\node\nodeStreams.ts
|
||||
*
|
||||
* Exception: does not include the split character in the output.
|
||||
*/
|
||||
export class StreamSplitter extends Transform {
|
||||
private buffer: Buffer | undefined;
|
||||
|
@ -31,7 +33,7 @@ export class StreamSplitter extends Transform {
|
|||
break;
|
||||
}
|
||||
|
||||
this.push(this.buffer.subarray(offset, index + 1));
|
||||
this.push(this.buffer.subarray(offset, index));
|
||||
offset = index + 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue