typescript-eslint 2 (#462)

* typescript-eslint 2

* startsWith fixes

* padStart/padEnd
This commit is contained in:
Jaco Greeff
2019-08-30 12:24:16 +02:00
committed by GitHub
parent 67513ed7a4
commit 25fc033728
66 changed files with 185 additions and 174 deletions
+1 -1
View File
@@ -18,7 +18,7 @@
* u8aFixLength('0x1234', 8) // => 0x12
* ```
*/
export default function u8aFixLength (value: Uint8Array, bitLength: number = -1, atStart: boolean = false): Uint8Array {
export default function u8aFixLength (value: Uint8Array, bitLength = -1, atStart = false): Uint8Array {
const byteLength = Math.ceil(bitLength / 8);
if (bitLength === -1 || value.length === byteLength) {
-1
View File
@@ -21,6 +21,5 @@ export default function u8aToBuffer (value?: Uint8Array | null): Buffer {
return Buffer.from([]);
}
// @ts-ignore yes, from also works with u8a
return Buffer.from(value);
}
+1 -1
View File
@@ -18,7 +18,7 @@ const ALPHABET = '0123456789abcdef';
* u8aToHex(new Uint8Array([0x68, 0x65, 0x6c, 0x6c, 0xf])); // 0x68656c0f
* ```
*/
export default function u8aToHex (value?: Uint8Array | null, bitLength: number = -1, isPrefixed: boolean = true): string {
export default function u8aToHex (value?: Uint8Array | null, bitLength = -1, isPrefixed = true): string {
const prefix = isPrefixed
? '0x'
: '';