Socket
Socket
Sign inDemoInstall

funpermaproxy

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

funpermaproxy - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

.github/workflows/ci.yml

19

lib/permaproxy.js

@@ -6,12 +6,9 @@ /***

*
* 1. No construct and apply proxy traps.
* 2. Instead of an object reference and property name, uses getter function.
* 3. Rewritten in arrow functions
* 1. Instead of an object reference and property name, uses getter function.
* 2. Rewritten in arrow functions
*/
function permaproxy(directGetter) {
const target = {};
const getter = () => directGetter() || target;
const bound = new WeakMap();
function _permaproxy(directGetter, fallbackTarget) {
const getter = () => directGetter() || fallbackTarget;
return new Proxy(target, {
return new Proxy(fallbackTarget, {
getPrototypeOf: (_) => Reflect.getPrototypeOf(getter()),

@@ -33,5 +30,7 @@ setPrototypeOf: (_, prototype) => Reflect.setPrototypeOf(getter(), prototype),

ownKeys: (_) => Reflect.ownKeys(getter()),
construct: (_, argArray, newTarget) => Reflect.construct(getter(), argArray, newTarget),
apply: (_, thisArg, args) => Reflect.apply(getter(), thisArg, args),
});
}
module.exports = permaproxy;
module.exports = (getter) => _permaproxy(getter, {});
module.exports.callable = (getter) => _permaproxy(getter, function () {});
{
"name": "funpermaproxy",
"version": "1.0.1",
"version": "1.1.0",
"description": "Functional permaproxy — proxying an object mediated through a getter function",
"main": "index.js",
"main": "./index.js",
"types": "./index.d.ts",
"scripts": {

@@ -28,5 +29,5 @@ "test": "jest --verbose --coverage",

"devDependencies": {
"jest": "^24.8.0",
"semantic-release": "^15.13.12"
"jest": "^28.1.1",
"semantic-release": "^19.0.2"
}
}
# funpermaproxy
[![npm version](https://badge.fury.io/js/funpermaproxy.svg)](https://badge.fury.io/js/funpermaproxy)
[![Build Status](https://travis-ci.org/wix-incubator/funpermaproxy.svg?branch=master)](https://travis-ci.org/wix-incubator/funpermaproxy)
**funpermaproxy** is a fork of [MatrixAI/js-permaproxy](https://github.com/MatrixAI/js-permaproxy) with some key differences and a continous integration suite.
**funpermaproxy** (functional permaproxy) is about proxying an object mediated through a getter function.
In itself, it is a fork of [MatrixAI/js-permaproxy](https://github.com/MatrixAI/js-permaproxy) with some key differences and a continous integration suite.
The original repository was licensed under **Apache-2.0**, and this fork inherits [the license](LICENSE).

@@ -8,0 +11,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