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

proxymise

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

proxymise - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

13

index.js

@@ -11,3 +11,7 @@ const proxymise = (target) => {

const handler = {
/** @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/get */
construct(target, argumentsList) {
if (target.__proxy__) target = target();
return proxymise(Reflect.construct(target, argumentsList));
},
get(target, property, receiver) {

@@ -21,3 +25,2 @@ if (target.__proxy__) target = target();

/** @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/apply */
apply(target, thisArg, argumentsList) {

@@ -32,8 +35,10 @@ if (target.__proxy__) target = target();

/** @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect/get */
const get = (target, property, receiver) => {
const value = typeof target === 'object' ? Reflect.get(target, property, receiver) : target[property];
return typeof value === 'function' && typeof value.bind === 'function' ? value.bind(target) : value;
if (typeof value === 'function' && typeof value.bind === 'function') {
return Object.assign(value.bind(target), value);
}
return value;
};
module.exports = proxymise;
{
"name": "proxymise",
"version": "1.0.1",
"version": "1.0.2",
"description": "Chainable Promise Proxy",

@@ -17,2 +17,3 @@ "repository": "https://github.com/kozhevnikov/proxymise",

"devDependencies": {
"aws-sdk": "^2.275.1",
"chromedriver": "^2.40.0",

@@ -19,0 +20,0 @@ "eslint": "^4.19.1",

# Proxymise
*Chainable Promise Proxy*
[![npm](https://img.shields.io/npm/v/proxymise.svg)](https://www.npmjs.com/package/proxymise)
Chainable Promise Proxy.
Lightweight ES6 [Proxy] for [Promises] with no additional dependencies. Proxymise allows for method

@@ -40,3 +42,16 @@ and property chaining without need for intermediate `then()` or `await` for cleaner and simpler code.

- [Fetch and JSON parsing](https://github.com/kozhevnikov/proxymise/blob/master/test/fetch.test.js)
- [Fetch and parse JSON](https://github.com/kozhevnikov/proxymise/blob/master/test/fetch.test.js)
- [Amazon DynamoDB get item](https://github.com/kozhevnikov/proxymise/blob/master/test/dynamodb.test.js)
- [Selenium WebDriverJS and Page Objects](https://github.com/kozhevnikov/proxymise/blob/master/test/selenium.test.js)
## Performance
Proxymised [benchmark] with 10000 iterations is practically as performant as the non-proxymised one.
[benchmark]: https://github.com/kozhevnikov/proxymise/blob/master/test/benchmark.js
```shell
node test/benchmark.js
with proxymise: 3907.582ms
without proxymise: 3762.375ms
```
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