Skip to content

Commit

Permalink
Use let instead of var
Browse files Browse the repository at this point in the history
  • Loading branch information
jyyi1 committed Apr 24, 2024
1 parent f316270 commit 3a376db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/build/spawn_stream.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ function newChildProcessOutputPipeTransform(callback) {
// If our transform is called twice with 'abc' and then 'def\n', we need to output
// only one line 'abcdef\n' instead of two 'abc\n', 'def\n'.
// This is used to store the unfinished line we received before.
var pendingLine = '';
let pendingLine = '';

return new Transform({
// transform will be called whenever the upstream source pushes data to us
transform(chunk, encoding, done) {
// encoding will always be 'buffer'
const lines = chunk.toString().split('\n');
const lastLine = lines.pop();
if (lines.length > 0) {
Expand Down

0 comments on commit 3a376db

Please sign in to comment.