ingeni-validation 1.0.8 → 1.0.9
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.
- package/ingeni-validation.js +13 -2
- package/package.json +1 -1
package/ingeni-validation.js
CHANGED
|
@@ -80,7 +80,18 @@ const optionMissingFields = optionalFields.filter(
|
|
|
80
80
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
//Check Boolean Parameters
|
|
84
|
+
async function checkBooleanParams(...params) {
|
|
85
|
+
for (let param of params) {
|
|
86
|
+
if (param === "true" || param === "false") {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
84
95
|
async function isValidMobile(mobile) {
|
|
85
96
|
|
|
86
97
|
const mobileStr = String(mobile).trim();
|
|
@@ -131,4 +142,4 @@ async function isValidPin(pinCode) {
|
|
|
131
142
|
return /^[0-9]{6}$/.test(pinCodeStr);
|
|
132
143
|
}
|
|
133
144
|
|
|
134
|
-
export {validateMandate,validateOptional, isValidMobile, isValidEmail, isValidOtp, isValidPin,isValidNumber,isValidBoolean};
|
|
145
|
+
export {validateMandate,validateOptional, isValidMobile, isValidEmail, isValidOtp, isValidPin,isValidNumber,isValidBoolean,checkBooleanParams};
|