From e7a2c909acbd24d31f146dbcbeb78ce7691769dd Mon Sep 17 00:00:00 2001 From: "neal.wang" Date: Wed, 15 Apr 2020 11:41:58 +0100 Subject: [PATCH 1/2] =?UTF-8?q?=E7=BF=BB=E8=AF=91=EF=BC=9ADeno.connect?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib.deno.ns.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib.deno.ns.d.ts b/lib.deno.ns.d.ts index 4e521a72..21bd0453 100644 --- a/lib.deno.ns.d.ts +++ b/lib.deno.ns.d.ts @@ -1973,8 +1973,7 @@ declare namespace Deno { } /** - * Connects to the hostname (default is "127.0.0.1") and port on the named - * transport (default is "tcp"), and resolves to the connection (`Conn`). + * 通过指定传输协议(默认tcp)连接主机名和端口号,并异步返回一个连接。 * * const conn1 = await Deno.connect({ port: 80 }); * const conn2 = await Deno.connect({ hostname: "192.0.2.1", port: 80 }); @@ -1982,7 +1981,8 @@ declare namespace Deno { * const conn4 = await Deno.connect({ hostname: "golang.org", port: 80, transport: "tcp" }); * const conn5 = await Deno.connect({ address: "/foo/bar.sock", transport: "unix" }); * - * Requires `allow-net` permission for "tcp" and `allow-read` for unix. */ + * tcp需要 `allow-net` 权限,unix需要 `allow-read` 权限。 + * */ export function connect( options: ConnectOptions | UnixConnectOptions ): Promise; From 2e91e3111a4d1c27f22d4be563d313c73fc43af3 Mon Sep 17 00:00:00 2001 From: sl2782087 Date: Wed, 15 Apr 2020 20:39:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=BF=BB=E8=AF=91=EF=BC=9ADeno.connect?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A1=A5=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib.deno.ns.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib.deno.ns.d.ts b/lib.deno.ns.d.ts index 21bd0453..8c2ae46f 100644 --- a/lib.deno.ns.d.ts +++ b/lib.deno.ns.d.ts @@ -1973,7 +1973,7 @@ declare namespace Deno { } /** - * 通过指定传输协议(默认tcp)连接主机名和端口号,并异步返回一个连接。 + * 通过指定传输协议(默认 "tcp")连接主机名(默认 "127.0.0.1")和端口号,并异步返回这个连接(`Conn`)。 * * const conn1 = await Deno.connect({ port: 80 }); * const conn2 = await Deno.connect({ hostname: "192.0.2.1", port: 80 }); @@ -1981,7 +1981,7 @@ declare namespace Deno { * const conn4 = await Deno.connect({ hostname: "golang.org", port: 80, transport: "tcp" }); * const conn5 = await Deno.connect({ address: "/foo/bar.sock", transport: "unix" }); * - * tcp需要 `allow-net` 权限,unix需要 `allow-read` 权限。 + * "tcp" 需要 `allow-net` 权限,unix 需要 `allow-read` 权限。 * */ export function connect( options: ConnectOptions | UnixConnectOptions