SIGN IN SIGN UP

fix: lower browser buffer conversion chunk size (#346)

* fix: lower browser buffer conversion chunk size

* test: cover the Buffer-less fromBuffer fallback and keep toBuffer unchanged

Per review: restore the toBuffer threshold, which never spreads bytes into
function arguments, and add regression coverage for the browser path.

The new tests stub Buffer away and check base64, binary and latin1 output
against Node across the chunk boundary (8191, 8192, 8193, 16385, 65536 and
70001 bytes, full 0x00-0xff range). A second test spies on
String.fromCharCode and asserts no call receives more than 8192 arguments;
it fails on main, where the fallback passes 65536.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: add changeset for the fromBuffer fallback fix

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(fs): clarify stack-dependent buffer conversion limits

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Hiroki Osame <hiroki.osame@gmail.com>
I
iroiro147 committed
52a5617043074e1e62e2158f211c61a4e901431c
Parent: 90df057
Committed by GitHub <noreply@github.com> on 9/30/2026, 11:47:06 AM