From 36fde75d779078118af3b2b6c078bcbfb47b1a0f Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Sun, 17 May 2020 19:24:39 +0200 Subject: Miscellaneous documentation and spelling improvements (#5527) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Extended/updated documentation on code editor setup and plugins. * Moved documentation to the right file. * Fixed spelling errors in documentation and code. * Updated broken links. Co-authored-by: 迷渡 Co-authored-by: AlfieriChou Co-authored-by: Anil Seervi Co-authored-by: Fernando Basso Co-authored-by: József Sallai Co-authored-by: S4ltyGo4t Co-authored-by: Tommy May Co-authored-by: Turbinya Co-authored-by: ᴜɴвʏтᴇ --- std/fs/README.md | 20 +++----------------- std/fs/empty_dir.ts | 2 +- 2 files changed, 4 insertions(+), 18 deletions(-) (limited to 'std/fs') diff --git a/std/fs/README.md b/std/fs/README.md index 288f1922f..a8b2c9614 100644 --- a/std/fs/README.md +++ b/std/fs/README.md @@ -4,7 +4,8 @@ fs module is made to provide helpers to manipulate the filesystem. ## Usage -All the following modules are exposed in `mod.ts` +All the following modules are exposed in `mod.ts` This feature is currently +unstable. To enable it use `deno run --unstable` ### emptyDir @@ -59,7 +60,7 @@ ensureSymlink("./folder/targetFile.dat", "./folder/targetFile.link.dat"); // ret ensureSymlinkSync("./folder/targetFile.dat", "./folder/targetFile.link.dat"); // void ``` -### eol +### EOL Detects and format the passed string for the targeted End Of Line character. @@ -91,21 +92,6 @@ exists("./foo"); // returns a Promise existsSync("./foo"); // returns boolean ``` -### globToRegExp - -Generate a regex based on glob pattern and options This was meant to be using -the the `fs.walk` function but can be used anywhere else. - -```ts -import { globToRegExp } from "https://deno.land/std/fs/mod.ts"; - -globToRegExp("foo/**/*.json", { - flags: "g", - extended: true, - globstar: true, -}); // returns the regex to find all .json files in the folder foo -``` - ### move Moves a file or directory. Overwrites it if option provided diff --git a/std/fs/empty_dir.ts b/std/fs/empty_dir.ts index de52890a3..2f5d2deeb 100644 --- a/std/fs/empty_dir.ts +++ b/std/fs/empty_dir.ts @@ -43,7 +43,7 @@ export function emptyDirSync(dir: string): void { try { const items = [...readDirSync(dir)]; - // if directory already exist. then remove it's child item. + // If the directory exists, remove all entries inside it. while (items.length) { const item = items.shift(); if (item && item.name) { -- cgit v1.2.3