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);