overleaf/services/project-history/app/js/Validation.js

13 lines
242 B
JavaScript
Raw Normal View History

import { celebrate, errors } from 'celebrate'
export { Joi } from 'celebrate'
export const errorMiddleware = errors()
/**
* Validation middleware
*/
export function validate(schema) {
return celebrate(schema, { allowUnknown: true })
}