mirror of
https://github.com/fooflington/selfdefined.git
synced 2025-06-12 13:41:40 +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)
|
|
}
|
|
}
|