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

rollup-plugin-worker-factory

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-worker-factory - npm Package Compare versions

Comparing version 0.5.4 to 0.5.5

7

CHANGELOG.md

@@ -0,1 +1,8 @@

<a name="0.5.5"></a>
## [0.5.5](https://github.com/brandonocasey/rollup-plugin-worker-factory/compare/v0.5.4...v0.5.5) (2021-04-09)
### Bug Fixes
* support dispatchEvent on mock worker. Rename FakeWorker to MockWorker ([0050391](https://github.com/brandonocasey/rollup-plugin-worker-factory/commit/0050391))
<a name="0.5.4"></a>

@@ -2,0 +9,0 @@ ## [0.5.4](https://github.com/brandonocasey/rollup-plugin-worker-factory/compare/v0.5.3...v0.5.4) (2021-03-11)

2

package.json
{
"name": "rollup-plugin-worker-factory",
"version": "0.5.4",
"version": "0.5.5",
"description": "Bundle web workers that work in nodejs and the browser, without a separate build target.",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -1,2 +0,2 @@

class FakeWorker {
class MockWorker {
constructor() {

@@ -26,2 +26,12 @@ this.listeners_ = [];

dispatchEvent(event) {
if (!event || event.type !== 'message') {
return;
}
this.listeners_.forEach(function(fn) {
fn(event);
});
}
postMessage(data) {

@@ -56,9 +66,9 @@ if (this.remote_) {

FakeWorker.prototype.on = FakeWorker.prototype.addEventListener;
FakeWorker.prototype.off = FakeWorker.prototype.removeEventListener;
MockWorker.prototype.on = MockWorker.prototype.addEventListener;
MockWorker.prototype.off = MockWorker.prototype.removeEventListener;
export const factory = function(fn) {
return function() {
const client = new FakeWorker();
const worker = new FakeWorker();
const client = new MockWorker();
const worker = new MockWorker();

@@ -65,0 +75,0 @@ client.remote_ = worker;

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