@agoric/eventual-send
Advanced tools
Comparing version 0.4.4 to 0.4.5
@@ -68,68 +68,66 @@ 'use strict'; | ||
const makeEGetterProxy = (x, wrap = o => o) => | ||
new Proxy( | ||
Object.create(null), | ||
{ | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
get(_target, prop) { | ||
return wrap(HandledPromise.get(x, prop)); | ||
}, | ||
new Proxy(Object.create(null), { | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
); | ||
get(_target, prop) { | ||
return wrap(HandledPromise.get(x, prop)); | ||
}, | ||
}); | ||
const makeEDeleterProxy = (x, wrap = o => o) => | ||
new Proxy( | ||
Object.create(null), | ||
{ | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
get(_target, prop) { | ||
return wrap(HandledPromise.delete(x, prop)); | ||
}, | ||
new Proxy(Object.create(null), { | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
); | ||
get(_target, prop) { | ||
return wrap(HandledPromise.delete(x, prop)); | ||
}, | ||
}); | ||
const makeEHasProxy = (x, wrap = o => o) => | ||
new Proxy(Object.create(null), { | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
get(_target, prop) { | ||
return wrap(HandledPromise.has(x, prop)); | ||
}, | ||
}); | ||
const makeESetterProxy = (x, wrap = o => o) => | ||
new Proxy( | ||
Object.create(null), | ||
{ | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
get(_target, prop) { | ||
return harden(value => | ||
wrap(HandledPromise.set(x, prop, value)), | ||
); | ||
}, | ||
new Proxy(Object.create(null), { | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
); | ||
get(_target, prop) { | ||
return harden(value => wrap(HandledPromise.set(x, prop, value))); | ||
}, | ||
}); | ||
const makeEMethodProxy = (x, wrap = o => o) => | ||
new Proxy( | ||
(..._args) => {}, | ||
{ | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
get(_target, prop) { | ||
return harden((...args) => | ||
wrap(HandledPromise.applyMethod(x, prop, args)), | ||
); | ||
}, | ||
apply(_target, _thisArg, args = []) { | ||
return wrap(HandledPromise.applyFunction(x, args)); | ||
}, | ||
}); | ||
new Proxy((..._args) => {}, { | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
get(_target, prop) { | ||
return harden((...args) => | ||
wrap(HandledPromise.applyMethod(x, prop, args)), | ||
); | ||
}, | ||
apply(_target, _thisArg, args = []) { | ||
return wrap(HandledPromise.applyFunction(x, args)); | ||
}, | ||
}); | ||
E.G = makeEGetterProxy; | ||
E.D = makeEDeleterProxy; | ||
E.S = makeESetterProxy; | ||
E.M = makeEMethodProxy; | ||
E.G = o => makeEGetterProxy(o); | ||
E.H = o => makeEHasProxy(o); | ||
E.D = o => makeEDeleterProxy(o); | ||
E.S = o => makeESetterProxy(o); | ||
E.M = o => makeEMethodProxy(o); | ||
@@ -146,2 +144,6 @@ const EChain = x => | ||
}, | ||
get H() { | ||
// Return has. | ||
return makeEHasProxy(x, EChain); | ||
}, | ||
get S() { | ||
@@ -204,2 +206,8 @@ // Return setter. | ||
}, | ||
has(target, key) { | ||
return EPromise.resolve(target).has(key); | ||
}, | ||
hasSendOnly(target, key) { | ||
EPromise.resolve(target).has(key); | ||
}, | ||
set(target, key, val) { | ||
@@ -321,2 +329,6 @@ return EPromise.resolve(target).put(key, val); | ||
has(key) { | ||
return handle(this, 'HAS', key); | ||
}, | ||
put(key, val) { | ||
@@ -418,2 +430,3 @@ return handle(this, 'PUT', key, val); | ||
GET: makePostponed('get'), | ||
HAS: makePostponed('has'), | ||
PUT: makePostponed('put'), | ||
@@ -548,2 +561,3 @@ DELETE: makePostponed('delete'), | ||
GET: makeForwarder('GET', (o, key) => o[key]), | ||
HAS: makeForwarder('HAS', (o, key) => key in o), | ||
PUT: makeForwarder('PUT', (o, key, val) => (o[key] = val)), | ||
@@ -550,0 +564,0 @@ DELETE: makeForwarder('DELETE', (o, key) => delete o[key]), |
@@ -64,68 +64,66 @@ /* global globalThis window */ | ||
const makeEGetterProxy = (x, wrap = o => o) => | ||
new Proxy( | ||
Object.create(null), | ||
{ | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
get(_target, prop) { | ||
return wrap(HandledPromise.get(x, prop)); | ||
}, | ||
new Proxy(Object.create(null), { | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
); | ||
get(_target, prop) { | ||
return wrap(HandledPromise.get(x, prop)); | ||
}, | ||
}); | ||
const makeEDeleterProxy = (x, wrap = o => o) => | ||
new Proxy( | ||
Object.create(null), | ||
{ | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
get(_target, prop) { | ||
return wrap(HandledPromise.delete(x, prop)); | ||
}, | ||
new Proxy(Object.create(null), { | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
); | ||
get(_target, prop) { | ||
return wrap(HandledPromise.delete(x, prop)); | ||
}, | ||
}); | ||
const makeEHasProxy = (x, wrap = o => o) => | ||
new Proxy(Object.create(null), { | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
get(_target, prop) { | ||
return wrap(HandledPromise.has(x, prop)); | ||
}, | ||
}); | ||
const makeESetterProxy = (x, wrap = o => o) => | ||
new Proxy( | ||
Object.create(null), | ||
{ | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
get(_target, prop) { | ||
return harden(value => | ||
wrap(HandledPromise.set(x, prop, value)), | ||
); | ||
}, | ||
new Proxy(Object.create(null), { | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
); | ||
get(_target, prop) { | ||
return harden(value => wrap(HandledPromise.set(x, prop, value))); | ||
}, | ||
}); | ||
const makeEMethodProxy = (x, wrap = o => o) => | ||
new Proxy( | ||
(..._args) => {}, | ||
{ | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
get(_target, prop) { | ||
return harden((...args) => | ||
wrap(HandledPromise.applyMethod(x, prop, args)), | ||
); | ||
}, | ||
apply(_target, _thisArg, args = []) { | ||
return wrap(HandledPromise.applyFunction(x, args)); | ||
}, | ||
}); | ||
new Proxy((..._args) => {}, { | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
get(_target, prop) { | ||
return harden((...args) => | ||
wrap(HandledPromise.applyMethod(x, prop, args)), | ||
); | ||
}, | ||
apply(_target, _thisArg, args = []) { | ||
return wrap(HandledPromise.applyFunction(x, args)); | ||
}, | ||
}); | ||
E.G = makeEGetterProxy; | ||
E.D = makeEDeleterProxy; | ||
E.S = makeESetterProxy; | ||
E.M = makeEMethodProxy; | ||
E.G = o => makeEGetterProxy(o); | ||
E.H = o => makeEHasProxy(o); | ||
E.D = o => makeEDeleterProxy(o); | ||
E.S = o => makeESetterProxy(o); | ||
E.M = o => makeEMethodProxy(o); | ||
@@ -142,2 +140,6 @@ const EChain = x => | ||
}, | ||
get H() { | ||
// Return has. | ||
return makeEHasProxy(x, EChain); | ||
}, | ||
get S() { | ||
@@ -200,2 +202,8 @@ // Return setter. | ||
}, | ||
has(target, key) { | ||
return EPromise.resolve(target).has(key); | ||
}, | ||
hasSendOnly(target, key) { | ||
EPromise.resolve(target).has(key); | ||
}, | ||
set(target, key, val) { | ||
@@ -317,2 +325,6 @@ return EPromise.resolve(target).put(key, val); | ||
has(key) { | ||
return handle(this, 'HAS', key); | ||
}, | ||
put(key, val) { | ||
@@ -414,2 +426,3 @@ return handle(this, 'PUT', key, val); | ||
GET: makePostponed('get'), | ||
HAS: makePostponed('has'), | ||
PUT: makePostponed('put'), | ||
@@ -544,2 +557,3 @@ DELETE: makePostponed('delete'), | ||
GET: makeForwarder('GET', (o, key) => o[key]), | ||
HAS: makeForwarder('HAS', (o, key) => key in o), | ||
PUT: makeForwarder('PUT', (o, key, val) => (o[key] = val)), | ||
@@ -546,0 +560,0 @@ DELETE: makeForwarder('DELETE', (o, key) => delete o[key]), |
@@ -70,68 +70,66 @@ (function (global, factory) { | ||
const makeEGetterProxy = (x, wrap = o => o) => | ||
new Proxy( | ||
Object.create(null), | ||
{ | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
get(_target, prop) { | ||
return wrap(HandledPromise.get(x, prop)); | ||
}, | ||
new Proxy(Object.create(null), { | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
); | ||
get(_target, prop) { | ||
return wrap(HandledPromise.get(x, prop)); | ||
}, | ||
}); | ||
const makeEDeleterProxy = (x, wrap = o => o) => | ||
new Proxy( | ||
Object.create(null), | ||
{ | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
get(_target, prop) { | ||
return wrap(HandledPromise.delete(x, prop)); | ||
}, | ||
new Proxy(Object.create(null), { | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
); | ||
get(_target, prop) { | ||
return wrap(HandledPromise.delete(x, prop)); | ||
}, | ||
}); | ||
const makeEHasProxy = (x, wrap = o => o) => | ||
new Proxy(Object.create(null), { | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
get(_target, prop) { | ||
return wrap(HandledPromise.has(x, prop)); | ||
}, | ||
}); | ||
const makeESetterProxy = (x, wrap = o => o) => | ||
new Proxy( | ||
Object.create(null), | ||
{ | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
get(_target, prop) { | ||
return harden(value => | ||
wrap(HandledPromise.set(x, prop, value)), | ||
); | ||
}, | ||
new Proxy(Object.create(null), { | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
); | ||
get(_target, prop) { | ||
return harden(value => wrap(HandledPromise.set(x, prop, value))); | ||
}, | ||
}); | ||
const makeEMethodProxy = (x, wrap = o => o) => | ||
new Proxy( | ||
(..._args) => {}, | ||
{ | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
get(_target, prop) { | ||
return harden((...args) => | ||
wrap(HandledPromise.applyMethod(x, prop, args)), | ||
); | ||
}, | ||
apply(_target, _thisArg, args = []) { | ||
return wrap(HandledPromise.applyFunction(x, args)); | ||
}, | ||
}); | ||
new Proxy((..._args) => {}, { | ||
...readOnlyProxy, | ||
has(_target, _prop) { | ||
return true; | ||
}, | ||
get(_target, prop) { | ||
return harden((...args) => | ||
wrap(HandledPromise.applyMethod(x, prop, args)), | ||
); | ||
}, | ||
apply(_target, _thisArg, args = []) { | ||
return wrap(HandledPromise.applyFunction(x, args)); | ||
}, | ||
}); | ||
E.G = makeEGetterProxy; | ||
E.D = makeEDeleterProxy; | ||
E.S = makeESetterProxy; | ||
E.M = makeEMethodProxy; | ||
E.G = o => makeEGetterProxy(o); | ||
E.H = o => makeEHasProxy(o); | ||
E.D = o => makeEDeleterProxy(o); | ||
E.S = o => makeESetterProxy(o); | ||
E.M = o => makeEMethodProxy(o); | ||
@@ -148,2 +146,6 @@ const EChain = x => | ||
}, | ||
get H() { | ||
// Return has. | ||
return makeEHasProxy(x, EChain); | ||
}, | ||
get S() { | ||
@@ -206,2 +208,8 @@ // Return setter. | ||
}, | ||
has(target, key) { | ||
return EPromise.resolve(target).has(key); | ||
}, | ||
hasSendOnly(target, key) { | ||
EPromise.resolve(target).has(key); | ||
}, | ||
set(target, key, val) { | ||
@@ -323,2 +331,6 @@ return EPromise.resolve(target).put(key, val); | ||
has(key) { | ||
return handle(this, 'HAS', key); | ||
}, | ||
put(key, val) { | ||
@@ -420,2 +432,3 @@ return handle(this, 'PUT', key, val); | ||
GET: makePostponed('get'), | ||
HAS: makePostponed('has'), | ||
PUT: makePostponed('put'), | ||
@@ -550,2 +563,3 @@ DELETE: makePostponed('delete'), | ||
GET: makeForwarder('GET', (o, key) => o[key]), | ||
HAS: makeForwarder('HAS', (o, key) => key in o), | ||
PUT: makeForwarder('PUT', (o, key, val) => (o[key] = val)), | ||
@@ -552,0 +566,0 @@ DELETE: makeForwarder('DELETE', (o, key) => delete o[key]), |
{ | ||
"name": "@agoric/eventual-send", | ||
"version": "0.4.4", | ||
"version": "0.4.5", | ||
"description": "Extend a Promise class to implement the eventual-send API", | ||
@@ -5,0 +5,0 @@ "main": "dist/eventual-send.cjs.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
71365
1669