mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 05:42:15 -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 })
|
||
|
}
|