@chassisjs/hermes
Version:
Production-Ready TypeScript Outbox Pattern
14 lines • 434 B
JavaScript
import { AssertionError } from '../core/errors.js';
const assert = (conditionToBeTruthy, message, details) => {
if (!!conditionToBeTruthy === false) {
if (message instanceof AssertionError) {
throw message;
}
throw new AssertionError({
forValue: details?.actual,
forKey: details?.field,
}, message);
}
};
export { assert };
//# sourceMappingURL=assert.js.map