New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@webiny/validation

Package Overview
Dependencies
Maintainers
1
Versions
566
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@webiny/validation - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

4

package.json
{
"name": "@webiny/validation",
"version": "2.0.0",
"version": "2.1.0",
"main": "index.js",

@@ -39,3 +39,3 @@ "repository": {

},
"gitHead": "63dbbe4d91384c6d9f75353d6c1a7f6c801b384d"
"gitHead": "0e5bc65ed607bb1b013d475e7710bff5d8e1c155"
}

@@ -12,2 +12,11 @@ "use strict";

const regex = {
base: new RegExp( // eslint-disable-next-line
/^(https?:\/\/)((([a-z\d]([a-z\d-]*[a-z\d])*)\.)+[a-z]{2,}|((\d{1,3}\.){3}\d{1,3}))(\:\d+)?(\/[-a-z\d%_.~+]*)*(\?[;&a-z\d%_.~+=-]*)?(\#[-a-z\d_]*)?$/i),
ip: new RegExp( // eslint-disable-next-line
/^(https?:\/\/)(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/),
relative: new RegExp( // eslint-disable-next-line
/^\/.*$/)
};
var _default = (value, params) => {

@@ -21,8 +30,3 @@ if (!value) return;

const regex = new RegExp( // eslint-disable-next-line
/^(https?:\/\/)((([a-z\d]([a-z\d-]*[a-z\d])*)\.)+[a-z]{2,}|((\d{1,3}\.){3}\d{1,3}))(\:\d+)?(\/[-a-z\d%_.~+]*)*(\?[;&a-z\d%_.~+=-]*)?(\#[-a-z\d_]*)?$/i);
const ipRegex = new RegExp( // eslint-disable-next-line
/^(https?:\/\/)(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/);
if (regex.test(value)) {
if (regex.base.test(value)) {
if (!params.includes("noIp")) {

@@ -32,3 +36,3 @@ return;

if (!ipRegex.test(value)) {
if (!regex.ip.test(value)) {
return;

@@ -38,2 +42,8 @@ }

if (params.includes("allowRelative")) {
if (regex.relative.test(value)) {
return;
}
}
throw new _validationError.default("Value must be a valid URL.");

@@ -40,0 +50,0 @@ };

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