From 6dc598fa6331de6124a255527e37804d82372fdc Mon Sep 17 00:00:00 2001 From: Veetaha Date: Sat, 29 Feb 2020 00:46:48 +0200 Subject: vscode: simplify assert.eq() to assert() as per matklad --- editors/code/src/util.ts | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'editors/code/src/util.ts') 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"; import * as vscode from "vscode"; import { strict as nativeAssert } from "assert"; -export function assert(condition: unknown, explanation: string): asserts condition { +export function assert(condition: boolean, explanation: string): asserts condition { try { nativeAssert(condition, explanation); } catch (err) { @@ -11,16 +11,6 @@ export function assert(condition: unknown, explanation: string): asserts conditi } } -assert.eq = (bibba: unknown, bobba: T, explanation: string): asserts bibba is T => { - try { - nativeAssert.strictEqual(bibba, bobba, explanation); - } catch (err) { - log.error(`Equality assertion failed:`, explanation); - throw err; - } -}; - - export const log = { enabled: true, debug(message?: any, ...optionalParams: any[]): void { -- cgit v1.2.3