m-validate
Advanced tools
Comparing version 1.0.2 to 1.0.5
{ | ||
"name": "m-validate", | ||
"version": "1.0.2", | ||
"version": "1.0.5", | ||
"description": "NodeJS simple validation functions", | ||
@@ -5,0 +5,0 @@ "main": "m-validate.js", |
@@ -227,3 +227,3 @@ /* eslint-env jasmine */ | ||
password: "1234", | ||
userNumericFloat: "1,234-" | ||
userNumericFloat: "(1,234)" | ||
}; | ||
@@ -230,0 +230,0 @@ |
@@ -297,3 +297,3 @@ /* eslint-env jasmine */ | ||
it('should respond with success for url type (without http)', function() { | ||
it('should respond with error for url type (without http)', function() { | ||
var content = { | ||
@@ -305,4 +305,4 @@ password: "1234", | ||
var result = validate(content, definitionFields); | ||
expect(result.error).toBe(false); | ||
expect(result.result.siteaddress).toEqual({}); | ||
expect(result.error).toBe(true); | ||
expect(result.result.siteaddress.type).toBe('not_an_url'); | ||
}); | ||
@@ -309,0 +309,0 @@ |
@@ -56,3 +56,3 @@ /* eslint no-control-regex: [0] */ | ||
case "url": | ||
var url = /\(?(?:(http|https|ftp):\/\/)?(?:((?:[^\W\s]|\.|-|[:]{1})+)@{1})?((?:www.)?(?:[^\W\s]|\.|-)+[\.][^\W\s]{2,4}|localhost(?=\/)|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?::(\d*))?([\/]?[^\s\?]*[\/]{1})*(?:\/?([^\s\n\?\[\]\{\}#]*(?:(?=\.)){1}|[^\s\n\?\[\]\{\}\.#]*)?([\.]{1}[^\s\?#]*)?)?(?:\?{1}([^\s\n#\[\]]*))?([#][^\s\n]*)?\)?/i; | ||
var url = /\(?(?:(http|https|ftp):\/\/){1}(?:((?:[^\W\s]|\.|-|[:]{1})+)@{1})?((?:www.)?(?:[^\W\s]|\.|-)+[\.][^\W\s]{2,4}|localhost(?=\/)|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?::(\d*))?([\/]?[^\s\?]*[\/]{1})*(?:\/?([^\s\n\?\[\]\{\}#]*(?:(?=\.)){1}|[^\s\n\?\[\]\{\}\.#]*)?([\.]{1}[^\s\?#]*)?)?(?:\?{1}([^\s\n#\[\]]*))?([#][^\s\n]*)?\)?/i; | ||
@@ -59,0 +59,0 @@ if (!url.test(theData)) { |
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
127256