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

one-validation

Package Overview
Dependencies
Maintainers
5
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.1 to 2.2.2

2

package.json

@@ -14,3 +14,3 @@ {

"description": "Regexp based validation collection for common internet validation tasks",
"version": "2.2.1",
"version": "2.2.2",
"repository": {

@@ -17,0 +17,0 @@ "url": "git://github.com/One-com/one-validation.git"

@@ -23,2 +23,26 @@ /*global beforeEach, describe, it*/

});
it('should disallow underscore in domain with no subdomain', function () {
expect('_example.com', 'not to pass');
});
it('should disallow underscore in domain with valid subdomain', function () {
expect('_sub._example.com', 'not to pass');
});
it('should allow underscore at start of subdomain', function () {
expect('_sub.example.com', 'to pass');
});
it('should allow underscore in middle of subdomain', function () {
expect('sub_domain.example.com', 'to pass');
});
it('should allow underscore in end of subdomain', function () {
expect('sub_.example.com', 'to pass');
});
it('should allow underscore in multiple subdomains', function () {
expect('_sub1.sub_2.sub3_.example.com', 'to pass');
});
});

@@ -25,0 +49,0 @@

@@ -41,2 +41,3 @@ /*global module, define*/

visibleAsciiChar: /[\x20-\x7e]*/,
subDomainPart: /[_a-z0-9](?:[_\-a-z0-9]*[_a-z0-9])?/i,
domainPart: /[a-z0-9](?:[\-a-z0-9]*[a-z0-9])?/i,

@@ -72,3 +73,3 @@ tld: /[a-z][\-a-z]*[a-z]/i,

fragments.domain = fragments.domainName = new RegExp('(?:' + fragments.domainPart.source + '\\.)+' + fragments.tld.source, 'i');
fragments.domain = fragments.domainName = new RegExp('(?:' + fragments.subDomainPart.source + '\\.)*' + '(?:' + fragments.domainPart.source + '\\.)+' + fragments.tld.source, 'i');
fragments.domainIdn = fragments.domainNameIdn = new RegExp('(?:' + fragments.domainPartIdn.source + '\\.)+' + fragments.tldIdn.source, 'i');

@@ -75,0 +76,0 @@

Sorry, the diff of this file is not supported yet

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