mirror of
https://github.com/fooflington/selfdefined.git
synced 2025-06-13 05:55:26 +00:00
9 lines
214 B
JavaScript
9 lines
214 B
JavaScript
![]() |
import { AssertionError } from './error.js'
|
||
|
|
||
|
export default function (predicate, message) {
|
||
|
if (!predicate) {
|
||
|
message = message || `expect ${predicate} to be true`
|
||
|
throw new AssertionError(message)
|
||
|
}
|
||
|
}
|