TextEncoder allows non-Uint8Array Buffers (#596)
* TextEncoder allows non-Uint8Array Buffers * Add eslintrc to eslintignore
This commit is contained in:
@@ -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 => {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user