UNPKG

@thisisagile/easy

Version:

Straightforward library for building domain-driven microservice architectures

30 lines (28 loc) 651 B
import { ofConstruct } from "./chunk-ZPNFXK7Y.mjs"; import { isDefined, isNotEmpty, isTrue } from "./chunk-DEJ7A5PY.mjs"; // src/utils/If.ts function ifTrue(o, f, alt) { return isTrue(o) ? ofConstruct(f, o) : ofConstruct(alt, o); } function ifFalse(o, f, alt) { return !isTrue(o) ? ofConstruct(f, o) : ofConstruct(alt, o); } function ifDefined(o, f, alt) { return isDefined(o) ? ofConstruct(f, o) : ofConstruct(alt); } function ifNotEmpty(o, f = (o2) => o2, alt) { return isNotEmpty(o) ? ofConstruct(f, o) : ofConstruct(alt, o); } export { ifTrue, ifFalse, ifDefined, ifNotEmpty }; //# sourceMappingURL=chunk-JSON7A4X.mjs.map