1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-23 07:44:48 -05:00
denoland-deno/tests/registry/jsr/@denotest/worker/0.1.0/mod.ts
David Sherret 1587387bcc
chore(test): move npm registries to separate servers and to the tests/registry folder (#23717)
1. Moves the npm registries to their own dedicated ports.
2. Moves the data files out of `tests/testdata/npm/registry` to
`tests/registry/npm`.
2024-05-07 01:06:01 +00:00

13 lines
325 B
TypeScript

export function addAsync(a: number, b: number): Promise<number> {
const worker = new Worker(import.meta.resolve("./worker.ts"), {
type: "module",
});
return new Promise((resolve) => {
worker.addEventListener("message", (event) => {
resolve(event.data);
});
worker.postMessage({ a, b });
});
}