Skip to content

Commit

Permalink
change/deno ~ remove unneeded top-level-await (requires Deno v1.30.0+)
Browse files Browse the repository at this point in the history
- `Deno.permissions.querySync()` added in Deno v1.30.0 (on 2023-01-25)
- see [suggest: Deno.permissions.querySync](denoland/deno#15576)
- see [feat: Add sync APIs for "Deno.permissions"](denoland/deno#17019)
- see [v1.30.0](https://github.com/denoland/deno/releases/tag/v1.30.0) released on 2023-01-25
  • Loading branch information
rivy committed Nov 20, 2023
1 parent 7f6bf6f commit fdb0b34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/platform-shims/deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ const REQUIRE_DIRECTORY_ERROR =
'loading a directory of commands is not supported yet for ESM';

const DENO_ENV_PERMITTED: boolean =
(await Deno.permissions.query({name: 'env'})).state === 'granted';
(Deno.permissions.querySync({name: 'env'})).state === 'granted';
const DENO_READ_CWD_PERMITTED: boolean =
(await Deno.permissions.query({name: 'read', path: '.'})).state === 'granted';
(Deno.permissions.querySync({name: 'read', path: '.'})).state === 'granted';

// Deno removes argv[0] and argv[1] from Deno.args:
const argv = ['deno run', ...Deno.args];
Expand Down

0 comments on commit fdb0b34

Please sign in to comment.