dynamodb-toolbox
Version:
Lightweight and type-safe query builder for DynamoDB and TypeScript.
27 lines (26 loc) • 910 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ZodSchemer = void 0;
const index_js_1 = require("../../../schema/index.js");
const index_js_2 = require("./formatter/index.js");
const index_js_3 = require("./parser/index.js");
class ZodSchemer extends index_js_1.SchemaAction {
formatter(options = {}) {
if (this.schema.type === 'item') {
return (0, index_js_2.itemZodFormatter)(this.schema, options);
}
else {
return (0, index_js_2.schemaZodFormatter)(this.schema, options);
}
}
parser(options = {}) {
if (this.schema.type === 'item') {
return (0, index_js_3.itemZodParser)(this.schema, options);
}
else {
return (0, index_js_3.schemaZodParser)(this.schema, options);
}
}
}
exports.ZodSchemer = ZodSchemer;
ZodSchemer.actionName = 'zodSchemer';