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

contractis

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

contractis - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

LICENSE

50

contract.js

@@ -53,3 +53,10 @@ var stackTrace = require("stack-trace");

const contract_function = (fun, contr, that, check_vars, contrDefinition) => {
const contract_function = (
fun,
contr,
that,
check_vars,
contrDefinition,
fname
) => {
function newf(...args) {

@@ -66,3 +73,3 @@ const opts = get_arguments_returns(contr);

rv,
"return value",
"return value " + (fname || ""),
contrDefinition,

@@ -77,3 +84,3 @@ newf

v,
"promise value",
"promise value " + (fname || ""),
contrDefinition,

@@ -97,2 +104,3 @@ newf

const contract_class = that => {
if (!enabled) return;
const proto = Object.getPrototypeOf(that);

@@ -121,6 +129,20 @@ const opts = proto.constructor.contract;

const oldf = d.value;
d.value = contract_function(oldf, v, that);
d.value = contract_function(
oldf,
v,
that,
undefined,
undefined,
`${proto.constructor.name}.${k}`
);
} else if (d.get) {
const oldf = d.get;
d.get = contract_function(oldf, v, that);
d.get = contract_function(
oldf,
v,
that,
undefined,
undefined,
`${proto.constructor.name}.${k}`
);
}

@@ -142,6 +164,20 @@

const oldf = d.value;
d.value = contract_function(oldf, v, that);
d.value = contract_function(
oldf,
v,
that,
undefined,
undefined,
`${proto.constructor.name}.${k}`
);
} else if (d.get) {
const oldf = d.get;
d.get = contract_function(oldf, v, that);
d.get = contract_function(
oldf,
v,
that,
undefined,
undefined,
`${proto.constructor.name}.${k}`
);
}

@@ -148,0 +184,0 @@ d.writable = false;

2

is.js

@@ -115,3 +115,3 @@ const gen = require("./generators");

typeof x === "object" &&
(typeof alsoCheckThat === "undefined" || alsoCheckThat(o)) &&
(typeof alsoCheckThat === "undefined" || alsoCheckThat(x)) &&
Object.entries(o || {}).every(([k, v]) => v.check(x[k])),

@@ -118,0 +118,0 @@ generate:

{
"name": "contractis",
"version": "0.0.1",
"version": "0.0.2",
"description": "",

@@ -19,3 +19,4 @@ "main": "index.js",

"testEnvironment": "node"
}
},
"gitHead": "2f1c8cbb28195cacaee48648f60817e17fa3601b"
}
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