ingeni-validation 1.1.15 → 1.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -82,6 +82,30 @@ async function validateOptional(req, res, optionalFields) {
82
82
  }
83
83
 
84
84
 
85
+ //Check Null value (Not Allow null or "null"
86
+ async function isNullValue(...params) {
87
+ for (let param of params) {
88
+
89
+ if (param == null) return true;
90
+
91
+ if (typeof param === "string") {
92
+ const val = param.trim().toLowerCase();
93
+
94
+ if (
95
+ val === "" ||
96
+ val === "null" ||
97
+ val === "undefined"
98
+ ) {
99
+ return true;
100
+ }
101
+ }
102
+ }
103
+
104
+ return false;
105
+ }
106
+
107
+
108
+
85
109
 
86
110
  //valid boolean
87
111
  async function isValidBoolean(value){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ingeni-validation",
3
- "version": "1.1.15",
3
+ "version": "1.1.16",
4
4
  "description": "Ingeni Validation",
5
5
  "license": "ISC",
6
6
  "author": "",