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

abolish

Package Overview
Dependencies
Maintainers
1
Versions
148
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

abolish - npm Package Compare versions

Comparing version 4.3.1 to 4.3.2

2

package.json
{
"name": "abolish",
"version": "4.3.1",
"version": "4.3.2",
"description": "A javascript object validator.",

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

@@ -313,47 +313,39 @@ "use strict";

validationResult instanceof AbolishError_1.default) {
let message = $error;
let message;
let data = null;
if (validationResult instanceof AbolishError_1.default) {
message = validationResult.message;
data = validationResult.data;
}
message = $error || message;
if ($errors && $errors[validatorName])
message = $errors[validatorName];
if (validationResult instanceof AbolishError_1.default) {
return [
{
key: rule,
type: "validator",
validator: validatorName,
message: message || validationResult.message,
data: validationResult.data
},
{}
];
}
else if (validationResult === false) {
/**
* Check if option is stringable
* This is required because a rule option could an array or an object
* and these cannot be converted to string
*
* Only strings and numbers can be parsed as :option
*/
const optionIsStringable = typeof validatorOption === "string" ||
typeof validatorOption === "number" ||
Array.isArray(validatorOption);
/**
* Replace :param with rule converted to upperCase
* and if option is stringable, replace :option with validatorOption
*/
message = (message || validator.error).replace(":param", $name ? $name : Functions_1.abolish_StartCase(rule, this));
if (optionIsStringable)
message = message.replace(":option", validatorOption);
// Return Error using the ValidationResult format
return [
{
key: rule,
type: "validator",
validator: validatorName,
message,
data: null
},
{}
];
}
/**
* Check if option is stringable
* This is required because a rule option could an array or an object
* and these cannot be converted to string
*
* Only strings and numbers can be parsed as :option
*/
const optionIsStringable = typeof validatorOption === "string" ||
typeof validatorOption === "number" ||
Array.isArray(validatorOption);
/**
* Replace :param with rule converted to upperCase
* and if option is stringable, replace :option with validatorOption
*/
message = (message || validator.error).replace(":param", $name ? $name : Functions_1.abolish_StartCase(rule, this));
if (optionIsStringable)
message = message.replace(":option", validatorOption);
// Return Error using the ValidationResult format
return [
{
key: rule,
type: "validator",
validator: validatorName,
message,
data
},
{}
];
}

@@ -431,46 +423,37 @@ }

if (validationResult === false || validationResult instanceof AbolishError_1.default) {
let message = $error;
let message;
let data = null;
if (validationResult instanceof AbolishError_1.default) {
message = validationResult.message;
data = validationResult.data;
}
message = $error || message;
if ($errors && $errors[validatorName])
message = $errors[validatorName];
if (validationResult instanceof AbolishError_1.default) {
return resolve([
{
key: rule,
type: "validator",
validator: validatorName,
message: message ? message : validationResult.message,
data: validationResult.data
},
{}
]);
}
else if (validationResult === false) {
/**
* Check if option is stringable
* This is required because a rule option could an array or an object
* and these cannot be converted to string
*
* Only strings and numbers can be parsed as :option
*/
const optionIsStringable = typeof validatorOption === "string" ||
typeof validatorOption === "number";
/**
* Replace :param with rule converted to upperCase
* and if option is stringable, replace :option with validatorOption
*/
message = (message || validator.error).replace(":param", $name ? $name : Functions_1.abolish_StartCase(rule, this));
if (optionIsStringable)
message = message.replace(":option", validatorOption);
// Return Error using the ValidationResult format
return resolve([
{
key: rule,
type: "validator",
validator: validatorName,
message,
data: null
},
{}
]);
}
/**
* Replace :param with rule converted to upperCase
* and if option is stringable, replace :option with validatorOption
*/
message = (message || validator.error).replace(":param", $name ? $name : Functions_1.abolish_StartCase(rule, this));
/**
* Check if option is stringable
* This is required because a rule option could an array or an object
* and these cannot be converted to string
*
* Only strings and numbers can be parsed as :option
*/
const optionIsStringable = typeof validatorOption === "string" || typeof validatorOption === "number";
if (optionIsStringable)
message = message.replace(":option", validatorOption);
// Return Error using the ValidationResult format
return resolve([
{
key: rule,
type: "validator",
validator: validatorName,
message: message,
data
},
{}
]);
}

@@ -477,0 +460,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