mirror of
https://github.com/denoland/deno.git
synced 2024-12-25 08:39:09 -05:00
14 lines
316 B
JavaScript
14 lines
316 B
JavaScript
|
import { fromFileUrl } from "../../../std/path/mod.ts";
|
||
|
|
||
|
onmessage = async ({ data }) => {
|
||
|
const { state } = await Deno.permissions.query({
|
||
|
name: "read",
|
||
|
path: fromFileUrl(new URL(data.route, import.meta.url)),
|
||
|
});
|
||
|
|
||
|
postMessage({
|
||
|
hasPermission: state === "granted",
|
||
|
index: data.index,
|
||
|
});
|
||
|
};
|