TextEncoder allows non-Uint8Array Buffers (#596)

* TextEncoder allows non-Uint8Array Buffers

* Add eslintrc to eslintignore
This commit is contained in:
Jaco Greeff
2020-05-11 09:57:00 +02:00
committed by GitHub
parent d3583dc432
commit d1de30907f
17 changed files with 1106 additions and 953 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ describe('bnToU8a', (): void => {
it('converts null values to 0x00', (): void => {
expect(
bnToU8a(null, -1, false)
).toEqual(new Uint8Array([]));
).toEqual(new Uint8Array());
});
it('converts null values to 0x00000000 (bitLength)', (): void => {
+1 -1
View File
@@ -43,7 +43,7 @@ function bnToU8a (value: BN | BigInt | number | null, arg1: number | Options = {
if (!value) {
return _options.bitLength === -1
? new Uint8Array([])
? new Uint8Array()
: new Uint8Array(byteLength);
}