Skip to content

Commit f2e0d5c

Browse files
committed
Update dependencies
1 parent fbe0c17 commit f2e0d5c

File tree

18 files changed

+190
-190
lines changed

18 files changed

+190
-190
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const obj = {
5858
counter: 0,
5959
inc() {
6060
this.counter++;
61-
}
61+
},
6262
};
6363

6464
Comlink.expose(obj);
@@ -118,7 +118,7 @@ await myProxy.someFunction(Comlink.transfer(data, [data.buffer]));
118118
Lastly, you can use `Comlink.proxy(value)`. When using this Comlink will neither copy nor transfer the value, but instead send a proxy. Both threads now work on the same value. This is useful for callbacks, for example, as functions are neither structured cloneable nor transferable.
119119

120120
```js
121-
myProxy.onready = Comlink.proxy(data => {
121+
myProxy.onready = Comlink.proxy((data) => {
122122
/* ... */
123123
});
124124
```
@@ -137,19 +137,19 @@ Each function parameter and return value is given to _all_ registered transfer h
137137

138138
```js
139139
Comlink.transferHandlers.set("EVENT", {
140-
canHandle: obj => obj instanceof Event,
141-
serialize: ev => {
140+
canHandle: (obj) => obj instanceof Event,
141+
serialize: (ev) => {
142142
return [
143143
{
144144
target: {
145145
id: ev.target.id,
146-
classList: [...ev.target.classList]
147-
}
146+
classList: [...ev.target.classList],
147+
},
148148
},
149-
[]
149+
[],
150150
];
151151
},
152-
deserialize: obj => obj
152+
deserialize: (obj) => obj,
153153
});
154154
```
155155

docs/examples/01-simple-example/worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const obj = {
1818
counter: 0,
1919
inc() {
2020
this.counter++;
21-
}
21+
},
2222
};
2323

2424
Comlink.expose(obj);

docs/examples/04-eventlistener-example/event.transferhandler.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ Comlink.transferHandlers.set("event", {
99
targetClassList: obj &&
1010
obj.target &&
1111
obj.target.classList && [...obj.target.classList],
12-
detail: obj && obj.detail
12+
detail: obj && obj.detail,
1313
},
14-
[]
14+
[],
1515
];
1616
},
1717
deserialize(obj) {
1818
return obj;
19-
}
19+
},
2020
});

docs/examples/04-eventlistener-example/worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ Comlink.expose({
2222
ev.targetClassList
2323
)}`
2424
);
25-
}
25+
},
2626
});

docs/examples/05-serviceworker-example/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
const { port1, port2 } = new MessageChannel();
99
const msg = {
1010
comlinkInit: true,
11-
port: port1
11+
port: port1,
1212
};
1313
navigator.serviceWorker.controller.postMessage(msg, [port1]);
1414

docs/examples/05-serviceworker-example/worker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ const obj = {
2121
counter: 0,
2222
inc() {
2323
this.counter++;
24-
}
24+
},
2525
};
2626

27-
self.addEventListener("message", event => {
27+
self.addEventListener("message", (event) => {
2828
if (event.data.comlinkInit) {
2929
Comlink.expose(obj, event.data.port);
3030
return;

docs/examples/06-node-example/worker.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ import nodeEndpoint from "../../../dist/esm/node-adapter.mjs";
55
const api = {
66
doMath() {
77
return 4;
8-
}
8+
},
99
};
1010
Comlink.expose(api, nodeEndpoint(parentPort));

docs/examples/99-nonworker-examples/iframes/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// import * as Comlink from "../../../../dist/esm/comlink.mjs";
77
async function main() {
88
const ifr = document.querySelector("iframe");
9-
await new Promise(resolve => (ifr.onload = resolve));
9+
await new Promise((resolve) => (ifr.onload = resolve));
1010
const f = Comlink.wrap(Comlink.windowEndpoint(ifr.contentWindow));
1111
alert(`1 + 3 = ${await f(1, 3)}`);
1212
}

karma.conf.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@
1111
* limitations under the License.
1212
*/
1313

14-
module.exports = function(config) {
14+
module.exports = function (config) {
1515
const configuration = {
1616
basePath: "",
1717
frameworks: ["mocha", "chai", "detectBrowsers"],
1818
files: [
1919
{
2020
pattern: "tests/fixtures/*",
21-
included: false
21+
included: false,
2222
},
2323
{
2424
pattern: "dist/**/*.@(mjs|js)",
25-
included: false
25+
included: false,
2626
},
2727
{
2828
pattern: "tests/*.test.js",
29-
type: "module"
30-
}
29+
type: "module",
30+
},
3131
],
3232
reporters: ["progress"],
3333
port: 9876,
@@ -40,7 +40,7 @@ module.exports = function(config) {
4040
enabled: true,
4141
usePhantomJS: false,
4242
preferHeadless: true,
43-
postDetection: availableBrowsers => {
43+
postDetection: (availableBrowsers) => {
4444
if (process.env.INSIDE_DOCKER) {
4545
return ["DockerChrome"];
4646
} else if (process.env.CHROME_ONLY) {
@@ -51,17 +51,17 @@ module.exports = function(config) {
5151
// I know that’s not a good reason to disable tests,
5252
// but Safari TP is relatively unimportant.
5353
return availableBrowsers.filter(
54-
browser => browser !== "SafariTechPreview"
54+
(browser) => browser !== "SafariTechPreview"
5555
);
5656
}
57-
}
57+
},
5858
},
5959
customLaunchers: {
6060
DockerChrome: {
6161
base: "ChromeHeadless",
62-
flags: ["--no-sandbox"]
63-
}
64-
}
62+
flags: ["--no-sandbox"],
63+
},
64+
},
6565
};
6666

6767
config.set(configuration);

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"test:types": "tsc -p ./tests/tsconfig.json",
1212
"test:types:watch": "npm run test:types -- --watch",
1313
"test": "npm run fmt_test && npm run build && npm run test:types && npm run test:unit",
14-
"fmt": "prettier --write ./*.{mjs,js,ts,md,json,html} ./{src,docs,tests}/{,**/}*.{mjs,js,ts,md,json,html}",
15-
"fmt_test": "test $(prettier -l ./*.{mjs,js,ts,md,json,html} ./{src,docs,tests}/{**/,}*.{mjs,js,ts,md,json,html} | wc -l) -eq 0",
14+
"fmt": "prettier --write './*.{mjs,js,ts,md,json,html}' './{src,docs,tests}/{,**/}*.{mjs,js,ts,md,json,html}'",
15+
"fmt_test": "test $(prettier -l './*.{mjs,js,ts,md,json,html}' './{src,docs,tests}/{**/,}*.{mjs,js,ts,md,json,html}' | wc -l) -eq 0",
1616
"watchtest": "CHROME_ONLY=1 karma start --no-single-run"
1717
},
1818
"husky": {
@@ -32,21 +32,21 @@
3232
"devDependencies": {
3333
"chai": "4.2.0",
3434
"conditional-type-checks": "1.0.5",
35-
"husky": "3.1.0",
36-
"karma": "4.4.1",
35+
"husky": "^4.2.5",
36+
"karma": "^5.0.2",
3737
"karma-chai": "0.1.0",
3838
"karma-chrome-launcher": "3.1.0",
3939
"karma-detect-browsers": "2.3.3",
40-
"karma-firefox-launcher": "1.2.0",
41-
"karma-mocha": "1.3.0",
40+
"karma-firefox-launcher": "^1.3.0",
41+
"karma-mocha": "^2.0.0",
4242
"karma-safari-launcher": "1.0.0",
4343
"karma-safaritechpreview-launcher": "2.0.2",
44-
"mocha": "6.2.2",
45-
"prettier": "1.19.1",
46-
"rimraf": "3.0.0",
47-
"rollup": "1.27.8",
48-
"rollup-plugin-terser": "5.1.2",
49-
"rollup-plugin-typescript2": "0.25.3",
44+
"mocha": "^7.1.2",
45+
"prettier": "^2.0.5",
46+
"rimraf": "^3.0.2",
47+
"rollup": "^2.7.3",
48+
"rollup-plugin-terser": "^5.3.0",
49+
"rollup-plugin-typescript2": "^0.27.0",
5050
"typescript": "3.8.3"
5151
},
5252
"dependencies": {}

0 commit comments

Comments
 (0)