From a7f5df06868fd08aa076f0af79024be0e915b0ba Mon Sep 17 00:00:00 2001 From: seebees Date: Thu, 30 Apr 2020 14:57:51 -0700 Subject: [PATCH] fix: add asserts to `needs` TypeScript 3.7 released support for assertion functions, that support positive assertions that can be evaluated in TypeScript. This updates the `needs` function to export this behavior, so it can be used. --- modules/material-management/src/needs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/material-management/src/needs.ts b/modules/material-management/src/needs.ts index 5c62a662b..b5d310fba 100644 --- a/modules/material-management/src/needs.ts +++ b/modules/material-management/src/needs.ts @@ -16,7 +16,7 @@ export function needs( condition: any, errorMessage: string, Err: ErrorConstructor = Error -) { +): asserts condition { if (!condition) { throw new Err(errorMessage) }