mirror of
https://github.com/appy-one/acebase.git
synced 2026-06-30 06:02:02 -06:00
15 lines
No EOL
474 B
JavaScript
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
|