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

@endo/eventual-send

Package Overview
Dependencies
Maintainers
4
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@endo/eventual-send - npm Package Compare versions

Comparing version 0.14.7 to 0.14.8

14

CHANGELOG.md

@@ -6,2 +6,16 @@ # Change Log

### [0.14.8](https://github.com/endojs/endo/compare/@endo/eventual-send@0.14.7...@endo/eventual-send@0.14.8) (2022-03-07)
### Features
* **eventual-send:** provide typing for `Remote<Primary, Local>` ([4d28509](https://github.com/endojs/endo/commit/4d285095a6ea1a78f1a3a4696bc822f5e4dfd43f))
### Bug Fixes
* **eventual-send:** properly declare `E` to be type `EProxy` ([3bdfdf7](https://github.com/endojs/endo/commit/3bdfdf77440f9ddea9bac1e783aaf015e9bcfa62))
### [0.14.7](https://github.com/endojs/endo/compare/@endo/eventual-send@0.14.6...@endo/eventual-send@0.14.7) (2022-03-02)

@@ -8,0 +22,0 @@

10

package.json
{
"name": "@endo/eventual-send",
"version": "0.14.7",
"version": "0.14.8",
"description": "Extend a Promise class to implement the eventual-send API",

@@ -16,3 +16,3 @@ "type": "module",

"lint": "yarn lint:types && yarn lint:eslint",
"lint:types": "tsc -p jsconfig.json",
"lint:types": "tsc -p jsconfig.test.json",
"lint:eslint": "eslint '**/*.js'"

@@ -31,4 +31,4 @@ },

"devDependencies": {
"@endo/lockdown": "^0.1.8",
"@endo/ses-ava": "^0.2.20",
"@endo/lockdown": "^0.1.9",
"@endo/ses-ava": "^0.2.21",
"ava": "^3.12.1",

@@ -66,3 +66,3 @@ "c8": "^7.7.3"

},
"gitHead": "08973d4fc6358a58d733251b051b2812bb4c651a"
"gitHead": "9ddd58b4a26755cdba9403b0cb042b2067c69832"
}

@@ -26,3 +26,3 @@ // @ts-check

* @param {*} x Any value passed to E(x)
* @param {*} HandledPromise
* @param {import('./index').HandledPromiseConstructor} HandledPromise
* @returns {ProxyHandler} the Proxy handler

@@ -51,3 +51,3 @@ */

* @param {*} x Any value passed to E.sendOnly(x)
* @param {*} HandledPromise
* @param {import('./index').HandledPromiseConstructor} HandledPromise
* @returns {ProxyHandler} the Proxy handler

@@ -75,2 +75,6 @@ */

/**
* @param {import('./index').HandledPromiseConstructor} HandledPromise
* @returns {import('./index').EProxy}
*/
export default function makeE(HandledPromise) {

@@ -77,0 +81,0 @@ function E(x) {

@@ -21,2 +21,16 @@ /* eslint-disable no-shadow,no-use-before-define,no-var,vars-on-top */

type FilteredKeys<T, U> = {
[P in keyof T]: T[P] extends U ? P : never;
}[keyof T];
type DataOnly<T> = Omit<T, FilteredKeys<T, Function>>;
type FunctionOnly<T> = Pick<T, FilteredKeys<T, Function>> &
(T extends Function ? (...args: Parameters<T>) => ReturnType<T> : {});
interface Remotable<T> {
__Remote__: T;
}
type Remote<Primary, Local = DataOnly<Primary>> = ERef<
Local & Remotable<Primary>
>;
type Unpromise<T> = T extends ERef<infer U> ? U : T;

@@ -63,3 +77,3 @@

declare interface HandledPromiseStaticMethods {
resolve<T>(x: T): Promise<Unpromise<T>>;
resolve<T>(x: T): Promise<Awaited<T>>;
resolve(): Promise<undefined>;

@@ -100,10 +114,10 @@ applyFunction(target: unknown, args: unknown[]): Promise<unknown>;

...args: Parameters<T[P]>
) => Promise<Unpromise<ReturnType<T[P]>>>;
) => Promise<Awaited<ReturnType<T[P]>>>;
};
type ESingleCall<T> = T extends Function
? ((...args: Parameters<T>) => Promise<Unpromise<ReturnType<T>>>) &
? ((...args: Parameters<T>) => Promise<Awaited<ReturnType<T>>>) &
ESingleMethod<Required<T>>
: ESingleMethod<Required<T>>;
type ESingleGet<T> = {
readonly [P in keyof T]: Promise<Unpromise<T[P]>>;
readonly [P in keyof T]: Promise<Awaited<T[P]>>;
};

@@ -123,3 +137,3 @@

interface ESendOnly {
<T>(x: T): ESingleCallOnly<Unpromise<T>>;
<T>(x: T): ESingleCallOnly<Awaited<T>>;
}

@@ -137,3 +151,9 @@

*/
<T>(x: T): ESingleCall<Unpromise<T>>;
<T>(x: T): ESingleCall<
T extends Remotable<infer U>
? FunctionOnly<U>
: Awaited<T> extends Remotable<infer U>
? FunctionOnly<U>
: Awaited<T>
>;

@@ -149,3 +169,11 @@ /**

*/
readonly get: <T>(x: T) => ESingleGet<Unpromise<T>>;
readonly get: <T>(
x: T,
) => ESingleGet<
T extends Remotable<infer U>
? DataOnly<U>
: Awaited<T> extends Remotable<infer U>
? DataOnly<U>
: Awaited<T>
>;

@@ -156,3 +184,3 @@ /**

*/
readonly resolve: <T>(x: T) => Promise<Unpromise<T>>;
readonly resolve: <T>(x: T) => Promise<Awaited<T>>;

@@ -165,3 +193,3 @@ /**

x: T,
onfulfilled?: (value: Unpromise<T>) => ERef<U>,
onfulfilled?: (value: Awaited<T>) => ERef<U>,
onrejected?: (reason: any) => ERef<U>,

@@ -168,0 +196,0 @@ ) => Promise<U>;

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