mirror of
https://github.com/appy-one/acebase.git
synced 2026-06-30 06:02:02 -06:00
11 lines
No EOL
318 B
JavaScript
11 lines
No EOL
318 B
JavaScript
/**
|
|
* Replacement for console.assert, throws an error if condition is not met.
|
|
* @param condition 'truthy' condition
|
|
* @param error
|
|
*/
|
|
export function assert(condition, error) {
|
|
if (!condition) {
|
|
throw new Error(`Assertion failed: ${error ?? 'check your code'}`);
|
|
}
|
|
}
|
|
//# sourceMappingURL=assert.js.map
|