Converts tests to TypeScript (#300)

This commit is contained in:
Jaco Greeff
2019-02-14 10:48:08 +01:00
committed by GitHub
parent 2a14a8b553
commit 1e6eb2c283
158 changed files with 89 additions and 183 deletions
@@ -21,7 +21,7 @@ describe('decode', () => {
it('returns empty list for empty inputs', () => {
expect(
decode([])
decode(new Uint8Array())
).toEqual(
new Uint8Array([])
);
-1
View File
@@ -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`.
-1
View File
@@ -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`.
+1 -1
View File
@@ -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');