Skip to content

Fails in combination with Buffer module trying to test with Buffer.isBuffer #5

@dignifiedquire

Description

@dignifiedquire

Given the following:

// global.Buffer should be the buffer module from npm
var array = new Uint8Array([1,2,3])
var buf = toBuffer(array)
assert(Buffer.isBuffer(buf)) // throws

The reason for this is that the isBuffer check checks for ._isBuffer on the element but the code path on here https://github.com/feross/typedarray-to-buffer/blob/master/index.js#L17-L19 does not add that property.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions