Comparing version 0.5.9 to 0.5.10
@@ -1330,11 +1330,28 @@ (function () { | ||
function numericalComparison(condition, fieldValue, testValue){ | ||
var fieldValNum = parseInt(fieldValue, 10); | ||
var testValNum = parseInt(testValue, 10); | ||
if(isNaN(fieldValNum) || isNaN(testValNum)){ | ||
return false; | ||
} | ||
if ("is equal to" === condition) { | ||
return fieldValNum === testValNum; | ||
} else if ("is less than" === condition) { | ||
return fieldValNum < testValNum; | ||
} else if ("is greater than" === condition) { | ||
return fieldValNum > testValNum; | ||
} else { | ||
return false; | ||
} | ||
} | ||
var valid = true; | ||
if ("is equal to" === condition) { | ||
valid = fieldValue === testValue; | ||
valid = numericalComparison("is equal to", fieldValue, testValue); | ||
} else if ("is greater than" === condition) { | ||
// TODO - do numeric checking | ||
valid = fieldValue > testValue; | ||
valid = numericalComparison("is greater than", fieldValue, testValue); | ||
} else if ("is less than" === condition) { | ||
// TODO - do numeric checking | ||
valid = fieldValue < testValue; | ||
valid = numericalComparison("is less than", fieldValue, testValue); | ||
} else if ("is at" === condition) { | ||
@@ -1341,0 +1358,0 @@ valid = false; |
{ | ||
"name": "fh-forms", | ||
"version": "0.5.9", | ||
"version": "0.5.10", | ||
"description": "Cloud Forms API for form submission", | ||
@@ -5,0 +5,0 @@ "main": "lib/forms.js", |
@@ -1,1 +0,1 @@ | ||
0.5.9-40 | ||
0.5.10-70 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
279115
7335