mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-14 20:40:17 -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 })
|
||
|
}
|