From 59faea50ecedd5c8df27e1756f5f7c1414a88724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E8=B6=85=E6=9D=B0?= <1098626505@qq.com> Date: Wed, 15 Apr 2020 04:42:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BF=BB=E8=AF=91:=20Deno.realpath=20(#29)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib.deno.ns.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib.deno.ns.d.ts b/lib.deno.ns.d.ts index 3b1d858f..3777da80 100644 --- a/lib.deno.ns.d.ts +++ b/lib.deno.ns.d.ts @@ -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; /** 不稳定:此 API 可能会更改为返回一个可迭代对象