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.3.3
to
1.4.3
+39
-1
index.js
"use strict";
const { EventEmitter } = require("node:events");
const huffman = require("./lib/huffman");

@@ -14,4 +16,6 @@ const { getNormalizedParams } = require("./lib/formatters");

static Wrapper = class {
static Wrapper = class extends EventEmitter {
constructor() {
super();
return new Proxy(this, {

@@ -22,2 +26,4 @@ map: new Map(),

const isEventSubscription = name === "on";
if (name === "toJSON") {

@@ -45,5 +51,21 @@ return target.constructor.toString();

!isEventSubscription &&
target.emit("call", {
key,
before: output,
after: response,
didHash: true,
});
return response;
}
!isEventSubscription &&
target.emit("call", {
key,
before: output,
after: output,
didHash: false,
});
return output;

@@ -60,5 +82,21 @@ };

!isEventSubscription &&
target.emit("access", {
key,
before: value,
after: response,
didHash: true,
});
return response;
}
!isEventSubscription &&
target.emit("access", {
key,
before: value,
after: value,
didHash: false,
});
return value;

@@ -65,0 +103,0 @@ },

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

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

@@ -60,2 +60,34 @@ # cipherio

Subscribe to events
```js
const instance = new (class extends cipherio.Wrapper {
x = "abc";
foo() {
return true;
}
})();
instance.on("access", ({ before, after }) => {
console.log(before !== after); // true
});
instance.x;
```
```js
const instance = new (class extends cipherio.Wrapper {
x = "abc";
foo() {
return true;
}
})();
instance.on("call", ({ before, after }) => {
// ...
});
instance.foo();
```
## Test

@@ -62,0 +94,0 @@