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

@interweave/interweave

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@interweave/interweave - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

10

dist/thoughts.js

@@ -32,2 +32,6 @@ "use strict";

},
validation: {
min_length: 10,
max_length: 15,
},
},

@@ -38,2 +42,5 @@ description: {

},
validation: {
is_email: true,
},
},

@@ -63,2 +70,3 @@ price: {

type: "string",
is_optional: true,
},

@@ -109,3 +117,3 @@ },

],
default_value: "smartphones",
default_value: "fragrances",
},

@@ -112,0 +120,0 @@ },

22

dist/validate.js

@@ -303,11 +303,21 @@ "use strict";

}
if (config.validation.max_length) {
if ((value === null || value === void 0 ? void 0 : value.length) > config.validation.max_length) {
error(`Key '${key}' should not exceed a length of ${config.validation.max_length}, but received ${value.length}.`);
// Handle friendly error if both are present
// Let's give them a range to work with
if (config.validation.min_length && config.validation.max_length) {
if ((value === null || value === void 0 ? void 0 : value.length) < config.validation.min_length ||
(value === null || value === void 0 ? void 0 : value.length) > config.validation.max_length) {
error(`Key '${key}' should have a length between ${config.validation.min_length} and ${config.validation.max_length} characters, but received ${value.length} characters.`);
}
}
if (config.validation.min_length) {
if ((value === null || value === void 0 ? void 0 : value.length) < config.validation.min_length) {
error(`Key '${key}' should not have a length less than ${config.validation.max_length}, but received ${value.length}.`);
else {
if (config.validation.max_length) {
if ((value === null || value === void 0 ? void 0 : value.length) > config.validation.max_length) {
error(`Key '${key}' should not exceed a length of ${config.validation.max_length}, but received ${value.length}.`);
}
}
if (config.validation.min_length) {
if ((value === null || value === void 0 ? void 0 : value.length) < config.validation.min_length) {
error(`Key '${key}' should not have a length less than ${config.validation.min_length}, but received ${value.length}.`);
}
}
}

@@ -314,0 +324,0 @@ }

{
"name": "@interweave/interweave",
"version": "0.0.9",
"version": "0.0.10",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -423,15 +423,28 @@ import { isEmpty, isValuePresent } from "./helpers";

}
if (config.validation.max_length) {
if (value?.length > config.validation.max_length) {
// Handle friendly error if both are present
// Let's give them a range to work with
if (config.validation.min_length && config.validation.max_length) {
if (
value?.length < config.validation.min_length ||
value?.length > config.validation.max_length
) {
error(
`Key '${key}' should not exceed a length of ${config.validation.max_length}, but received ${value.length}.`
`Key '${key}' should have a length between ${config.validation.min_length} and ${config.validation.max_length} characters, but received ${value.length} characters.`
);
}
}
if (config.validation.min_length) {
if (value?.length < config.validation.min_length) {
error(
`Key '${key}' should not have a length less than ${config.validation.max_length}, but received ${value.length}.`
);
} else {
if (config.validation.max_length) {
if (value?.length > config.validation.max_length) {
error(
`Key '${key}' should not exceed a length of ${config.validation.max_length}, but received ${value.length}.`
);
}
}
if (config.validation.min_length) {
if (value?.length < config.validation.min_length) {
error(
`Key '${key}' should not have a length less than ${config.validation.min_length}, but received ${value.length}.`
);
}
}
}

@@ -438,0 +451,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