added bigInteger custom validator
This commit is contained in:
parent
0c146c201e
commit
ff23689c0e
|
|
@ -3,9 +3,11 @@ import { check } from 'express-validator'
|
|||
const varChar = (field, { max = 255 } = {}) => check(field).isString().trim().isLength({ min: 1, max }).withMessage(`|${field}| must be a string with a length between 1 and ${max}`)
|
||||
const integer = field => check(field).isInt({min: Number.MIN_SAFE_INTEGER, max: Number.MAX_SAFE_INTEGER}).withMessage(`|${field}| must be an integer`)
|
||||
const uuid = field => check(field).isUUID('all').withMessage(`|${field}| must be a valid UUID`)
|
||||
const bigInt = field => check(field).isBigInt().withMessage(`|${field}| must be a valid BigInt`)
|
||||
|
||||
export {
|
||||
integer,
|
||||
uuid,
|
||||
varChar,
|
||||
}
|
||||
bigInt
|
||||
}
|
||||
Loading…
Reference in New Issue