broker-factory
Advanced tools
Comparing version 1.2.31 to 1.2.32
import * as tslib_1 from "tslib"; | ||
import { PORT_MAP } from './port-map'; | ||
export const extendBrokerImplementation = (partialBrokerImplementation) => { | ||
// @todo The spread operator can't be used here because TypeScript does not believe that partialBrokerImplementation is an object. | ||
return Object.assign({}, partialBrokerImplementation, { | ||
connect: ({ call }) => { | ||
return Object.assign({}, partialBrokerImplementation, { connect: ({ call }) => { | ||
return () => tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
@@ -13,4 +11,3 @@ const { port1, port2 } = new MessageChannel(); | ||
}); | ||
}, | ||
disconnect: ({ call }) => { | ||
}, disconnect: ({ call }) => { | ||
return (port) => tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
@@ -23,5 +20,4 @@ const portId = PORT_MAP.get(port); | ||
}); | ||
} | ||
}); | ||
} }); | ||
}; | ||
//# sourceMappingURL=/build/es2015/helpers/extend-broker-implementation.js.map |
@@ -19,5 +19,3 @@ (function (global, factory) { | ||
var extendBrokerImplementation = function extendBrokerImplementation(partialBrokerImplementation) { | ||
// @todo The spread operator can't be used here because TypeScript does not believe that partialBrokerImplementation is an object. | ||
return Object.assign({}, partialBrokerImplementation, { | ||
connect: function connect(_ref) { | ||
return Object.assign({}, partialBrokerImplementation, { connect: function connect(_ref) { | ||
var call = _ref.call; | ||
@@ -51,4 +49,3 @@ | ||
}; | ||
}, | ||
disconnect: function disconnect(_ref3) { | ||
}, disconnect: function disconnect(_ref3) { | ||
var call = _ref3.call; | ||
@@ -65,3 +62,3 @@ | ||
if (!(portId === undefined$2)) { | ||
if (!(portId === undefined)) { | ||
_context2.next = 3; | ||
@@ -85,4 +82,3 @@ break; | ||
}; | ||
} | ||
}); | ||
} }); | ||
}; | ||
@@ -114,3 +110,3 @@ | ||
ongoingRequests.delete(id); | ||
if (message.error === undefined$3) { | ||
if (message.error === undefined) { | ||
resolve(message.result); | ||
@@ -126,3 +122,3 @@ } else { | ||
var call = function call(method, params) { | ||
var transferables = arguments.length > 2 && arguments[2] !== undefined$3 ? arguments[2] : []; | ||
var transferables = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; | ||
@@ -136,3 +132,3 @@ return new Promise(function (resolve, reject) { | ||
var notify = function notify(method, params) { | ||
var transferables = arguments.length > 2 && arguments[2] !== undefined$3 ? arguments[2] : []; | ||
var transferables = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; | ||
@@ -144,3 +140,3 @@ sender.postMessage({ id: null, method: method, params: params }, transferables); | ||
var _didIteratorError = false; | ||
var _iteratorError = undefined$3; | ||
var _iteratorError = undefined; | ||
@@ -147,0 +143,0 @@ try { |
@@ -5,5 +5,3 @@ var _this = this; | ||
export var extendBrokerImplementation = function (partialBrokerImplementation) { | ||
// @todo The spread operator can't be used here because TypeScript does not believe that partialBrokerImplementation is an object. | ||
return Object.assign({}, partialBrokerImplementation, { | ||
connect: function (_a) { | ||
return tslib_1.__assign({}, partialBrokerImplementation, { connect: function (_a) { | ||
var call = _a.call; | ||
@@ -24,4 +22,3 @@ return function () { return tslib_1.__awaiter(_this, void 0, void 0, function () { | ||
}); }; | ||
}, | ||
disconnect: function (_a) { | ||
}, disconnect: function (_a) { | ||
var call = _a.call; | ||
@@ -44,5 +41,4 @@ return function (port) { return tslib_1.__awaiter(_this, void 0, void 0, function () { | ||
}); }; | ||
} | ||
}); | ||
} }); | ||
}; | ||
//# sourceMappingURL=/build/es2015/helpers/extend-broker-implementation.js.map |
@@ -15,3 +15,3 @@ { | ||
"tslib": "^1.9.2", | ||
"worker-factory": "^2.4.16" | ||
"worker-factory": "^2.4.17" | ||
}, | ||
@@ -40,3 +40,3 @@ "description": "A little factory function to create a broker for a JSON-RPC based Web Worker.", | ||
"husky": "^0.14.3", | ||
"karma": "^2.0.3", | ||
"karma": "^2.0.4", | ||
"karma-chrome-launcher": "^2.2.0", | ||
@@ -52,3 +52,3 @@ "karma-firefox-launcher": "~1.1.0", | ||
"mocha": "^5.2.0", | ||
"rollup": "^0.61.0", | ||
"rollup": "^0.61.1", | ||
"rollup-plugin-babel": "^3.0.4", | ||
@@ -60,3 +60,3 @@ "sinon": "^6.0.0", | ||
"tslint": "^5.10.0", | ||
"tslint-config-holy-grail": "^29.0.4", | ||
"tslint-config-holy-grail": "^30.0.0", | ||
"typescript": "^2.9.2", | ||
@@ -87,3 +87,3 @@ "webpack": "^4.12.0" | ||
"types": "build/es2015/module.d.ts", | ||
"version": "1.2.31" | ||
"version": "1.2.32" | ||
} |
@@ -9,4 +9,5 @@ import { IWorkerDefinition } from 'worker-factory'; | ||
): TBrokerImplementation<T & IDefaultBrokerDefinition, U> => { | ||
// @todo The spread operator can't be used here because TypeScript does not believe that partialBrokerImplementation is an object. | ||
return Object.assign({ }, partialBrokerImplementation, <TBrokerImplementation<IDefaultBrokerDefinition, U>> { | ||
return <TBrokerImplementation<T & IDefaultBrokerDefinition, U>> { | ||
// @todo TypeScript does not believe that partialBrokerImplementation is an object. | ||
...(partialBrokerImplementation as object), | ||
connect: ({ call }) => { | ||
@@ -34,3 +35,3 @@ return async (): Promise<MessagePort> => { | ||
} | ||
}); | ||
}; | ||
}; |
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
38941
485
Updatedworker-factory@^2.4.17