Server: reorganize express validators
This commit is contained in:
parent
e62f6ef741
commit
e4c556196d
8 changed files with 100 additions and 52 deletions
18
server/helpers/custom-validators/misc.js
Normal file
18
server/helpers/custom-validators/misc.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
'use strict'
|
||||
|
||||
const miscValidators = {
|
||||
exists: exists,
|
||||
isArray: isArray
|
||||
}
|
||||
|
||||
function exists (value) {
|
||||
return value !== undefined && value !== null
|
||||
}
|
||||
|
||||
function isArray (value) {
|
||||
return Array.isArray(value)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
module.exports = miscValidators
|
Loading…
Add table
Add a link
Reference in a new issue