"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: Object.getOwnPropertyDescriptor(all, name).get
    });
}
_export(exports, {
    get validateInput () {
        return validateInput;
    },
    get validateMiddleware () {
        return validateMiddleware;
    }
});
const _runtimeexceptions = require("../exceptions/runtime.exceptions");
async function validateInput(data, zodSchema) {
    const result = await zodSchema.safeParseAsync(data);
    if (!result.success) {
        throw new _runtimeexceptions.ValidationException(result.error);
    }
    return result.data;
}
async function validateMiddleware(req, zodSchema) {
    return validateInput(req.body, zodSchema);
}

//# sourceMappingURL=validators.js.map