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

worker-factory

Package Overview
Dependencies
Maintainers
1
Versions
208
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

worker-factory - npm Package Compare versions

Comparing version 2.4.12 to 2.4.13

12

build/es2015/helpers/create-message-handler.js

@@ -8,9 +8,7 @@ import * as tslib_1 from "tslib";

if (messageHandler === undefined) {
// @todo The variable method is of type keyof T which is actually a string but TypeScript (v2.9.1) doesn't accept that.
throw renderMethodNotFoundError({ method: method });
throw renderMethodNotFoundError({ method });
}
const response = messageHandler(params);
if (response === undefined) {
// @todo The variable method is of type keyof T which is actually a string but TypeScript (v2.9.1) doesn't accept that.
throw renderMissingResponseError({ method: method });
throw renderMissingResponseError({ method });
}

@@ -20,4 +18,3 @@ const synchronousResponse = (response instanceof Promise) ? yield response : response;

if (synchronousResponse.result !== undefined) {
// @todo The variable method is of type keyof T which is actually a string but TypeScript (v2.9.1) doesn't accept that.
throw renderUnexpectedResultError({ method: method });
throw renderUnexpectedResultError({ method });
}

@@ -27,4 +24,3 @@ }

if (synchronousResponse.result === undefined) {
// @todo The variable method is of type keyof T which is actually a string but TypeScript (v2.9.1) doesn't accept that.
throw renderUnexpectedResultError({ method: method });
throw renderUnexpectedResultError({ method });
}

@@ -31,0 +27,0 @@ const { result, transferables = [] } = synchronousResponse;

import { IWorkerDefinition } from './worker-definition';
export interface IBrokerMessage<T extends IWorkerDefinition> {
id: null | number;
method: keyof T;
params: T[keyof T]['params'];
method: Extract<keyof T, string>;
params: T[Extract<keyof T, string>]['params'];
}

@@ -17,3 +17,2 @@ var _this = this;

if (messageHandler === undefined) {
// @todo The variable method is of type keyof T which is actually a string but TypeScript (v2.9.1) doesn't accept that.
throw renderMethodNotFoundError({ method: method });

@@ -23,3 +22,2 @@ }

if (response === undefined) {
// @todo The variable method is of type keyof T which is actually a string but TypeScript (v2.9.1) doesn't accept that.
throw renderMissingResponseError({ method: method });

@@ -39,3 +37,2 @@ }

if (synchronousResponse.result !== undefined) {
// @todo The variable method is of type keyof T which is actually a string but TypeScript (v2.9.1) doesn't accept that.
throw renderUnexpectedResultError({ method: method });

@@ -46,3 +43,2 @@ }

if (synchronousResponse.result === undefined) {
// @todo The variable method is of type keyof T which is actually a string but TypeScript (v2.9.1) doesn't accept that.
throw renderUnexpectedResultError({ method: method });

@@ -49,0 +45,0 @@ }

@@ -87,3 +87,3 @@ {

"types": "build/es2015/module.d.ts",
"version": "2.4.12"
"version": "2.4.13"
}

@@ -16,4 +16,3 @@ import { IAugmentedError } from 'compilerr';

if (messageHandler === undefined) {
// @todo The variable method is of type keyof T which is actually a string but TypeScript (v2.9.1) doesn't accept that.
throw renderMethodNotFoundError({ method: <string> method });
throw renderMethodNotFoundError({ method });
}

@@ -24,4 +23,3 @@

if (response === undefined) {
// @todo The variable method is of type keyof T which is actually a string but TypeScript (v2.9.1) doesn't accept that.
throw renderMissingResponseError({ method: <string> method });
throw renderMissingResponseError({ method });
}

@@ -33,9 +31,7 @@

if (synchronousResponse.result !== undefined) {
// @todo The variable method is of type keyof T which is actually a string but TypeScript (v2.9.1) doesn't accept that.
throw renderUnexpectedResultError({ method: <string> method });
throw renderUnexpectedResultError({ method });
}
} else {
if (synchronousResponse.result === undefined) {
// @todo The variable method is of type keyof T which is actually a string but TypeScript (v2.9.1) doesn't accept that.
throw renderUnexpectedResultError({ method: <string> method });
throw renderUnexpectedResultError({ method });
}

@@ -42,0 +38,0 @@

@@ -7,6 +7,6 @@ import { IWorkerDefinition } from './worker-definition';

method: keyof T;
method: Extract<keyof T, string>;
params: T[keyof T]['params'];
params: T[Extract<keyof T, string>]['params'];
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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