UNPKG

@thisisagile/easy

Version:

Straightforward library for building domain-driven microservice architectures

49 lines (47 loc) 791 B
import { asString } from "./chunk-NNA77YYC.mjs"; // src/utils/Convert.ts var Convert = class { constructor(from, to) { this.from = from; this.to = to; } }; var convert = { default: new Convert( (a) => a, (a) => a ), ignore: new Convert( () => void 0, () => void 0 ), toBool: { fromNumber: new Convert( (b) => b ? 1 : 0, (n) => n !== 0 ), fromString: new Convert( (b) => b ? "true" : "false", (s) => s === "true" ) }, toDate: { fromString: new Convert( (s) => new Date(s).toISOString(), (s) => s ) }, toNumber: { fromString: new Convert( (n) => asString(n), (s) => parseInt(s) ) } }; export { Convert, convert }; //# sourceMappingURL=chunk-MJAB7NZV.mjs.map