worker-factory
Advanced tools
Comparing version 2.4.12 to 2.4.13
@@ -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
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
84421
786