From e4c556196d7b31111f17596840d2e1d60caa7dcb Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Sun, 31 Jul 2016 20:58:43 +0200 Subject: Server: reorganize express validators --- server/helpers/custom-validators/misc.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 server/helpers/custom-validators/misc.js (limited to 'server/helpers/custom-validators/misc.js') diff --git a/server/helpers/custom-validators/misc.js b/server/helpers/custom-validators/misc.js new file mode 100644 index 000000000..782ae3dee --- /dev/null +++ b/server/helpers/custom-validators/misc.js @@ -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 -- cgit v1.2.3