Skip to content

Commit

Permalink
翻译: Deno.realpath (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
dream2023 authored Apr 14, 2020
1 parent 3dda6ba commit 59faea5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib.deno.ns.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1386,28 +1386,28 @@ declare namespace Deno {
isSymlink(): boolean;
}

/** Returns absolute normalized path, with symbolic links resolved.
/** 返回被解析后的符号链接绝对路径。
*
* // e.g. given /home/alice/file.txt and current directory /home/alice
* // 例如: 给定文件 /home/alice/file.txt 和当前目录 /home/alice
* Deno.symlinkSync("file.txt", "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"
* console.log(realPath); //输出 "/home/alice/file.txt"
* console.log(realSymLinkPath); //输出 "/home/alice/file.txt"
*
* Requires `allow-read` permission. */
* 需要 `allow-read` 权限 */
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
* // 例如: 给定文件 /home/alice/file.txt 和当前目录 /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");
* console.log(realPath); // outputs "/home/alice/file.txt"
* console.log(realSymLinkPath); //outputs "/home/alice/file.txt"
*
* Requires `allow-read` permission. */
* 需要 `allow-read` 权限 */
export function realpath(path: string): Promise<string>;

/** 不稳定:此 API 可能会更改为返回一个可迭代对象
Expand Down

0 comments on commit 59faea5

Please sign in to comment.