(expr: boolean, msg: string|(() => string))
| 21 | * Tests a boolean expression and throws a message if false. |
| 22 | */ |
| 23 | export function assert(expr: boolean, msg: string|(() => string)) { |
| 24 | if (!expr) { |
| 25 | throw new Error(typeof msg === 'string' ? msg : msg()); |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | export function assertShapesMatch( |
| 30 | shapeA: number[], shapeB: number[], errorMessagePrefix = ''): void { |
no outgoing calls
no test coverage detected
searching dependent graphs…