Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@truffle/contract-schema

Package Overview
Dependencies
Maintainers
11
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@truffle/contract-schema - npm Package Compare versions

Comparing version 3.4.3 to 3.4.4

4

package.json

@@ -15,3 +15,3 @@ {

},
"version": "3.4.3",
"version": "3.4.4",
"main": "index.js",

@@ -46,3 +46,3 @@ "directories": {

},
"gitHead": "dee904b194cfb391b4cf2ed470dc596a2d503898"
"gitHead": "653686708545be12b71f9b35eb7a3ca66510c54d"
}

@@ -1,13 +0,13 @@

var Schema = require("../index.js");
var assert = require("assert");
const Schema = require("../index.js");
const assert = require("assert");
var MetaCoin = require("./MetaCoin.json");
const MetaCoin = require("./MetaCoin.json");
describe("Schema", function() {
it("validates correct input", function() {
describe("Schema", function () {
it("validates correct input", function () {
Schema.validate(MetaCoin);
});
it("throws exception on invalid input", function() {
var invalid = {
it("throws exception on invalid input", function () {
const invalid = {
abi: -1

@@ -18,9 +18,38 @@ };

Schema.validate(invalid);
assert(false);
} catch (err) {
var abiErrors = err.errors.filter(function(error) {
const abiErrors = err.errors.filter(function (error) {
return error.dataPath === ".abi";
});
assert(abiErrors);
assert(abiErrors.length > 0);
}
});
it("validates a correct input as part of normalization", function () {
Schema.normalize(MetaCoin, {
validate: true
});
});
it("throws exception when attempting to validate invalid input during normalization", function () {
const invalid = {
abi: -1
};
try {
Schema.normalize(invalid, {
validate: true
});
assert(false);
} catch (err) {
const abiErrors = err.errors.filter(function (error) {
return error.dataPath === ".abi";
});
assert(abiErrors.length > 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