Skip to content

unhandled exception introduced in v4.0.9 #74

@shamilovtim

Description

@shamilovtim

Prior to v4.0.9 if plain Arrays were passed into uint8arrays's own concat it would convert those Arrays into a Uint8Array using the asUint8Array helper.

In v4.0.9 a change was introduced such that:

return asUint8Array(globalThis.Buffer.concat(arrays, length))

The problem is that globalThis.Buffer.concat(arrays, length) is passing plain arrays into Buffer.concat before asUint8Array ever has a chance to convert them, which throws an unhandled exception:

Error: [TypeError: "list" argument must be an Array of Buffers]

The fix would either be to revert the change in v4.0.9 or to convert each non-buffer into a Uint8Array first prior to calling globalThis.Buffer.concat(arrays, length). I assume any performance gains will need to be re-evaluated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions