one-validation
Advanced tools
Comparing version 0.2.10 to 0.2.11
@@ -14,3 +14,3 @@ { | ||
"description": "Regexp based validation collection for common internet validation tasks", | ||
"version": "0.2.10", | ||
"version": "0.2.11", | ||
"repository": { | ||
@@ -17,0 +17,0 @@ "url": "git://github.com/One-com/one-validation.git" |
@@ -54,3 +54,3 @@ var vows = require('vows'), | ||
'http://1337.net', | ||
'http://a.b-c.de' | ||
'http://a.b-c.de', | ||
/* | ||
@@ -68,3 +68,2 @@ // Unicode in url? | ||
*/ | ||
/* | ||
// IP addresses for hostnames | ||
@@ -74,10 +73,9 @@ 'http://142.42.1.1/', | ||
'http://223.255.255.254' | ||
*/ | ||
])) | ||
.addBatch(createBatch('url', false, [ | ||
'http://www.foo.cq/', | ||
'@.foo.com/?' | ||
'@.foo.com/?', | ||
'http://1.1.256.1', | ||
'http://1.1.1.300' | ||
])) | ||
['export'](module); | ||
@@ -25,3 +25,3 @@ // THIS FILE IS AUTOGENERATED! See lib/validation.js.tpl | ||
var name, | ||
var ipv4DigitRegExpSource = /([0-9]|1?[0-9][0-9]|2[0-4][0-9]|25[0-5])/.source, | ||
validation = { | ||
@@ -42,4 +42,9 @@ functions: {} | ||
search: /[\w%+@*\-\.\/\(\)&=;\?]*/, | ||
hash: /[\w%+@*\-\.\/\(\)&=;\?#]*/ | ||
}; | ||
hash: /[\w%+@*\-\.\/\(\)&=;\?#]*/, | ||
ipv4: new RegExp(ipv4DigitRegExpSource + '\\.' + | ||
ipv4DigitRegExpSource + '\\.' + | ||
ipv4DigitRegExpSource + '\\.' + | ||
ipv4DigitRegExpSource) | ||
}, | ||
name; | ||
@@ -62,3 +67,7 @@ // Highlevel regexes composed of regex fragments | ||
")?", | ||
fragments.subdomain, | ||
"(?:", | ||
fragments.subdomain, | ||
"|", | ||
fragments.ipv4, | ||
")", | ||
"(?::", fragments.port, ")?", | ||
@@ -65,0 +74,0 @@ "(?:/", fragments.pathname, |
@@ -1,1 +0,1 @@ | ||
(function(){function a(){var a="";for(var b=0;b<arguments.length;b+=1)Object.prototype.toString.call(arguments[b])==="[object RegExp]"?a+=arguments[b].source:a+=arguments[b];return a}function e(b){return new RegExp(a(b,"://","(?:",d.user,"(?::",d.password,")?@",")?",d.subdomain,"(?::",d.port,")?","(?:/",d.pathname,"(?:\\?",d.search,")?","(?:#",d.hash,")?",")?"),"i")}"use strict";var b,c={functions:{}},d={tld:/(?:xn--(?:0zwm56d|11b5bs3a9aj6g|3e0b707e|45brj9c|80akhbyknj4f|80ao21a|90a3ac|9t4b11yi5a|clchc0ea0b2g2a9gcd|deba0ad|fiqs8s|fiqz9s|fpcrj9c3d|fzc2c9e2c|g6w251d|gecrj9c|h2brj9c|hgbk6aj7f53bba|hlcj6aya9esc7a|j6w193g|jxalpdlp|kgbechtv|kprw13d|kpry57d|lgbbat1ad8j|mgbaam7a8h|mgbayh7gpa|mgbbh1a71e|mgbc0a9azcg|mgberp4a5d4ar|o3cw4h|ogbpf8fl|p1ai|pgbs0dh|s9brj9c|wgbh1c|wgbl6a|xkc2al3hye2a|xkc2dl3a5ee0h|yfro4i67o|ygbi2ammx|zckzah)|சிங்கப்பூர்|испытание|السعودية|பரிட்சை|இந்தியா|परीक्षा|الجزائر|آزمایشی|இலங்கை|فلسطين|امارات|المغرب|الاردن|إختبار|δοκιμή|travel|museum|భారత్|سورية|بھارت|ලංකා|ભારત|ਭਾਰਤ|ভারত|भारत|تونس|טעסט|name|mobi|jobs|info|coop|asia|arpa|aero|테스트|新加坡|テスト|ไทย|مصر|قطر|қаз|срб|xxx|tel|pro|org|net|mil|int|gov|edu|com|cat|biz|한국|香港|測試|测试|台灣|台湾|中國|中国|рф|z[amw]|y[et]|w[fs]|v[aceginu]|u[agksyz]|t[cdfghjklmnoprtvwz]|s[abcdeghijklmnortuvxyz]|r[eosuw]|qa|p[aefghklmnrstwy]|om|n[acefgilopruz]|m[acdeghklmnopqrstuvwxyz]|l[abcikrstuvy]|k[eghimnprwyz]|j[emop]|i[delmnoqrst]|h[kmnrtu]|g[abdefghilmnpqrstuwy]|f[ijkmor]|e[cegrstu]|d[ejkmoz]|c[acdfghiklmnoruvwxyz]|b[abdefghijmnorstvwyz]|a[cdefgilmnoqrstuwxz])/i,domainPart:/[a-z0-9](?:[\-a-z0-9]*[a-z0-9])?/i,port:/\d{1,5}/,localpart:/[a-z0-9!#$%&'*+\/=?\^_`{|}~\-]+(?:\.[a-z0-9!#$%&'*+\/=?\^_`{|}~\-]+)*/i,user:/[^:@\/]+/i,uuid:/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i,lowerCaseUuid:/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,upperCaseUuid:/[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}/,password:/[^@\/]+?/i,pathname:/[\w%+@*\-\.\/\(\)&=;]*/,search:/[\w%+@*\-\.\/\(\)&=;\?]*/,hash:/[\w%+@*\-\.\/\(\)&=;\?#]*/};d.domain=new RegExp(d.domainPart.source+"\\."+d.tld.source,"i"),d.subdomain=new RegExp("(?:"+d.domainPart.source+"\\.)*"+d.domain.source,"i"),d.email=new RegExp(d.localpart.source+"@"+d.subdomain.source,"i"),d.mailtoUrl=new RegExp("mailto:"+d.email.source,"i"),d.httpUrl=e(/https?/),d.ftpUrl=e(/ftp/),d.url=d.httpUrl;for(b in d)d.hasOwnProperty(b)&&(c[b]=new RegExp("^"+d[b].source+"$","i"),c.functions[b]=function(a){return function(b){return c[a].test(b)}}(b));c.fragments=d,typeof window!="undefined"&&(window.one=window.one||{},window.one.validation=c),typeof module!="undefined"&&(module.exports=c)})(); | ||
(function(){function a(){var a="";for(var b=0;b<arguments.length;b+=1)Object.prototype.toString.call(arguments[b])==="[object RegExp]"?a+=arguments[b].source:a+=arguments[b];return a}function f(b){return new RegExp(a(b,"://","(?:",d.user,"(?::",d.password,")?@",")?","(?:",d.subdomain,"|",d.ipv4,")","(?::",d.port,")?","(?:/",d.pathname,"(?:\\?",d.search,")?","(?:#",d.hash,")?",")?"),"i")}"use strict";var b=/([0-9]|1?[0-9][0-9]|2[0-4][0-9]|25[0-5])/.source,c={functions:{}},d={tld:/(?:xn--(?:0zwm56d|11b5bs3a9aj6g|3e0b707e|45brj9c|80akhbyknj4f|80ao21a|90a3ac|9t4b11yi5a|clchc0ea0b2g2a9gcd|deba0ad|fiqs8s|fiqz9s|fpcrj9c3d|fzc2c9e2c|g6w251d|gecrj9c|h2brj9c|hgbk6aj7f53bba|hlcj6aya9esc7a|j6w193g|jxalpdlp|kgbechtv|kprw13d|kpry57d|lgbbat1ad8j|mgbaam7a8h|mgbayh7gpa|mgbbh1a71e|mgbc0a9azcg|mgberp4a5d4ar|o3cw4h|ogbpf8fl|p1ai|pgbs0dh|s9brj9c|wgbh1c|wgbl6a|xkc2al3hye2a|xkc2dl3a5ee0h|yfro4i67o|ygbi2ammx|zckzah)|சிங்கப்பூர்|испытание|السعودية|பரிட்சை|இந்தியா|परीक्षा|الجزائر|آزمایشی|இலங்கை|فلسطين|امارات|المغرب|الاردن|إختبار|δοκιμή|travel|museum|భారత్|سورية|بھارت|ලංකා|ભારત|ਭਾਰਤ|ভারত|भारत|تونس|טעסט|name|mobi|jobs|info|coop|asia|arpa|aero|테스트|新加坡|テスト|ไทย|مصر|قطر|қаз|срб|xxx|tel|pro|org|net|mil|int|gov|edu|com|cat|biz|한국|香港|測試|测试|台灣|台湾|中國|中国|рф|z[amw]|y[et]|w[fs]|v[aceginu]|u[agksyz]|t[cdfghjklmnoprtvwz]|s[abcdeghijklmnortuvxyz]|r[eosuw]|qa|p[aefghklmnrstwy]|om|n[acefgilopruz]|m[acdeghklmnopqrstuvwxyz]|l[abcikrstuvy]|k[eghimnprwyz]|j[emop]|i[delmnoqrst]|h[kmnrtu]|g[abdefghilmnpqrstuwy]|f[ijkmor]|e[cegrstu]|d[ejkmoz]|c[acdfghiklmnoruvwxyz]|b[abdefghijmnorstvwyz]|a[cdefgilmnoqrstuwxz])/i,domainPart:/[a-z0-9](?:[\-a-z0-9]*[a-z0-9])?/i,port:/\d{1,5}/,localpart:/[a-z0-9!#$%&'*+\/=?\^_`{|}~\-]+(?:\.[a-z0-9!#$%&'*+\/=?\^_`{|}~\-]+)*/i,user:/[^:@\/]+/i,uuid:/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i,lowerCaseUuid:/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,upperCaseUuid:/[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}/,password:/[^@\/]+?/i,pathname:/[\w%+@*\-\.\/\(\)&=;]*/,search:/[\w%+@*\-\.\/\(\)&=;\?]*/,hash:/[\w%+@*\-\.\/\(\)&=;\?#]*/,ipv4:new RegExp(b+"\\."+b+"\\."+b+"\\."+b)},e;d.domain=new RegExp(d.domainPart.source+"\\."+d.tld.source,"i"),d.subdomain=new RegExp("(?:"+d.domainPart.source+"\\.)*"+d.domain.source,"i"),d.email=new RegExp(d.localpart.source+"@"+d.subdomain.source,"i"),d.mailtoUrl=new RegExp("mailto:"+d.email.source,"i"),d.httpUrl=f(/https?/),d.ftpUrl=f(/ftp/),d.url=d.httpUrl;for(e in d)d.hasOwnProperty(e)&&(c[e]=new RegExp("^"+d[e].source+"$","i"),c.functions[e]=function(a){return function(b){return c[a].test(b)}}(e));c.fragments=d,typeof window!="undefined"&&(window.one=window.one||{},window.one.validation=c),typeof module!="undefined"&&(module.exports=c)})(); |
Sorry, the diff of this file is not supported yet
21240
270