Socket
Socket
Sign inDemoInstall

js-proxy

Package Overview
Dependencies
2
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.0 to 0.2.1

9

cjs/mitm.js

@@ -23,9 +23,8 @@ 'use strict';

const ws = handlers.get(handler) || set(handlers, handler);
if (!ws.has(target)) {
ws.add(target);
setPrototypeOf(target, new Proxy(getPrototypeOf(target), handler));
}
return target;
return ws.has(target) ? target : (
ws.add(target),
setPrototypeOf(target, new Proxy(getPrototypeOf(target), handler))
);
};
module.exports = mitm;

@@ -22,9 +22,8 @@ const { getPrototypeOf, setPrototypeOf } = Object;

const ws = handlers.get(handler) || set(handlers, handler);
if (!ws.has(target)) {
ws.add(target);
setPrototypeOf(target, new Proxy(getPrototypeOf(target), handler));
}
return target;
return ws.has(target) ? target : (
ws.add(target),
setPrototypeOf(target, new Proxy(getPrototypeOf(target), handler))
);
};
export default mitm;
{
"name": "js-proxy",
"version": "0.2.0",
"version": "0.2.1",
"description": "The one-stop shop solution for JS Proxies and FFI APIs",

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

@@ -308,5 +308,5 @@ [![build status](https://github.com/WebReflection/js-proxy/actions/workflows/node.js.yml/badge.svg)](https://github.com/WebReflection/js-proxy/actions) [![Coverage Status](https://coveralls.io/repos/github/WebReflection/js-proxy/badge.svg?branch=main)](https://coveralls.io/github/WebReflection/js-proxy?branch=main)

* `typeof` or `isArray` or anything else drilling the proxied type might reveal the proxy or fail
* references need to be proxied before others can consume these, as opposite of hook any extra feature/utility/observability without requiring 3rd party to change their reference to the real target
* references need to be proxied before others can consume these, as opposite of hooking any extra feature/utility/observability without requiring 3rd party to change their reference to the real target
Accordingly, the *MITM* export allows anything to have a proxy between its reference and its prototype, which requires extra careful handling, but it can summarized as such:
Accordingly, the *MITM* export allows anything to have a proxy between its reference and its prototype, which requires extra careful handling, but it can be summarized as such:

@@ -313,0 +313,0 @@ ```js

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc