Cleanup comments and internal variables (#4205)

This commit is contained in:
dubiousjim 2020-03-02 10:19:42 -05:00 committed by GitHub
parent 809019dc6e
commit 6cd46fa3ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 681 additions and 572 deletions

View file

@ -2,27 +2,29 @@
import { sendSync, sendAsync } from "./dispatch_json.ts";
export interface RemoveOption {
/** Defaults to `false`. If set to `true`, path will be removed even if
* it's a non-empty directory. */
recursive?: boolean;
}
/** Removes the named file, directory or symlink synchronously. Would throw
* error if permission denied, not found, or directory not empty if `recursive`
* set to false.
* `recursive` is set to false by default.
/** Synchronously removes the named file or directory. Throws error if
* permission denied, path not found, or path is a non-empty directory and
* the `recursive` option isn't set to `true`.
*
* Deno.removeSync("/path/to/dir/or/file", {recursive: false});
*/
* Deno.removeSync("/path/to/dir/or/file", { recursive: false });
*
* Requires `allow-write` permission. */
export function removeSync(path: string, options: RemoveOption = {}): void {
sendSync("op_remove", { path, recursive: !!options.recursive });
}
/** Removes the named file, directory or symlink. Would throw error if
* permission denied, not found, or directory not empty if `recursive` set
* to false.
* `recursive` is set to false by default.
/** Removes the named file or directory. Throws error if permission denied,
* path not found, or path is a non-empty directory and the `recursive`
* option isn't set to `true`.
*
* await Deno.remove("/path/to/dir/or/file", {recursive: false});
*/
* await Deno.remove("/path/to/dir/or/file", { recursive: false });
*
* Requires `allow-write` permission. */
export async function remove(
path: string,
options: RemoveOption = {}