Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

one-validation

Package Overview
Dependencies
Maintainers
6
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

one-validation - npm Package Compare versions

Comparing version 2.2.2 to 2.2.3

4

package.json

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc