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

@agoric/eventual-send

Package Overview
Dependencies
Maintainers
4
Versions
322
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agoric/eventual-send - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

31

dist/eventual-send.cjs.js

@@ -27,4 +27,9 @@ 'use strict';

let forwardingHandler;
function handler(p) {
return promiseToHandler.get(p) || forwardingHandler;
function handler(p, operation, ...args) {
const h = promiseToHandler.get(p) || forwardingHandler;
if (typeof h[operation] !== 'function') {
const handlerName = h === forwardingHandler ? 'forwardingHandler' : 'unfulfilledHandler';
throw TypeError(`${handlerName}.${operation} is not a function`);
}
return h[operation](p, ...args);
}

@@ -36,27 +41,27 @@

get(key) {
return handler(this).GET(this, key);
return handler(this, 'GET', key);
},
put(key, val) {
return handler(this).PUT(this, key, val);
return handler(this, 'PUT', key, val);
},
delete(key) {
return handler(this).DELETE(this, key);
return handler(this, 'DELETE', key);
},
post(optKey, args) {
return handler(this).POST(this, optKey, args);
return handler(this, 'POST', optKey, args);
},
invoke(optKey, ...args) {
return handler(this).POST(this, optKey, args);
return handler(this, 'POST', optKey, args);
},
fapply(args) {
return handler(this).POST(this, undefined, args);
return handler(this, 'POST', undefined, args);
},
fcall(...args) {
return handler(this).POST(this, undefined, args);
return handler(this, 'POST', undefined, args);
},

@@ -121,7 +126,2 @@ }),

}
for (const method of ['GET', 'PUT', 'DELETE', 'POST']) {
if (typeof h[method] !== 'function') {
throw TypeError(`Handler ${h} requires a ${method} method`);
}
}
}

@@ -223,2 +223,5 @@ validateHandler(unfulfilledHandler);

// The handler was resolved, so give it a naked object.
if (typeof fulfilledHandler[operation] !== 'function') {
throw TypeError(`fulfilledHandler.${operation} is not a function`);
}
return fulfilledHandler[operation](o, ...args);

@@ -225,0 +228,0 @@ }

@@ -25,4 +25,9 @@ /**

let forwardingHandler;
function handler(p) {
return promiseToHandler.get(p) || forwardingHandler;
function handler(p, operation, ...args) {
const h = promiseToHandler.get(p) || forwardingHandler;
if (typeof h[operation] !== 'function') {
const handlerName = h === forwardingHandler ? 'forwardingHandler' : 'unfulfilledHandler';
throw TypeError(`${handlerName}.${operation} is not a function`);
}
return h[operation](p, ...args);
}

@@ -34,27 +39,27 @@

get(key) {
return handler(this).GET(this, key);
return handler(this, 'GET', key);
},
put(key, val) {
return handler(this).PUT(this, key, val);
return handler(this, 'PUT', key, val);
},
delete(key) {
return handler(this).DELETE(this, key);
return handler(this, 'DELETE', key);
},
post(optKey, args) {
return handler(this).POST(this, optKey, args);
return handler(this, 'POST', optKey, args);
},
invoke(optKey, ...args) {
return handler(this).POST(this, optKey, args);
return handler(this, 'POST', optKey, args);
},
fapply(args) {
return handler(this).POST(this, undefined, args);
return handler(this, 'POST', undefined, args);
},
fcall(...args) {
return handler(this).POST(this, undefined, args);
return handler(this, 'POST', undefined, args);
},

@@ -119,7 +124,2 @@ }),

}
for (const method of ['GET', 'PUT', 'DELETE', 'POST']) {
if (typeof h[method] !== 'function') {
throw TypeError(`Handler ${h} requires a ${method} method`);
}
}
}

@@ -221,2 +221,5 @@ validateHandler(unfulfilledHandler);

// The handler was resolved, so give it a naked object.
if (typeof fulfilledHandler[operation] !== 'function') {
throw TypeError(`fulfilledHandler.${operation} is not a function`);
}
return fulfilledHandler[operation](o, ...args);

@@ -223,0 +226,0 @@ }

@@ -31,4 +31,9 @@ (function (global, factory) {

let forwardingHandler;
function handler(p) {
return promiseToHandler.get(p) || forwardingHandler;
function handler(p, operation, ...args) {
const h = promiseToHandler.get(p) || forwardingHandler;
if (typeof h[operation] !== 'function') {
const handlerName = h === forwardingHandler ? 'forwardingHandler' : 'unfulfilledHandler';
throw TypeError(`${handlerName}.${operation} is not a function`);
}
return h[operation](p, ...args);
}

@@ -40,27 +45,27 @@

get(key) {
return handler(this).GET(this, key);
return handler(this, 'GET', key);
},
put(key, val) {
return handler(this).PUT(this, key, val);
return handler(this, 'PUT', key, val);
},
delete(key) {
return handler(this).DELETE(this, key);
return handler(this, 'DELETE', key);
},
post(optKey, args) {
return handler(this).POST(this, optKey, args);
return handler(this, 'POST', optKey, args);
},
invoke(optKey, ...args) {
return handler(this).POST(this, optKey, args);
return handler(this, 'POST', optKey, args);
},
fapply(args) {
return handler(this).POST(this, undefined, args);
return handler(this, 'POST', undefined, args);
},
fcall(...args) {
return handler(this).POST(this, undefined, args);
return handler(this, 'POST', undefined, args);
},

@@ -125,7 +130,2 @@ }),

}
for (const method of ['GET', 'PUT', 'DELETE', 'POST']) {
if (typeof h[method] !== 'function') {
throw TypeError(`Handler ${h} requires a ${method} method`);
}
}
}

@@ -227,2 +227,5 @@ validateHandler(unfulfilledHandler);

// The handler was resolved, so give it a naked object.
if (typeof fulfilledHandler[operation] !== 'function') {
throw TypeError(`fulfilledHandler.${operation} is not a function`);
}
return fulfilledHandler[operation](o, ...args);

@@ -229,0 +232,0 @@ }

{
"name": "@agoric/eventual-send",
"version": "0.1.7",
"version": "0.1.8",
"description": "Extend a Promise class to implement the eventual-send API",

@@ -5,0 +5,0 @@ "main": "dist/eventual-send.cjs.js",

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