From 0833e72d06a73a546fb4b00d9bdcbc1f9693b660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Mon, 26 Sep 2022 12:53:43 +0200 Subject: [PATCH] Make `assert` method an assertion function in TS --- lib/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/types.ts b/lib/types.ts index ce998b46..d75630c8 100644 --- a/lib/types.ts +++ b/lib/types.ts @@ -27,7 +27,7 @@ abstract class BaseType { abstract check(value: any, deep?: Deep): value is T; - assert(value: any, deep?: Deep): value is T { + assert(value: any, deep?: Deep): asserts value is T { if (!this.check(value, deep)) { var str = shallowStringify(value); throw new Error(str + " does not match type " + this);