UNPKG

@thisisagile/easy

Version:

Straightforward library for building domain-driven microservice architectures

25 lines (23 loc) 620 B
import { convert } from "./chunk-MJAB7NZV.mjs"; import { ofGet } from "./chunk-SJGQU3OG.mjs"; // src/utils/Property.ts var Property = class { constructor(property, options) { this.property = property; this.options = options; this.options = { ...options, convert: options?.convert ?? convert.default }; } in = (source = {}) => this.options?.convert?.to(source[this.property] ?? ofGet(this.options?.dflt)); out = (source = {}, key = "") => this.options?.convert?.from(source[key]); toString() { return this.property; } }; export { Property }; //# sourceMappingURL=chunk-IMJHOYU3.mjs.map