Use a single StringDecoder across reads so multi-byte UTF-8 sequences that straddle the 8KB chunk boundary buffer correctly instead of producing U+FFFD replacement characters that break JSON.parse. Also fix the test mock: makeFakeFileHandle now advances an internal cursor and returns bytesRead: 0 at EOF. The prior mock copied from offset 0 every call, which would infinite-loop readJsonlPrefixLines for any line larger than the 8192-byte chunk size. Add a regression test using 3,000 CJK characters (9,000 bytes of payload) to exercise the chunk boundary path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| CHANGELOG.md | ||
| package.json | ||
| tsconfig.json | ||