diff options
Diffstat (limited to 'editors/code/src/util.ts')
-rw-r--r-- | editors/code/src/util.ts | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/editors/code/src/util.ts b/editors/code/src/util.ts index 5c89bc62c..f56c6bada 100644 --- a/editors/code/src/util.ts +++ b/editors/code/src/util.ts | |||
@@ -2,7 +2,7 @@ import * as lc from "vscode-languageclient"; | |||
2 | import * as vscode from "vscode"; | 2 | import * as vscode from "vscode"; |
3 | import { strict as nativeAssert } from "assert"; | 3 | import { strict as nativeAssert } from "assert"; |
4 | 4 | ||
5 | export function assert(condition: unknown, explanation: string): asserts condition { | 5 | export function assert(condition: boolean, explanation: string): asserts condition { |
6 | try { | 6 | try { |
7 | nativeAssert(condition, explanation); | 7 | nativeAssert(condition, explanation); |
8 | } catch (err) { | 8 | } catch (err) { |
@@ -11,16 +11,6 @@ export function assert(condition: unknown, explanation: string): asserts conditi | |||
11 | } | 11 | } |
12 | } | 12 | } |
13 | 13 | ||
14 | assert.eq = <T>(bibba: unknown, bobba: T, explanation: string): asserts bibba is T => { | ||
15 | try { | ||
16 | nativeAssert.strictEqual(bibba, bobba, explanation); | ||
17 | } catch (err) { | ||
18 | log.error(`Equality assertion failed:`, explanation); | ||
19 | throw err; | ||
20 | } | ||
21 | }; | ||
22 | |||
23 | |||
24 | export const log = { | 14 | export const log = { |
25 | enabled: true, | 15 | enabled: true, |
26 | debug(message?: any, ...optionalParams: any[]): void { | 16 | debug(message?: any, ...optionalParams: any[]): void { |