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

tldts-core

Package Overview
Dependencies
Maintainers
1
Versions
726
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tldts-core - npm Package Compare versions

Comparing version 5.6.0 to 5.6.1

19

dist/cjs/index.js

@@ -256,11 +256,19 @@ 'use strict';

function isProbablyIpv6(hostname) {
if (hostname.length < 3) {
return false;
}
var start = hostname[0] === '[' ? 1 : 0;
var end = hostname.length;
if (hostname[end - 1] === ']') {
end -= 1;
}
// We only consider the maximum size of a normal IPV6. Note that this will
// fail on so-called "IPv4 mapped IPv6 addresses" but this is a corner-case
// and a proper validation library should be used for these.
if (hostname.length > 39) {
if (end - start > 39) {
return false;
}
var hasColon = false;
for (var i = 0; i < hostname.length; i += 1) {
var code = hostname.charCodeAt(i);
for (; start < end; start += 1) {
var code = hostname.charCodeAt(start);
if (code === 58 /* ':' */) {

@@ -270,4 +278,5 @@ hasColon = true;

else if (((code >= 48 && code <= 57) || // 0-9
(code >= 97 && code <= 102)) === false // a-f
) {
(code >= 97 && code <= 102) || // a-f
(code >= 65 && code <= 90) // A-F
) === false) {
return false;

@@ -274,0 +283,0 @@ }

@@ -32,11 +32,19 @@ /**

function isProbablyIpv6(hostname) {
if (hostname.length < 3) {
return false;
}
var start = hostname[0] === '[' ? 1 : 0;
var end = hostname.length;
if (hostname[end - 1] === ']') {
end -= 1;
}
// We only consider the maximum size of a normal IPV6. Note that this will
// fail on so-called "IPv4 mapped IPv6 addresses" but this is a corner-case
// and a proper validation library should be used for these.
if (hostname.length > 39) {
if (end - start > 39) {
return false;
}
var hasColon = false;
for (var i = 0; i < hostname.length; i += 1) {
var code = hostname.charCodeAt(i);
for (; start < end; start += 1) {
var code = hostname.charCodeAt(start);
if (code === 58 /* ':' */) {

@@ -46,4 +54,5 @@ hasColon = true;

else if (((code >= 48 && code <= 57) || // 0-9
(code >= 97 && code <= 102)) === false // a-f
) {
(code >= 97 && code <= 102) || // a-f
(code >= 65 && code <= 90) // A-F
) === false) {
return false;

@@ -50,0 +59,0 @@ }

{
"name": "tldts-core",
"version": "5.6.0",
"version": "5.6.1",
"description": "tldts core primitives (internal module)",

@@ -66,3 +66,3 @@ "author": {

},
"gitHead": "2a8c96aa9e692d9426b0a85c0db29939f3d58fce"
"gitHead": "f64d9d5c1e8e91aa7bf197d4364f50428e0b45fa"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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