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 6.2.1 to 6.3.0

validators/object/index.d.ts

23

dev/play.js

@@ -13,22 +13,11 @@ "use strict";

};
const paymentMethods = Object.keys(paymentMethodsData);
const schema = index_1.Abolish.compileObject({
keys: {
typeof: "number",
arraySize: paymentMethods.length,
arrayValues: index_1.Abolish.compile({ inArray: paymentMethods }),
$error: `Invalid payment method, Body Keys must be [${paymentMethods.join(", ")}]`
},
values: {
$name: "Body Values",
array: "boolean"
}
const schema = index_1.Abolish.compile({
typeof: "object",
objectValuesType: "boolean",
objectValues: index_1.Abolish.compile("boolean")
});
// console.dir(schema.data, { depth: null });
const b = abolish.validate({
keys: [],
values: []
}, schema);
console.log({ b });
const b = abolish.check(paymentMethodsData, schema);
console.log(b);
}
Main().catch(console.error);
{
"name": "abolish",
"version": "6.2.1",
"version": "6.3.0",
"description": "A javascript object validator.",

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

@@ -12,2 +12,2 @@ import type Abolish from "./Abolish";

*/
export declare function registerValidators<T extends typeof Abolish>(abolish: T, validators: "string" | "array" | "utils"): typeof Abolish;
export declare function registerValidators<T extends typeof Abolish>(abolish: T, validators: "string" | "array" | "utils" | "object"): typeof Abolish;

@@ -9,4 +9,5 @@ "use strict";

function registerAllValidators(abolish) {
registerValidators(abolish, "array");
registerValidators(abolish, "object");
registerValidators(abolish, "string");
registerValidators(abolish, "array");
registerValidators(abolish, "utils");

@@ -29,4 +30,6 @@ return abolish;

return abolish.addGlobalValidators(require("../validators/utils"));
case "object":
return abolish.addGlobalValidators(require("../validators/object"));
}
}
exports.registerValidators = registerValidators;

@@ -10,2 +10,7 @@ // Arrays

// Objects
import "./object/objectValues";
import "./object/objectValuesAsync";
import "./object/objectValuesType";
// Strings

@@ -12,0 +17,0 @@ import "./string/alphaNumeric";

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