From f0ba814a79fe4f0791c4b0ef496a704356597467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=B2=BE=E6=AD=A6=E9=99=88=E7=9C=9F?= <546369005@qq.com> Date: Mon, 1 Jun 2020 21:53:43 +0800 Subject: [PATCH] fix jsDoc (#5992) --- cli/js/lib.deno.ns.d.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cli/js/lib.deno.ns.d.ts b/cli/js/lib.deno.ns.d.ts index 74f1a2e151..be4b1f15dd 100644 --- a/cli/js/lib.deno.ns.d.ts +++ b/cli/js/lib.deno.ns.d.ts @@ -364,7 +364,7 @@ declare namespace Deno { * * ```ts * let f = Deno.openSync("/etc/passwd"); - * for (const chunk of Deno.iterSync(reader)) { + * for (const chunk of Deno.iterSync(f)) { * console.log(chunk); * } * f.close(); @@ -509,7 +509,7 @@ declare namespace Deno { * ```ts * const encoder = new TextEncoder(); * const data = encoder.encode("Hello world"); - * const file = Deno.openSync("/foo/bar.txt"); + * const file = Deno.openSync("/foo/bar.txt", {write: true}); * const bytesWritten = Deno.writeSync(file.rid, data); // 11 * Deno.close(file.rid); * ``` @@ -528,7 +528,7 @@ declare namespace Deno { * ```ts * const encoder = new TextEncoder(); * const data = encoder.encode("Hello world"); - * const file = await Deno.open("/foo/bar.txt"); + * const file = await Deno.open("/foo/bar.txt", { write: true }); * const bytesWritten = await Deno.write(file.rid, data); // 11 * Deno.close(file.rid); * ``` @@ -1366,6 +1366,7 @@ declare namespace Deno { * points to. * * ```ts + * import { assert } from "https://deno.land/std/testing/asserts.ts"; * const fileInfo = await Deno.lstat("hello.txt"); * assert(fileInfo.isFile); * ``` @@ -1389,6 +1390,7 @@ declare namespace Deno { * follow symlinks. * * ```ts + * import { assert } from "https://deno.land/std/testing/asserts.ts"; * const fileInfo = await Deno.stat("hello.txt"); * assert(fileInfo.isFile); * ``` @@ -1400,6 +1402,7 @@ declare namespace Deno { * always follow symlinks. * * ```ts + * import { assert } from "https://deno.land/std/testing/asserts.ts"; * const fileInfo = Deno.statSync("hello.txt"); * assert(fileInfo.isFile); * ```