Converts tests to TypeScript (#300)
This commit is contained in:
@@ -21,7 +21,7 @@ describe('decode', () => {
|
||||
|
||||
it('returns empty list for empty inputs', () => {
|
||||
expect(
|
||||
decode([])
|
||||
decode(new Uint8Array())
|
||||
).toEqual(
|
||||
new Uint8Array([])
|
||||
);
|
||||
@@ -8,7 +8,6 @@ import internalDecode from './decode';
|
||||
|
||||
/**
|
||||
* @name decoder
|
||||
* @signature decoder (input?: Uint8Array): Uint8Array | Array<*>
|
||||
* @summary Decodes the input RLP.
|
||||
* @description
|
||||
* From an input, decode the RLP and return the result as a `Uint8Array` or `Array`.
|
||||
|
||||
@@ -8,7 +8,6 @@ import encodeU8a from './u8a';
|
||||
|
||||
/**
|
||||
* @name encoder
|
||||
* @signature encoder (input: any): Uint8Array
|
||||
* @summary Encodes the input value into RLP.
|
||||
* @description
|
||||
* From an input, calculate the RLP and return the result as a `Uint8Array`.
|
||||
|
||||
@@ -36,7 +36,7 @@ const encoders: Array<Encoder> = [
|
||||
{ check: isString, fn: convertString }
|
||||
];
|
||||
|
||||
export default function toU8a (value: any): Uint8Array {
|
||||
export default function toU8a (value?: any): Uint8Array {
|
||||
const encoder = encoders.find(({ check }) => check(value));
|
||||
|
||||
assert(encoder, 'invalid type');
|
||||
|
||||
Reference in New Issue
Block a user