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