Skip to content

Allow wrapped callbacks to return Uint8Array - #368

Open
Aschenbath wants to merge 1 commit into
keichi:masterfrom
Aschenbath:fix/oss-20-round4-20261125-77d1-binary-wrapper-output
Open

Aschenbath wants to merge 1 commit into
keichi:masterfrom
Aschenbath:fix/oss-20-round4-20261125-77d1-binary-wrapper-output

Conversation

@Aschenbath

Copy link
Copy Markdown
Contributor

wrapped() supports returning either a Buffer or a Uint8Array, as documented and already exercised by the runtime tests, but its callback declaration only permits Buffer. This rejects callbacks such as input => Uint8Array.from(input) with TS2322. Allow Uint8Array results and run compile fixtures through npm test, including Buffer compatibility and rejection of unsupported ArrayBuffer output.

Both Uint8Array fixtures fail to compile against the unchanged declaration. With the fix, npm test passes all 256 runtime tests and the new type checks. A separate consumer compiles the emitted declarations and passes four Buffer/Uint8Array runtime combinations. The Chromium suite passes 127 tests with the existing Node-only zlib test skipped; build, lint, full formatting, and git diff --check pass.

Developed with OpenAI Codex assistance and independently reviewed against the tested file hashes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant