TextEncoder allows non-Uint8Array Buffers (#596)
* TextEncoder allows non-Uint8Array Buffers * Add eslintrc to eslintignore
This commit is contained in:
@@ -8,7 +8,7 @@ describe('stringToU8a', (): void => {
|
||||
it('decodes to an empty string for undefined', (): void => {
|
||||
expect(
|
||||
stringToU8a()
|
||||
).toEqual(new Uint8Array([]));
|
||||
).toEqual(new Uint8Array());
|
||||
});
|
||||
|
||||
it('encodes the string correctly', (): void => {
|
||||
|
||||
@@ -39,5 +39,5 @@ try {
|
||||
export default function stringToU8a (value?: string): Uint8Array {
|
||||
return value
|
||||
? encoder.encode(value)
|
||||
: new Uint8Array([]);
|
||||
: new Uint8Array();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user