Skip to content
This repository has been archived by the owner on Jan 7, 2020. It is now read-only.

NameAndTag contains ArrayType instead of Buffer #346

Open
b-zee opened this issue Feb 7, 2019 · 1 comment
Open

NameAndTag contains ArrayType instead of Buffer #346

b-zee opened this issue Feb 7, 2019 · 1 comment

Comments

@b-zee
Copy link
Contributor

b-zee commented Feb 7, 2019

According to the documentation the NameAndTag type returned by getNameAndTag contains a Buffer instance.

Following snippet shows this is not the case, it returns an ArrayType (mdn?):

const nat = await md.getNameAndTag();
console.log(nat.name.constructor.name);  // 'ArrayType'
console.log(nat.name instanceof Buffer); // false
console.dir(nat.name);                   // ArrayType {buffer: Buffer(32), length: ...

Expected behaviour:

const nat = await md.getNameAndTag();
console.log(nat.name.constructor.name);  // 'Buffer'
console.log(nat.name instanceof Buffer); // true
console.dir(nat.name);                   // Buffer(32) [...
@hunterlester
Copy link
Contributor

You're awesome @b-zee, thank you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants