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

@hapi/validate

Package Overview
Dependencies
Maintainers
7
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hapi/validate - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

24

lib/types/string.js

@@ -44,4 +44,4 @@ 'use strict';

domainControlRx: /[\x00-\x20@\:\/]/, // Control + space + separators
tldSegmentRx: /^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,
domainSegmentRx: /^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/
domainSegmentRx: /^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,
finalSegmentAdditionalRx: /[^0-9]/ // Domain segment which is additionally not all-numeric
};

@@ -705,11 +705,15 @@

if (i < segments.length - 1) {
if (!internals.domainSegmentRx.test(segment)) {
return false;
}
// Here we're following RFC 1035 and 1123, plus 3696's clarification
// that the final segment may contain numbers but not be all-numeric.
// Docker containers, for example, are assigned hostnames which are hex
// strings (no dots) that may start with a numeric digit.
if (!internals.domainSegmentRx.test(segment)) {
return false;
}
else {
if (!internals.tldSegmentRx.test(segment)) {
return false;
}
const isFinalSegment = i === segments.length - 1;
if (isFinalSegment && !internals.finalSegmentAdditionalRx.test(segment)) {
return false;
}

@@ -716,0 +720,0 @@ }

{
"name": "@hapi/validate",
"description": "Object schema validation",
"version": "1.1.2",
"version": "1.1.3",
"repository": "git://github.com/hapijs/validate",

@@ -17,3 +17,3 @@ "main": "lib/index.js",

"@hapi/code": "8.x.x",
"@hapi/lab": "23.x.x"
"@hapi/lab": "24.x.x"
},

@@ -20,0 +20,0 @@ "scripts": {

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