summaryrefslogtreecommitdiff
path: root/js/util.ts
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2019-04-21 16:40:10 -0400
committerGitHub <noreply@github.com>2019-04-21 16:40:10 -0400
commit9dfebbc9496138efbeedc431068f41662c780f3e (patch)
treec3718c3dc132d11c08c8fc18933daebf886bf787 /js/util.ts
parent6cded14bdf313762956d4d5361cfe8115628b535 (diff)
Fix eslint warnings (#2151)
Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com> Co-authored-by: LE GOFF Vincent <g_n_s@hotmail.fr>
Diffstat (limited to 'js/util.ts')
-rw-r--r--js/util.ts17
1 files changed, 11 insertions, 6 deletions
diff --git a/js/util.ts b/js/util.ts
index 348e36a1f..033a2f754 100644
--- a/js/util.ts
+++ b/js/util.ts
@@ -71,9 +71,11 @@ export type Resolvable<T> = Promise<T> & ResolvableMethods<T>;
// @internal
export function createResolvable<T>(): Resolvable<T> {
let methods: ResolvableMethods<T>;
- const promise = new Promise<T>((resolve, reject) => {
- methods = { resolve, reject };
- });
+ const promise = new Promise<T>(
+ (resolve, reject): void => {
+ methods = { resolve, reject };
+ }
+ );
// TypeScript doesn't know that the Promise callback occurs synchronously
// therefore use of not null assertion (`!`)
return Object.assign(promise, methods!) as Resolvable<T>;
@@ -92,9 +94,12 @@ export function unreachable(): never {
// @internal
export function hexdump(u8: Uint8Array): string {
return Array.prototype.map
- .call(u8, (x: number) => {
- return ("00" + x.toString(16)).slice(-2);
- })
+ .call(
+ u8,
+ (x: number): string => {
+ return ("00" + x.toString(16)).slice(-2);
+ }
+ )
.join(" ");
}