Skip to content

Commit

Permalink
Use string templating and add space
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinkassimo committed Jun 7, 2018
1 parent 1403456 commit 70457c2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function stringify(ctx: ConsoleContext, value: any): string {
if (valStrings.length === 0) {
return "[]";
}
return `[${valStrings.join(", ")}]`;
return `[ ${valStrings.join(", ")} ]`;
} else {
for (const key of Object.keys(value)) {
valStrings.push(`${key}: ${stringify(ctx, value[key])}`);
Expand Down Expand Up @@ -79,15 +79,15 @@ export class Console {

// tslint:disable-next-line:no-any
warn(...args: any[]): void {
print("ERROR: " + stringifyArgs(args));
print(`ERROR: ${stringifyArgs(args)}`);
}

error = this.warn;

// tslint:disable-next-line:no-any
assert(condition: boolean, ...args: any[]): void {
if (!condition) {
throw new Error("Assertion failed: " + stringifyArgs(args));
throw new Error(`Assertion failed: ${stringifyArgs(args)}`);
}
}
}

0 comments on commit 70457c2

Please sign in to comment.