Skip to content

Implementation of the equals method differs from Node.js #218

@yvgny

Description

@yvgny

Node.js Buffers allow the equality comparison with an Uint8Array, but here it throws a TypeError

For example, this simple statement :

Buffer.from([1 , 2, 3]).equals(new Uint8Array([1, 2, 3]))

returns true on Node.js, but throws an error in the browser.

The equivalent Node.js implementation is here : https://github.com/nodejs/node/blob/88105c998ef9d3f54aa8f22b82ec8cc31cbfac95/lib/buffer.js#L671

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions