22 lines
731 B
JavaScript
22 lines
731 B
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.assert = assert;
|
|
exports.assertDefined = assertDefined;
|
|
exports.assertDefinedAndNotNull = assertDefinedAndNotNull;
|
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
function assert(condition, msg) {
|
|
if (!condition) {
|
|
throw new Error(msg || "condition is not truthy");
|
|
}
|
|
}
|
|
function assertDefined(value, msg) {
|
|
if (value === undefined) {
|
|
throw new Error(msg ?? "value is undefined");
|
|
}
|
|
}
|
|
function assertDefinedAndNotNull(value, msg) {
|
|
if (value === undefined || value === null) {
|
|
throw new Error(msg ?? "value is undefined or null");
|
|
}
|
|
}
|
|
//# sourceMappingURL=assert.js.map
|