mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-28 21:03:11 -05:00
13 lines
242 B
JavaScript
13 lines
242 B
JavaScript
|
import { celebrate, errors } from 'celebrate'
|
||
|
|
||
|
export { Joi } from 'celebrate'
|
||
|
|
||
|
export const errorMiddleware = errors()
|
||
|
|
||
|
/**
|
||
|
* Validation middleware
|
||
|
*/
|
||
|
export function validate(schema) {
|
||
|
return celebrate(schema, { allowUnknown: true })
|
||
|
}
|