New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

cipherio

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cipherio - npm Package Compare versions

Comparing version
1.2.3
to
1.3.3
+52
-0
index.js

@@ -14,2 +14,54 @@ "use strict";

static Wrapper = class {
constructor() {
return new Proxy(this, {
map: new Map(),
get(target, name) {
const self = this;
if (name === "toJSON") {
return target.constructor.toString();
}
const key = JSON.stringify({
target: target.constructor.toString(),
name,
});
if (typeof target[name] === "function") {
if (this.map.has(key)) {
return () => this.map.get(key);
}
return function (...args) {
const output = target[name].bind(target)(...args);
if (typeof output === "string") {
const response = cipherio.compile(output);
self.map.set(key, response);
return response;
}
return output;
};
}
const value = target[name];
if (typeof value === "string") {
const response = cipherio.compile(value);
self.map.set(key, response);
return response;
}
return value;
},
});
}
};
static compile(code, params) {

@@ -16,0 +68,0 @@ params = getNormalizedParams(params, this.DEFAULT);

+1
-1
{
"name": "cipherio",
"version": "1.2.3",
"version": "1.3.3",
"description": "Make secure parts in shared code",

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

@@ -46,2 +46,16 @@ # cipherio

Wrapping classes to return hashed values
```js
const instance = new (class extends cipherio.Wrapper {
prop = "abc";
foo() {
return "bar";
}
})();
const originalProp = cipherio.read(instance.prop);
const functionResult = cipherio.read(instance.foo());
```
## Test

@@ -48,0 +62,0 @@