mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-04 20:04:58 -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 })
|
||
|
}
|