diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/console.ts | 4 | ||||
-rw-r--r-- | js/dir.ts | 10 | ||||
-rw-r--r-- | js/files.ts | 24 | ||||
-rw-r--r-- | js/metrics.ts | 20 |
4 files changed, 29 insertions, 29 deletions
diff --git a/js/console.ts b/js/console.ts index ec7238cb9..10be30ace 100644 --- a/js/console.ts +++ b/js/console.ts @@ -733,8 +733,8 @@ export class Console { } /** - * inspect() converts input into string that has the same format - * as printed by console.log(...); + * `inspect()` converts input into string that has the same format + * as printed by `console.log(...)`; */ export function inspect(value: unknown, options?: ConsoleOptions): string { const opts = options || {}; @@ -5,11 +5,11 @@ import * as flatbuffers from "./flatbuffers"; import { sendSync } from "./dispatch"; /** - * cwd() Return a string representing the current working directory. + * `cwd()` Return a string representing the current working directory. * If the current directory can be reached via multiple paths - * (due to symbolic links), cwd() may return + * (due to symbolic links), `cwd()` may return * any one of them. - * throws NotFound exception if directory not available + * throws `NotFound` exception if directory not available */ export function cwd(): string { const builder = flatbuffers.createBuilder(); @@ -24,8 +24,8 @@ export function cwd(): string { } /** - * chdir() Change the current working directory to path. - * throws NotFound exception if directory not available + * `chdir()` Change the current working directory to path. + * throws `NotFound` exception if directory not available */ export function chdir(directory: string): void { const builder = flatbuffers.createBuilder(); diff --git a/js/files.ts b/js/files.ts index 3a0297566..4c1292bd7 100644 --- a/js/files.ts +++ b/js/files.ts @@ -84,10 +84,10 @@ function resRead(baseRes: null | msg.Base): ReadResult { * * Return `ReadResult` for the operation. * - * const file = Deno.openSync("/foo/bar.txt"); - * const buf = new Uint8Array(100); - * const { nread, eof } = Deno.readSync(file.rid, buf); - * const text = new TextDecoder.decode(buf); + * const file = Deno.openSync("/foo/bar.txt"); + * const buf = new Uint8Array(100); + * const { nread, eof } = Deno.readSync(file.rid, buf); + * const text = new TextDecoder.decode(buf); * */ export function readSync(rid: number, p: Uint8Array): ReadResult { @@ -98,12 +98,12 @@ export function readSync(rid: number, p: Uint8Array): ReadResult { * * Resolves with the `ReadResult` for the operation. * - * (async () => { + * (async () => { * const file = await Deno.open("/foo/bar.txt"); * const buf = new Uint8Array(100); * const { nread, eof } = await Deno.read(file.rid, buf); * const text = new TextDecoder.decode(buf); - * })(); + * })(); */ export async function read(rid: number, p: Uint8Array): Promise<ReadResult> { return resRead(await dispatch.sendAsync(...reqRead(rid, p))); @@ -145,12 +145,12 @@ export function writeSync(rid: number, p: Uint8Array): number { * * Resolves with the number of bytes written. * - * (async () => { + * (async () => { * const encoder = new TextEncoder(); * const data = encoder.encode("Hello world\n"); * const file = await Deno.open("/foo/bar.txt"); * await Deno.write(file.rid, data); - * })(); + * })(); * */ export async function write(rid: number, p: Uint8Array): Promise<number> { @@ -173,8 +173,8 @@ function reqSeek( /** Seek a file ID synchronously to the given offset under mode given by `whence`. * - * const file = Deno.openSync("/foo/bar.txt"); - * Deno.seekSync(file.rid, 0, 0); + * const file = Deno.openSync("/foo/bar.txt"); + * Deno.seekSync(file.rid, 0, 0); */ export function seekSync(rid: number, offset: number, whence: SeekMode): void { dispatch.sendSync(...reqSeek(rid, offset, whence)); @@ -182,10 +182,10 @@ export function seekSync(rid: number, offset: number, whence: SeekMode): void { /** Seek a file ID to the given offset under mode given by `whence`. * - * (async () => { + * (async () => { * const file = await Deno.open("/foo/bar.txt"); * await Deno.seek(file.rid, 0, 0); - * })(); + * })(); */ export async function seek( rid: number, diff --git a/js/metrics.ts b/js/metrics.ts index f00c1308d..503d0e0e6 100644 --- a/js/metrics.ts +++ b/js/metrics.ts @@ -36,16 +36,16 @@ function res(baseRes: null | msg.Base): Metrics { /** Receive metrics from the privileged side of Deno. * - * > console.table(Deno.metrics()) - * ┌──────────────────┬────────┐ - * │ (index) │ Values │ - * ├──────────────────┼────────┤ - * │ opsDispatched │ 9 │ - * │ opsCompleted │ 9 │ - * │ bytesSentControl │ 504 │ - * │ bytesSentData │ 0 │ - * │ bytesReceived │ 856 │ - * └──────────────────┴────────┘ + * > console.table(Deno.metrics()) + * ┌──────────────────┬────────┐ + * │ (index) │ Values │ + * ├──────────────────┼────────┤ + * │ opsDispatched │ 9 │ + * │ opsCompleted │ 9 │ + * │ bytesSentControl │ 504 │ + * │ bytesSentData │ 0 │ + * │ bytesReceived │ 856 │ + * └──────────────────┴────────┘ */ export function metrics(): Metrics { return res(dispatch.sendSync(...req())); |