1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-27 01:29:14 -05:00
denoland-deno/tests/testdata/workers/env_read_check_worker.js

15 lines
287 B
JavaScript
Raw Normal View History

onmessage = async ({ data }) => {
const permissions = [];
for (const name of data.names) {
const { state } = await Deno.permissions.query({
name: "env",
variable: name,
});
permissions.push(state === "granted");
}
postMessage({
permissions,
});
};