fediversity.eu/node_modules/@hapi/hoek/lib/assert.js
2024-03-26 16:28:28 +01:00

23 lines
307 B
JavaScript
Executable file

'use strict';
const AssertError = require('./error');
const internals = {};
module.exports = function (condition, ...args) {
if (condition) {
return;
}
if (args.length === 1 &&
args[0] instanceof Error) {
throw args[0];
}
throw new AssertError(args);
};