acebase/dist/cjs/assert.js
Ewout Stortenbeker 2b0fca3aea chore: build
2022-12-05 17:06:39 +01:00

15 lines
No EOL
474 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.assert = void 0;
/**
* Replacement for console.assert, throws an error if condition is not met.
* @param condition 'truthy' condition
* @param error
*/
function assert(condition, error) {
if (!condition) {
throw new Error(`Assertion failed: ${error !== null && error !== void 0 ? error : 'check your code'}`);
}
}
exports.assert = assert;
//# sourceMappingURL=assert.js.map