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.4.0 to 4.5.0

2

package.json
{
"name": "abolish",
"version": "4.4.0",
"version": "4.5.0",
"description": "A javascript object validator.",

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

@@ -135,3 +135,4 @@ "use strict";

jobs: [],
keysToBeValidated: []
keysToBeValidated: [],
includeKeys: []
};

@@ -160,4 +161,11 @@ // clone rules

/**
* abolish_Get Keys to be validated
* Get Keys to be validated
*/
let includeKeys = [];
if (rules.hasOwnProperty("$include")) {
includeKeys = rules["$include"];
if (!Array.isArray(includeKeys))
throw new Error(`$include has to be an array!`);
delete rules["$include"];
}
let keysToBeValidated = Object.keys(rules);

@@ -360,6 +368,7 @@ // Loop through defined rules

asyncData.keysToBeValidated = keysToBeValidated;
asyncData.includeKeys = includeKeys;
return asyncData;
}
// abolish_Pick only keys in rules
validated = Functions_1.abolish_Pick(validated, keysToBeValidated);
validated = Functions_1.abolish_Pick(validated, keysToBeValidated.concat(includeKeys));
return [false, validated];

@@ -383,3 +392,3 @@ }

*/
const { validated, jobs, keysToBeValidated } = asyncData;
const { validated, jobs, keysToBeValidated, includeKeys } = asyncData;
/**

@@ -463,3 +472,3 @@ * Return a promise

}
return resolve([false, Functions_1.abolish_Pick(validated, keysToBeValidated)]);
return resolve([false, Functions_1.abolish_Pick(validated, keysToBeValidated.concat(includeKeys))]);
});

@@ -466,0 +475,0 @@ }

@@ -24,3 +24,3 @@ import AbolishError from "./AbolishError";

modifier: ObjectModifier;
}) => boolean | AbolishError | Promise<boolean | AbolishError>;
}) => boolean | AbolishError | void | Promise<boolean | AbolishError | void>;
export declare type AbolishInlineValidator = (value: any, helpers: {

@@ -27,0 +27,0 @@ error: (message: string, data?: any) => AbolishError;

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