one-validation
Advanced tools
Comparing version 0.6.2 to 1.0.0
{ | ||
"maintainers": [ | ||
{ | ||
"name": "Peter Müller", | ||
"email": "munter@fumle.dk" | ||
}, | ||
{ | ||
"name": "Andreas Lind Petersen", | ||
"email": "andreas@one.com" | ||
} | ||
], | ||
"name": "one-validation", | ||
"description": "Regexp based validation collection for common internet validation tasks", | ||
"version": "0.6.2", | ||
"repository": { | ||
"url": "git://github.com/One-com/one-validation.git" | ||
"maintainers": [ | ||
{ | ||
"name": "Peter Müller", | ||
"email": "munter@fumle.dk" | ||
}, | ||
"engines": { | ||
"node": ">=0.4.0" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"punycode": ">=0.2.0", | ||
"uglify-js": "~1.3.4", | ||
"vows": "=0.6.1" | ||
}, | ||
"scripts": { | ||
"test": "vows" | ||
}, | ||
"publishConfig": { | ||
"repository": "http://registry.npmjs.org/" | ||
}, | ||
"main": "./validation.js" | ||
{ | ||
"name": "Andreas Lind Petersen", | ||
"email": "andreas@one.com" | ||
} | ||
], | ||
"name": "one-validation", | ||
"description": "Regexp based validation collection for common internet validation tasks", | ||
"version": "1.0.0", | ||
"repository": { | ||
"url": "git://github.com/One-com/one-validation.git" | ||
}, | ||
"engines": { | ||
"node": ">=0.4.0" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"punycode": ">=0.2.0", | ||
"uglify-js": "~1.3.4", | ||
"vows": "=0.7.0" | ||
}, | ||
"scripts": { | ||
"test": "vows", | ||
"prepublish": "make && npm test" | ||
}, | ||
"publishConfig": { | ||
"repository": "http://registry.npmjs.org/" | ||
}, | ||
"main": "./validation.js" | ||
} |
@@ -1,3 +0,3 @@ | ||
one-validation | ||
============== | ||
# one-validation | ||
This is a collection of regular expressions for general validation purposes. | ||
@@ -16,14 +16,39 @@ The basic design concept is to split up the regexes into semantic parts of the pattern to match. | ||
Supported patterns | ||
================== | ||
## Supported patterns | ||
* domain | ||
* subdomain | ||
* url | ||
Building | ||
======== | ||
## Examples | ||
### domain and domainIdn | ||
``` | ||
validation.domain.test('foo.co.uk'); | ||
return true; | ||
``` | ||
``` | ||
validation.domainIdn.test('hällo-test.de'); | ||
return true; | ||
``` | ||
### email and emailIdn | ||
``` | ||
validation.email.test('test@foo.co.uk'); | ||
return true; | ||
``` | ||
``` | ||
validation.domainIdn.test('test@hällo-test.de'); | ||
return true; | ||
``` | ||
## Building | ||
``` | ||
npm install | ||
make | ||
``` |
@@ -27,15 +27,20 @@ var vows = require('vows'), | ||
.addBatch(createBatch('email', true, [ | ||
'foo@bar.dk' | ||
'foo@bar.dk', | ||
'foo@bar.somenewtld', | ||
'foo.@bar.dk' | ||
])) | ||
.addBatch(createBatch('email', false, [ | ||
'foo.@bar.dk', | ||
'foo@bar', | ||
'foo@dk', | ||
'foo@bar.nosuchtld' | ||
'foo@例子.测试', | ||
'foo@उदाहरण.परीक्षा' | ||
])) | ||
.addBatch(createBatch('emailRelaxed', true, [ | ||
.addBatch(createBatch('emailIdn', true, [ | ||
'foo@bar.dk', | ||
'foo@bar.somenewtld', | ||
'foo.@bar.dk', | ||
'foo@bar.nosuchtld' | ||
'foo@例子.测试', | ||
'foo.@उदाहरण.परीक्षा' | ||
])) | ||
.addBatch(createBatch('emailRelaxed', false, [ | ||
.addBatch(createBatch('emailIdn', false, [ | ||
'foo@bar', | ||
@@ -42,0 +47,0 @@ 'foo@dk' |
@@ -27,3 +27,3 @@ var vows = require('vows'), | ||
.describe('url validation') | ||
.addBatch(createBatch('url', true, [ | ||
.addBatch(createBatch('httpUrl', true, [ | ||
'http://www.foo.com/', | ||
@@ -61,7 +61,12 @@ 'http://www.foo.com/~username/', | ||
'http://142.42.1.1:8080/', | ||
'http://223.255.255.254' | ||
'http://223.255.255.254', | ||
// New TLDs | ||
'http://www.foo.cq/', | ||
'http://www.foo.randomtld/', | ||
// SLDs | ||
'http://foo.co.uk', | ||
'http://foo.org.uk' | ||
])) | ||
.addBatch(createBatch('url', false, [ | ||
.addBatch(createBatch('httpUrl', false, [ | ||
'http://localhost/', | ||
'http://www.foo.cq/', | ||
'@.foo.com/?', | ||
@@ -71,5 +76,2 @@ 'http://1.1.256.1', | ||
])) | ||
.addBatch(createBatch('httpUrlRelaxed', false, [ | ||
'http://localhost/' | ||
])) | ||
.addBatch(createBatch('httpUrlIdn', true, [ | ||
@@ -86,4 +88,11 @@ 'http://✪df.ws/123', | ||
'http://foo.com/unicode_(✪)_in_parens', | ||
'http://➡.ws/䨹' | ||
'http://➡.ws/䨹', | ||
'http://1.1.256.1', | ||
'http://1.1.1.300' | ||
])) | ||
.addBatch(createBatch('domainIdn', false, [ | ||
'foo:bar.com', | ||
'foo/bar.com', | ||
'foo%bar.com' | ||
])) | ||
['export'](module); |
@@ -1,2 +0,1 @@ | ||
// THIS FILE IS AUTOGENERATED! See lib/validation.js.tpl | ||
/*global module, window, define*/ | ||
@@ -40,7 +39,6 @@ | ||
visibleNonAsciiChar: /[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԥԱ-Ֆՙա-ևא-תװ-ײء-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨऄ-हऽॐक़-ॡॱॲॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡഅ-ഌഎ-ഐഒ-നപ-ഹഽൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜໝༀཀ-ཇཉ-ཬྈ-ྋက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-Ⴥა-ჺჼᄀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₔℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎↃↄⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〆〱-〵〻〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆷㇰ-ㇿ㐀-䶵一-鿋ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙟꙢ-ꙮꙿ-ꚗꚠ-ꛥꜗ-ꜟꜢ-ꞈꞋꞌꟻ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-鶴侮-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ̀-ͯ҃-҉֑-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٞۖ-ۜ۞-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࠭ऀ-ः़ा-ॎ॑-ॕॢॣঁ-ঃ়া-ৄেৈো-্ৗৢৣਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑੰੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕౖౢౣಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣംഃാ-ൄെ-ൈൊ-്ൗൢൣංඃ්ා-ුූෘ-ෟෲෳัิ-ฺ็-๎ັິ-ູົຼ່-ໍ༹༘༙༵༷༾༿ཱ-྄྆྇ྐ-ྗྙ-ྼ࿆ါ-ှၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏႚ-ႝ፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳា-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈᧉᨗ-ᨛᩕ-ᩞ᩠-᩿᩼ᬀ-ᬄ᬴-᭄᭫-᭳ᮀ-ᮂᮡ-᮪ᰤ-᰷᳐-᳔᳒-᳨᳭ᳲ᷀-᷽ᷦ-᷿⃐-⃰⳯-⳱ⷠ-〪ⷿ-゙゚〯꙯-꙲꙼꙽꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣠-꣱ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀ꨩ-ꨶꩃꩌꩍꩻꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꯣ-ꯪ꯬꯭ﬞ︀-️︠-︦²³¹¼-¾٠-٩۰-۹߀-߉०-९০-৯৴-৹੦-੯૦-૯୦-୯௦-௲౦-౯౸-౾೦-೯൦-൵๐-๙໐-໙༠-༳၀-၉႐-႙፩-፼ᛮ-ᛰ០-៩៰-៹᠐-᠙᥆-᥏᧐-᧚᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙⁰⁴-⁹₀-₉⅐-ↂↅ-↉①-⒛⓪-⓿❶-➓⳽〇〡-〩〸-〺㆒-㆕㈠-㈩㉑-㉟㊀-㊉㊱-㊿꘠-꘩ꛦ-ꛯ꠰-꠵꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹0-9¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᧞᧟᨞᨟᪠-᪦᪨-᪭᭚-᭠᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・¢-©¬®-±´¶¸×÷˂-˅˒-˟˥-˫˭˯-˿͵΄΅϶҂؆-؈؋؎؏۩۽۾߶৲৳৺৻૱୰௳-௺౿ೱೲ൹฿༁-༃༓-༗༚-༟༴༶༸྾-࿅࿇-࿌࿎࿏࿕-࿘႞႟፠᎐-᎙៛᥀᧠-᧿᭡-᭪᭴-᭼᾽᾿-῁῍-῏῝-῟῭-`´῾⁄⁒⁺-⁼₊-₌₠-₸℀℁℃-℆℈℉℔№-℘℞-℣℥℧℩℮℺℻⅀-⅄⅊-⅍⅏←-⌨⌫-⏨␀-␦⑀-⑊⒜-ⓩ─-⛍⛏-⛡⛣⛨-⛿✁-✄✆-✉✌-✧✩-❋❍❏-❒❖-❞❡-❧➔➘-➯➱-➾⟀-⟄⟇-⟊⟌⟐-⟥⟰-⦂⦙-⧗⧜-⧻⧾-⭌⭐-⭙⳥-⳪⺀-⺙⺛-⻳⼀-⿕⿰-⿻〄〒〓〠〶〷〾〿゛゜㆐㆑㆖-㆟㇀-㇣㈀-㈞㈪-㉐㉠-㉿㊊-㊰㋀-㋾㌀-㏿䷀-䷿꒐-꓆꜀-꜖꜠꜡꞉꞊꠨-꠫꠶-꠹꩷-꩹﬩﷼﷽﹢﹤-﹦﹩$+<->^`|~¢-₩│-○�]/, | ||
tld: /(?:xn--(?:3bst00m|3ds443g|3e0b707e|45brj9c|4gbrim|55qw42g|55qx5d|6frz82g|6qq986b3xl|80adxhks|80ao21a|80asehdb|80aswg|90a3ac|c1avg|cg4bki|clchc0ea0b2g2a9gcd|czr694b|czru2d|d1acj3b|fiq228c5hs|fiq64b|fiqs8s|fiqz9s|fpcrj9c3d|fzc2c9e2c|gecrj9c|h2brj9c|i1b6b1a6a2e|io0a7i|j1amh|j6w193g|kprw13d|kpry57d|l1acc|lgbbat1ad8j|mgb9awbf|mgba3a4f16a|mgbaam7a8h|mgbab2bd|mgbayh7gpa|mgbbh1a71e|mgbc0a9azcg|mgberp4a5d4ar|mgbx4cd0ab|ngbc5azd|nqv7f|nqv7fs00ema|o3cw4h|ogbpf8fl|p1ai|pgbs0dh|q9jyb4c|rhqv96g|s9brj9c|ses554g|unup4y|wgbh1c|wgbl6a|xkc2al3hye2a|xkc2dl3a5ee0h|yfro4i67o|ygbi2ammx|zfr164b)|international|versicherung|construction|சிங்கப்பூர்|productions|photography|motorcycles|investments|enterprises|engineering|contractors|blackfriday|accountants|university|technology|republican|properties|management|industries|immobilien|foundation|creditcard|consulting|associates|vacations|solutions|marketing|institute|furniture|financial|equipment|education|directory|community|christmas|السعودية|yokohama|ventures|training|supplies|software|services|saarland|plumbing|pictures|partners|mortgage|lighting|holdings|graphics|feedback|exchange|engineer|discount|diamonds|democrat|computer|clothing|cleaning|catering|builders|boutique|bargains|attorney|airforce|இந்தியா|الجزائر|website|systems|surgery|support|singles|shiksha|reviews|rentals|recipes|okinawa|neustar|limited|kitchen|holiday|hamburg|guitars|gallery|frogans|florist|flights|fitness|fishing|finance|exposed|domains|digital|dentist|cruises|country|cooking|company|cologne|college|careers|capital|academy|இலங்கை|مليسيا|فلسطين|امارات|المغرب|الاردن|онлайн|москва|yachts|webcam|voyage|voting|vision|villas|viajes|travel|tienda|tattoo|supply|social|schule|ryukyu|report|repair|reisen|quebec|photos|nagoya|museum|moscow|monash|market|maison|luxury|london|lawyer|kaufen|juegos|insure|hiphop|gratis|global|futbol|expert|events|estate|dental|degree|dating|credit|condos|coffee|clinic|claims|church|center|career|camera|berlin|bayern|agency|భారత్|संगठन|سورية|بھارت|بازار|ایران|works|watch|vodka|vegas|trade|tools|tokyo|today|tirol|space|solar|shoes|rodeo|rocks|reise|rehab|press|photo|parts|paris|ninja|miami|media|mango|loans|lease|koeln|jetzt|house|horse|homes|guide|gripe|globo|glass|gives|email|dance|codes|citic|cheap|cards|build|black|autos|audio|archi|actor|组织机构|ලංකා|ભારત|ਭਾਰਤ|ভারত|भारत|موقع|عمان|شبكة|تونس|сайт|дети|zone|wiki|wien|wang|voto|vote|toys|town|tips|sohu|sexy|ruhr|rich|rest|qpon|post|pink|pics|navy|name|moda|mobi|menu|meet|luxe|link|limo|life|land|kred|kiwi|jobs|info|host|haus|guru|gift|fund|fish|farm|fail|desi|coop|cool|club|cash|care|camp|buzz|blue|bike|best|beer|asia|arpa|army|aero|新加坡|我爱你|中文网|みんな|ไทย|مصر|قطر|қаз|укр|срб|орг|мон|xyz|xxx|wtf|wtc|wed|vet|uno|tel|tax|soy|rio|ren|red|pub|pro|org|onl|nyc|nhk|net|moe|mil|kim|int|ink|hiv|gov|gop|gmo|gal|foo|eus|edu|dnp|com|ceo|cat|cab|biz|bio|bid|bar|axa|한국|삼성|香港|集团|网络|网址|移动|游戏|机构|政务|在线|商标|商城|台灣|台湾|公益|公司|中國|中国|中信|世界|рф|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, // See /lib/tld.js | ||
domainPart: /[a-z0-9](?:[\-a-z0-9]*[a-z0-9])?/i, | ||
domainPartNonNumerical: /[a-z](?:[\-a-z]*[a-z])?/i, | ||
port: /\d{1,5}/, | ||
localpart: /[a-z0-9!#$%&'*+\/=?\^_`{|}~\-:]+(?:\.[a-z0-9!#$%&'*+\/=?\^_`{|}~\-]+)*/i, // taken from: http://www.regular-expressions.info/email.html | ||
localpartRelaxed: /[a-z0-9!#$%&'*+\/=?\^_`{|}~\-:][\.a-z0-9!#$%&'*+\/=?\^_`{|}~\-]*/i, // taken from: http://www.regular-expressions.info/email.html | ||
localpart: /[a-z0-9!#$%&'*+\/=?\^_`{|}~\-:][\.a-z0-9!#$%&'*+\/=?\^_`{|}~\-]*/i, // taken from: http://www.regular-expressions.info/email.html | ||
user: /[^:@\/]+/i, | ||
@@ -59,3 +57,4 @@ uuid: /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i, | ||
// Highlevel regexes composed of regex fragments | ||
var alphanumericalPlusVisibleNonAsciiChars = new RegExp(fragments.visibleNonAsciiChar.source.replace(/^\[/, '[a-z0-9')); | ||
var alphanumericalPlusVisibleNonAsciiChars = new RegExp(fragments.visibleNonAsciiChar.source.replace(/^\[/, '[a-z0-9')), | ||
alphabeticalPlusVisibleNonAsciiChars = new RegExp(fragments.visibleNonAsciiChar.source.replace(/^\[/, '[a-z')); | ||
fragments.domainPartIdn = new RegExp(concatRegExps(alphanumericalPlusVisibleNonAsciiChars, | ||
@@ -66,14 +65,15 @@ '(?:', | ||
')?')); | ||
fragments.domainPartNonNumericalIdn = new RegExp(concatRegExps(alphabeticalPlusVisibleNonAsciiChars, | ||
'(?:', | ||
new RegExp(alphabeticalPlusVisibleNonAsciiChars.source.replace(/^\[/, '[\\-') + '*'), | ||
alphabeticalPlusVisibleNonAsciiChars, | ||
')?')); | ||
fragments.domain = fragments.domainName = new RegExp("(?:" + fragments.domainPart.source + "\\.)+" + fragments.tld.source, "i"); | ||
fragments.domainIdn = fragments.domainNameIdn = new RegExp("(?:" + fragments.domainPartIdn.source + "\\.)+" + fragments.tld.source, "i"); | ||
fragments.domainRelaxed = fragments.domainNameRelaxed = new RegExp("(?:" + fragments.domainPart.source + "\\.)+" + fragments.domainPart.source, "i"); | ||
fragments.domainRelaxedIdn = fragments.domainNameRelaxedIdn = new RegExp("(?:" + fragments.domainPartIdn.source + "\\.)+" + fragments.domainPartIdn.source, "i"); | ||
fragments.domain = fragments.domainName = new RegExp("(?:" + fragments.domainPart.source + "\\.)+" + fragments.domainPartNonNumerical.source, "i"); | ||
fragments.domainIdn = fragments.domainNameIdn = new RegExp("(?:" + fragments.domainPartIdn.source + "\\.)+" + fragments.domainPartNonNumericalIdn.source, "i"); | ||
fragments.email = fragments.emailAddress = new RegExp(fragments.localpart.source + "@" + fragments.domain.source, "i"); | ||
fragments.emailRelaxed = fragments.emailAddressRelaxed =new RegExp(fragments.localpartRelaxed.source + "@" + fragments.domainRelaxed.source, "i"); | ||
fragments.emailRelaxedIdn = fragments.emailAddressRelaxedIdn = new RegExp(fragments.localpartRelaxed.source + "@" + fragments.domainRelaxedIdn.source, "i"); | ||
fragments.emailIdn = fragments.emailAddressIdn = new RegExp(fragments.localpart.source + "@" + fragments.domainIdn.source, "i"); | ||
fragments.mailtoUrl = new RegExp("mailto:" + fragments.email.source, "i"); // TODO: This needs to be improved | ||
fragments.mailtoUrlRelaxed = new RegExp("mailto:" + fragments.emailRelaxed.source, "i"); // TODO: This needs to be improved | ||
fragments.mailtoUrlRelaxedIdn = new RegExp("mailto:" + fragments.emailRelaxedIdn.source, "i"); // TODO: This needs to be improved | ||
fragments.mailtoUrlIdn = new RegExp("mailto:" + fragments.emailIdn.source, "i"); // TODO: This needs to be improved | ||
@@ -101,3 +101,3 @@ // Same as location.pathname + location.search + location.hash in the browser: | ||
(options.localhost ? 'localhost|' : ''), | ||
options.relaxed ? (options.idn ? fragments.domainRelaxedIdn : fragments.domainRelaxed) : (options.idn ? fragments.domainIdn : fragments.domain), | ||
(options.idn ? fragments.domainIdn : fragments.domain), | ||
"|", | ||
@@ -113,12 +113,5 @@ fragments.ipv4, | ||
fragments.httpUrlIdn = createHttpishUrlRegExp({scheme: /https?/, idn: true}); | ||
fragments.httpUrlRelaxed = createHttpishUrlRegExp({scheme: /https?/, relaxed: true}); | ||
fragments.httpUrlRelaxedIdn = createHttpishUrlRegExp({scheme: /https?/, relaxed: true, idn: true}); | ||
fragments.ftpUrl = createHttpishUrlRegExp({scheme: /ftp/}); | ||
fragments.ftpUrlIdn = createHttpishUrlRegExp({scheme: /ftp/, idn: true}); | ||
fragments.ftpUrlRelaxed = createHttpishUrlRegExp({scheme: /ftp/, relaxed: true}); | ||
fragments.ftpUrlRelaxedIdn = createHttpishUrlRegExp({scheme: /ftp/, relaxed: true, idn: true}); | ||
// Alias 'httpUrl' as 'url' for backwards compatibility: | ||
fragments.url = fragments.httpUrl; | ||
function getFlagsStringFromRegExp(regExp) { | ||
@@ -125,0 +118,0 @@ var flagsString = ''; |
Sorry, the diff of this file is not supported yet
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
54
1
0
31229
11
323