mirror of
https://github.com/denoland/deno.git
synced 2024-12-14 19:37:59 -05:00
15 lines
287 B
JavaScript
15 lines
287 B
JavaScript
|
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,
|
||
|
});
|
||
|
};
|