one-validation
Advanced tools
Comparing version 2.2.2 to 2.2.3
@@ -14,3 +14,3 @@ { | ||
"description": "Regexp based validation collection for common internet validation tasks", | ||
"version": "2.2.2", | ||
"version": "2.2.3", | ||
"repository": { | ||
@@ -27,3 +27,3 @@ "url": "git://github.com/One-com/one-validation.git" | ||
"jshint": "=2.5.2", | ||
"mocha": "=1.20.1", | ||
"mocha": "^10.2.0", | ||
"punycode": ">=0.2.0", | ||
@@ -30,0 +30,0 @@ "unexpected": "=3.2.3" |
@@ -47,2 +47,14 @@ /*global beforeEach, describe, it*/ | ||
}); | ||
it('should allow a punycode tld', function () { | ||
expect('bar.xn--fjq720a', 'to pass'); | ||
}); | ||
it('should disallow an invalid tld', function () { | ||
expect('bar.c7a', 'not to pass'); | ||
}); | ||
it('should disallow an invalid punycode tld', function () { | ||
expect('bar.xn--6ca', 'not to pass'); | ||
}); | ||
}); | ||
@@ -49,0 +61,0 @@ |
@@ -43,2 +43,3 @@ /*global module, define*/ | ||
domainPart: /[a-z0-9](?:[\-a-z0-9]*[a-z0-9])?/i, | ||
punycodeTld: /xn\-\-[a-z0-9]{4,}/i, | ||
tld: /[a-z][\-a-z]*[a-z]/i, | ||
@@ -73,3 +74,4 @@ port: /\d{1,5}/, | ||
fragments.domain = fragments.domainName = new RegExp('(?:' + fragments.subDomainPart.source + '\\.)*' + '(?:' + fragments.domainPart.source + '\\.)+' + fragments.tld.source, 'i'); | ||
// punycodetld source should come first than the normal tld because its a subset of normal tld. | ||
fragments.domain = fragments.domainName = new RegExp('(?:' + fragments.subDomainPart.source + '\\.)*' + '(?:' + fragments.domainPart.source + '\\.)+' + '(?:' + '(?:' + fragments.punycodeTld.source + ')' + '|(?:' + fragments.tld.source + '))', 'i'); | ||
fragments.domainIdn = fragments.domainNameIdn = new RegExp('(?:' + fragments.domainPartIdn.source + '\\.)+' + fragments.tldIdn.source, 'i'); | ||
@@ -76,0 +78,0 @@ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
30494
376