mirror of
https://github.com/denoland/deno.git
synced 2025-09-29 05:34:49 +00:00
feat: URL support in Deno filesystem methods (#5990)
This commit is contained in:
parent
813210d433
commit
818a801092
28 changed files with 741 additions and 66 deletions
|
@ -1,10 +1,13 @@
|
|||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||
import { sendSync, sendAsync } from "../dispatch_json.ts";
|
||||
import { pathFromURL } from "../../util.ts";
|
||||
|
||||
export function chmodSync(path: string, mode: number): void {
|
||||
export function chmodSync(path: string | URL, mode: number): void {
|
||||
path = pathFromURL(path);
|
||||
sendSync("op_chmod", { path, mode });
|
||||
}
|
||||
|
||||
export async function chmod(path: string, mode: number): Promise<void> {
|
||||
export async function chmod(path: string | URL, mode: number): Promise<void> {
|
||||
path = pathFromURL(path);
|
||||
await sendAsync("op_chmod", { path, mode });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue