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

purify

Package Overview
Dependencies
Maintainers
4
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

purify - npm Package Compare versions

Comparing version 3.3.0 to 3.3.1

8

lib/purify.js

@@ -31,4 +31,4 @@ (function (root, factory) {

if (typeof rawValue === 'string' && oneValidation.emailIdn.test(rawValue)) {
fragments = rawValue.toLowerCase().split('@');
encodedDomain = fragments.length === 2 && punycode.toASCII(fragments[1]);
fragments = rawValue.split('@');
encodedDomain = fragments.length === 2 && punycode.toASCII(fragments[1]).toLowerCase();
var decodedDomain = punycode.toUnicode(encodedDomain); // Makes sure invalid domains like foo.xn--no aren't allowed

@@ -60,4 +60,4 @@

if (typeof rawValue === 'string' && oneValidation.emailIdn.test(rawValue)) {
fragments = rawValue.toLowerCase().split('@');
decodedDomain = fragments.length === 2 && punycode.toUnicode(fragments[1]);
fragments = rawValue.split('@');
decodedDomain = fragments.length === 2 && punycode.toUnicode(fragments[1]).toLowerCase();

@@ -64,0 +64,0 @@ if (!(/\.[^\.]{2,}$/.test(decodedDomain))) {

@@ -19,3 +19,3 @@ {

},
"version": "3.3.0",
"version": "3.3.1",
"engines": {

@@ -22,0 +22,0 @@ "node": ">=0.4.0"

@@ -73,2 +73,8 @@ /*global it, describe*/

expect('email', 'to allow', 'andreas@xn--cntersurf-g3a.quuxbar', 'andreas@xn--cntersurf-g3a.quuxbar');
// Mixed-case local parts allowed
expect('email', 'to allow', 'ANDreas@centersurf.net', 'ANDreas@centersurf.net');
expect('email', 'to allow', 'AnDrEaS@centersurf.quuxbar', 'AnDrEaS@centersurf.quuxbar');
// Mixed case domain parts get lowercased
expect('email', 'to allow', 'andreas@CENTERSURF.net', 'andreas@centersurf.net');
});

@@ -98,2 +104,8 @@

expect('emailIdn', 'to allow', 'andreas@xn--cntersurf-g3a.quuxbar', 'andreas@cæntersurf.quuxbar');
// Mixed-case local parts allowed
expect('email', 'to allow', 'ANDreas@centersurf.net', 'ANDreas@centersurf.net');
expect('email', 'to allow', 'AnDrEaS@centersurf.quuxbar', 'AnDrEaS@centersurf.quuxbar');
// Mixed case domain parts get lowercased
expect('email', 'to allow', 'andreas@CENTERSURF.net', 'andreas@centersurf.net');
});

@@ -100,0 +112,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