Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MR414N-ID
GitHub Repository: MR414N-ID/botku2
Path: blob/master/node_modules/@hapi/hoek/lib/assert.js
1126 views
1
'use strict';
2
3
const AssertError = require('./error');
4
5
6
const internals = {};
7
8
9
module.exports = function (condition, ...args) {
10
11
if (condition) {
12
return;
13
}
14
15
if (args.length === 1 &&
16
args[0] instanceof Error) {
17
18
throw args[0];
19
}
20
21
throw new AssertError(args);
22
};
23
24