astro-ghostcms/.pnpm-store/v3/files/94/1af77935d18c7228ef8218fae29...

17 lines
396 B
Plaintext
Raw Normal View History

2024-02-14 14:10:47 +00:00
// Run-time checking of preconditions.
function fail(message) {
throw new Error(message);
}
// Precondition function that checks if the given predicate is true.
// If not, it will throw an error.
function argument(predicate, message) {
if (!predicate) {
fail(message);
}
}
export { fail, argument, argument as assert };
export default { fail, argument, assert: argument };