Skip to content

Commit c103fa4

Browse files
authored
fix: add asserts to needs (#327)
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.
1 parent 406d053 commit c103fa4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/material-management/src/needs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function needs(
1616
condition: any,
1717
errorMessage: string,
1818
Err: ErrorConstructor = Error
19-
) {
19+
): asserts condition {
2020
if (!condition) {
2121
throw new Err(errorMessage)
2222
}

0 commit comments

Comments
 (0)