Files
emaui/node_modules/@mantine/form/esm/resolvers/yup-resolver/yup-resolver.mjs
2026-05-29 15:23:46 +03:00

21 lines
506 B
JavaScript

'use client';
function yupResolver(schema) {
const _schema = schema;
return (values) => {
try {
_schema.validateSync(values, { abortEarly: false });
return {};
} catch (_yupError) {
const yupError = _yupError;
const results = {};
yupError.inner.forEach((error) => {
results[error.path.replaceAll("[", ".").replaceAll("]", "")] = error.message;
});
return results;
}
};
}
export { yupResolver };
//# sourceMappingURL=yup-resolver.mjs.map