summaryrefslogtreecommitdiff
path: root/cli/js/remove.ts
diff options
context:
space:
mode:
authordubiousjim <dubiousjim@gmail.com>2020-03-02 10:19:42 -0500
committerGitHub <noreply@github.com>2020-03-02 10:19:42 -0500
commit6cd46fa3ef4b12f35a60f1a33c7f038c06b5fc71 (patch)
treee8ef21a936ebac529a7c8e87681123fbd225ff5f /cli/js/remove.ts
parent809019dc6e9a80843affc927fa7a52cd41e76471 (diff)
Cleanup comments and internal variables (#4205)
Diffstat (limited to 'cli/js/remove.ts')
-rw-r--r--cli/js/remove.ts26
1 files changed, 14 insertions, 12 deletions
diff --git a/cli/js/remove.ts b/cli/js/remove.ts
index 53ceb825b..4d15cf241 100644
--- a/cli/js/remove.ts
+++ b/cli/js/remove.ts
@@ -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 = {}