make camel case readDir, readLink, realPath (#4995)

This commit is contained in:
Ryan Dahl 2020-04-29 16:39:37 -04:00 committed by GitHub
parent 78e0ae643c
commit bc792c0267
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 80 additions and 80 deletions

View file

@ -1366,25 +1366,25 @@ declare namespace Deno {
*
* // e.g. given /home/alice/file.txt and current directory /home/alice
* Deno.symlinkSync("file.txt", "symlink_file.txt");
* const realPath = Deno.realpathSync("./file.txt");
* const realSymLinkPath = Deno.realpathSync("./symlink_file.txt");
* const realPath = Deno.realPathSync("./file.txt");
* const realSymLinkPath = Deno.realPathSync("./symlink_file.txt");
* console.log(realPath); // outputs "/home/alice/file.txt"
* console.log(realSymLinkPath); // outputs "/home/alice/file.txt"
*
* Requires `allow-read` permission. */
export function realpathSync(path: string): string;
export function realPathSync(path: string): string;
/** Resolves to the absolute normalized path, with symbolic links resolved.
*
* // e.g. given /home/alice/file.txt and current directory /home/alice
* await Deno.symlink("file.txt", "symlink_file.txt");
* const realPath = await Deno.realpath("./file.txt");
* const realSymLinkPath = await Deno.realpath("./symlink_file.txt");
* const realPath = await Deno.realPath("./file.txt");
* const realSymLinkPath = await Deno.realPath("./symlink_file.txt");
* console.log(realPath); // outputs "/home/alice/file.txt"
* console.log(realSymLinkPath); // outputs "/home/alice/file.txt"
*
* Requires `allow-read` permission. */
export function realpath(path: string): Promise<string>;
export function realPath(path: string): Promise<string>;
export interface DirEntry {
name: string;
@ -1396,26 +1396,26 @@ declare namespace Deno {
/** Synchronously reads the directory given by `path` and returns an iterable
* of `Deno.DirEntry`.
*
* for (const dirEntry of Deno.readdirSync("/")) {
* for (const dirEntry of Deno.readDirSync("/")) {
* console.log(dirEntry.name);
* }
*
* Throws error if `path` is not a directory.
*
* Requires `allow-read` permission. */
export function readdirSync(path: string): Iterable<DirEntry>;
export function readDirSync(path: string): Iterable<DirEntry>;
/** Reads the directory given by `path` and returns an async iterable of
* `Deno.DirEntry`.
*
* for await (const dirEntry of Deno.readdir("/")) {
* for await (const dirEntry of Deno.readDir("/")) {
* console.log(dirEntry.name);
* }
*
* Throws error if `path` is not a directory.
*
* Requires `allow-read` permission. */
export function readdir(path: string): AsyncIterable<DirEntry>;
export function readDir(path: string): AsyncIterable<DirEntry>;
/** Synchronously copies the contents and permissions of one file to another
* specified path, by default creating a new file if needed, else overwriting.
@ -1440,22 +1440,22 @@ declare namespace Deno {
/** Returns the full path destination of the named symbolic link.
*
* Deno.symlinkSync("./test.txt", "./test_link.txt");
* const target = Deno.readlinkSync("./test_link.txt"); // full path of ./test.txt
* const target = Deno.readLinkSync("./test_link.txt"); // full path of ./test.txt
*
* Throws TypeError if called with a hard link
*
* Requires `allow-read` permission. */
export function readlinkSync(path: string): string;
export function readLinkSync(path: string): string;
/** Resolves to the full path destination of the named symbolic link.
*
* await Deno.symlink("./test.txt", "./test_link.txt");
* const target = await Deno.readlink("./test_link.txt"); // full path of ./test.txt
* const target = await Deno.readLink("./test_link.txt"); // full path of ./test.txt
*
* Throws TypeError if called with a hard link
*
* Requires `allow-read` permission. */
export function readlink(path: string): Promise<string>;
export function readLink(path: string): Promise<string>;
/** Resolves to a `Deno.FileInfo` for the specified `path`. If `path` is a
* symlink, information for the symlink will be returned instead of what it