Assertions: Allow typescript to infer condition correctly

This commit is contained in:
networkException 2022-01-04 00:42:06 +01:00
parent 979d8a5e74
commit b5aaee998c

View file

@ -1,4 +1,4 @@
export function VERIFY(condition: boolean, message?: string): asserts condition is true {
export function VERIFY(condition: boolean, message?: string): asserts condition {
if (!condition) throw new Error(`VERIFY: ${message ?? 'Condition was not met.'}`);
}