Use web standard Permissions API (#3200)

This commit is contained in:
Yoshiya Hinosawa 2019-10-28 00:22:53 +09:00 committed by Ry Dahl
parent 2598f9c68d
commit efd7e78af3
15 changed files with 362 additions and 306 deletions

View file

@ -1,7 +1,11 @@
#!/usr/bin/env -S deno run --reload --allow-run
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import "./unit_tests.ts";
import { permissionCombinations, parseUnitTestOutput } from "./test_util.ts";
import {
permissionCombinations,
parseUnitTestOutput,
Permissions
} from "./test_util.ts";
interface TestResult {
perms: string;
@ -9,7 +13,7 @@ interface TestResult {
result: number;
}
function permsToCliFlags(perms: Deno.Permissions): string[] {
function permsToCliFlags(perms: Permissions): string[] {
return Object.keys(perms)
.map(
(key): string => {
@ -25,7 +29,7 @@ function permsToCliFlags(perms: Deno.Permissions): string[] {
.filter((e): boolean => e.length > 0);
}
function fmtPerms(perms: Deno.Permissions): string {
function fmtPerms(perms: Permissions): string {
let fmt = permsToCliFlags(perms).join(" ");
if (!fmt) {