summaryrefslogtreecommitdiff
path: root/js/util.ts
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2019-03-10 04:30:38 +1100
committerRyan Dahl <ry@tinyclouds.org>2019-03-09 12:30:38 -0500
commit034e2cc02829c9244b32232074c7a48af827a2fb (patch)
treebade01606a1ee076c1f753ce99c97ddb1e4edf30 /js/util.ts
parent8c7a12d1b258f0ef5ab27f49c424331d43e8d97f (diff)
Migrate from tslint to eslint for linting (#1905)
Diffstat (limited to 'js/util.ts')
-rw-r--r--js/util.ts8
1 files changed, 3 insertions, 5 deletions
diff --git a/js/util.ts b/js/util.ts
index 6f8c72f50..e6f38c8e1 100644
--- a/js/util.ts
+++ b/js/util.ts
@@ -16,15 +16,14 @@ export function setLogDebug(debug: boolean, source?: string): void {
* Enable with the `--log-debug` or `-D` command line flag.
* @internal
*/
-// tslint:disable-next-line:no-any
-export function log(...args: any[]): void {
+export function log(...args: unknown[]): void {
if (logDebug) {
console.log(`DEBUG ${logSource} -`, ...args);
}
}
// @internal
-export function assert(cond: boolean, msg = "assert") {
+export function assert(cond: boolean, msg = "assert"): void {
if (!cond) {
throw Error(msg);
}
@@ -62,7 +61,7 @@ export function arrayToStr(ui8: Uint8Array): string {
export interface ResolvableMethods<T> {
resolve: (value?: T | PromiseLike<T>) => void;
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
reject: (reason?: any) => void;
}
@@ -107,7 +106,6 @@ export function containsOnlyASCII(str: string): boolean {
return /^[\x00-\x7F]*$/.test(str);
}
-// tslint:disable-next-line:variable-name
const TypedArrayConstructor = Object.getPrototypeOf(Uint8Array);
export function isTypedArray(x: unknown): x is TypedArray {
return x instanceof TypedArrayConstructor;