The code is this:
|
stdout: (data: Buffer) => (stdout += data.toString()), |
|
stderr: (data: Buffer) => (stderr += data.toString()) |
However, consider that stdout/stderr has fancy Unicode, the data may arrive in chunks, other than the code point boundaries.
toString conversion will then clobber the code points:
> Buffer.from([0xf0, 0x9f]).toString() + Buffer.from([0x98, 0x84]).toString()
'���'
> Buffer.from([0xf0, 0x9f, 0x98, 0x84]).toString()
'😄'
The code is this:
paths-filter/src/exec.ts
Lines 10 to 11 in 8c7f485
However, consider that stdout/stderr has fancy Unicode, the data may arrive in chunks, other than the code point boundaries.
toStringconversion will then clobber the code points: