UNPKG

@thisisagile/easy

Version:

Straightforward library for building domain-driven microservice architectures

40 lines (38 loc) 675 B
import { json } from "./chunk-KPEGHJSZ.mjs"; import { validate } from "./chunk-XAIHCZT4.mjs"; import { isDefined } from "./chunk-DEJ7A5PY.mjs"; // src/domain/Struct.ts var Struct = class { constructor(state = {}) { this.state = state; } get isValid() { return validate(this).isValid; } toJSON() { return json.delete(json.parse({ ...this }), "state"); } toString() { return this.constructor.name; } update(_add) { return this; } merge(a) { return json.merge(this, a); } }; function isStruct(s) { return isDefined(s) && s instanceof Struct; } export { Struct, isStruct }; //# sourceMappingURL=chunk-Z4WSXLVO.mjs.map