"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.replaceDatesWithStrings = void 0;
const zod_1 = require("zod");
const replaceDatesWithStrings = (schema) => {
    if (schema instanceof zod_1.ZodDate) {
        return zod_1.z.string().datetime();
    }
    if (schema instanceof zod_1.ZodObject) {
        const newShape = {};
        for (const key in schema.shape) {
            newShape[key] = (0, exports.replaceDatesWithStrings)(schema.shape[key]);
        }
        return zod_1.z.object(newShape);
    }
    if (schema instanceof zod_1.ZodArray) {
        return zod_1.z.array((0, exports.replaceDatesWithStrings)(schema.element));
    }
    if (schema instanceof zod_1.ZodUnion) {
        return zod_1.z.union(schema._def.options.map((option) => (0, exports.replaceDatesWithStrings)(option)));
    }
    if (schema instanceof zod_1.ZodIntersection) {
        return zod_1.z.intersection((0, exports.replaceDatesWithStrings)(schema._def.left), (0, exports.replaceDatesWithStrings)(schema._def.right));
    }
    return schema;
};
exports.replaceDatesWithStrings = replaceDatesWithStrings;
//# sourceMappingURL=zod-without-dates.js.map