From 158ae0bfe900d2bac3076390c4fe3d2b54d94fe5 Mon Sep 17 00:00:00 2001 From: Stanislav <62983943+stanislavstrelnikov@users.noreply.github.com> Date: Tue, 7 Jul 2020 04:45:39 +0300 Subject: clean up code in cli/js (#6611) --- cli/js/web/console.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'cli/js/web/console.ts') diff --git a/cli/js/web/console.ts b/cli/js/web/console.ts index f6ea7a0a7..1f96bfe9d 100644 --- a/cli/js/web/console.ts +++ b/cli/js/web/console.ts @@ -1,4 +1,5 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. + import { isInvalidDate, isTypedArray, TypedArray } from "./util.ts"; import { cliTable } from "./console_table.ts"; import { exposeForTest } from "../internals.ts"; @@ -381,7 +382,7 @@ function createTypedArrayString( displayName: `${typedArrayName}(${valueLength})`, delims: ["[", "]"], entryHandler: (entry, ctx, level, maxLevel): string => { - const [_, val] = entry; + const val = entry[1]; return stringifyWithQuotes(val, ctx, level + 1, maxLevel); }, group: true, @@ -400,7 +401,7 @@ function createSetString( displayName: "Set", delims: ["{", "}"], entryHandler: (entry, ctx, level, maxLevel): string => { - const [_, val] = entry; + const val = entry[1]; return stringifyWithQuotes(val, ctx, level + 1, maxLevel); }, group: false, @@ -508,7 +509,7 @@ function createRawObjectString( } ctx.add(value); - let baseString = ""; + let baseString: string; let shouldShowDisplayName = false; let displayName = (value as { [Symbol.toStringTag]: string })[ @@ -724,7 +725,7 @@ const timerMap = new Map(); const isConsoleInstance = Symbol("isConsoleInstance"); export class Console { - #printFunc: PrintFunc; + readonly #printFunc: PrintFunc; indentLevel: number; [isConsoleInstance] = false; -- cgit v1.2.3