1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-10 16:11:13 -05:00

docs(cli/dts): fix Deno.permissions.query example (#10572)

This commit is contained in:
Casper Beyer 2021-05-11 13:44:15 +08:00 committed by GitHub
parent 576f14baeb
commit 62562f3fd1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2263,9 +2263,7 @@ declare namespace Deno {
*
* ```ts
* const status = await Deno.permissions.query({ name: "read", path: "/etc" });
* if (status.state === "granted") {
* data = await Deno.readFile("/etc/passwd");
* }
* console.log(status.state);
* ```
*/
query(desc: PermissionDescriptor): Promise<PermissionStatus>;
@ -2274,6 +2272,7 @@ declare namespace Deno {
*
* ```ts
* import { assert } from "https://deno.land/std/testing/asserts.ts";
*
* const status = await Deno.permissions.revoke({ name: "run" });
* assert(status.state !== "granted")
* ```