diff options
Diffstat (limited to 'cli/js')
-rw-r--r-- | cli/js/lib.deno.ns.d.ts | 18 | ||||
-rw-r--r-- | cli/js/ops/fs/chown.ts | 10 |
2 files changed, 18 insertions, 10 deletions
diff --git a/cli/js/lib.deno.ns.d.ts b/cli/js/lib.deno.ns.d.ts index cd82b4adf..82b3fc829 100644 --- a/cli/js/lib.deno.ns.d.ts +++ b/cli/js/lib.deno.ns.d.ts @@ -1080,10 +1080,14 @@ declare namespace Deno { * Throws Error (not implemented) if executed on Windows * * @param path path to the file - * @param uid user id (UID) of the new owner - * @param gid group id (GID) of the new owner + * @param uid user id (UID) of the new owner, or `null` for no change + * @param gid group id (GID) of the new owner, or `null` for no change */ - export function chownSync(path: string | URL, uid: number, gid: number): void; + export function chownSync( + path: string | URL, + uid: number | null, + gid: number | null + ): void; /** Change owner of a regular file or directory. This functionality * is not available on Windows. @@ -1097,13 +1101,13 @@ declare namespace Deno { * Throws Error (not implemented) if executed on Windows * * @param path path to the file - * @param uid user id (UID) of the new owner - * @param gid group id (GID) of the new owner + * @param uid user id (UID) of the new owner, or `null` for no change + * @param gid group id (GID) of the new owner, or `null` for no change */ export function chown( path: string | URL, - uid: number, - gid: number + uid: number | null, + gid: number | null ): Promise<void>; export interface RemoveOptions { diff --git a/cli/js/ops/fs/chown.ts b/cli/js/ops/fs/chown.ts index f24ab5e55..3afe07f16 100644 --- a/cli/js/ops/fs/chown.ts +++ b/cli/js/ops/fs/chown.ts @@ -2,15 +2,19 @@ import { sendSync, sendAsync } from "../dispatch_json.ts"; import { pathFromURL } from "../../util.ts"; -export function chownSync(path: string | URL, uid: number, gid: number): void { +export function chownSync( + path: string | URL, + uid: number | null, + gid: number | null +): void { path = pathFromURL(path); sendSync("op_chown", { path, uid, gid }); } export async function chown( path: string | URL, - uid: number, - gid: number + uid: number | null, + gid: number | null ): Promise<void> { path = pathFromURL(path); await sendAsync("op_chown", { path, uid, gid }); |