Skip to content

Commit 4cc17c9

Browse files
committed
更新标准库
1 parent 05aceda commit 4cc17c9

File tree

5 files changed

+25
-9
lines changed

5 files changed

+25
-9
lines changed

deno.lock

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { ConnInfo, serve_http, serve_https } from "./mod.ts";
2-
import {
3-
copy,
4-
writeAll,
5-
} from "https://deno.land/std@0.178.0/streams/conversion.ts";
2+
3+
import { copy } from "https://deno.land/std@0.178.0/streams/copy.ts";
4+
import { writeAll } from "https://deno.land/std@0.178.0/streams/write_all.ts";
65

76
export function upgrade(req: Request, connInfo: ConnInfo) {
87
const { socket, response } = Deno.upgradeWebSocket(req);

on_tcp_connection.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ export async function on_tcp_connection({
4343
httpConn.close();
4444
conn.close();
4545
} catch {
46-
/* (error) */// console.error(error);
46+
/* (error) */
47+
// console.error(error);
4748
}
4849
});
4950

serve_http.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ export async function serve_http(
5555
try {
5656
server.close();
5757
} catch {
58-
/* (error) */// console.error(error);
58+
/* (error) */
59+
// console.error(error);
5960
}
6061
}
6162
}

test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import {
2+
assert,
3+
assertEquals,
4+
} from "https://deno.land/std@0.178.0/testing/asserts.ts";
5+
16
import { handlers } from "./example.ts";
27
import { serve_http } from "./mod.ts";
3-
import { assert } from "https://deno.land/std@0.178.0/_util/assert.ts";
4-
5-
import { assertEquals } from "https://deno.land/std@0.178.0/testing/asserts.ts";
68

79
Deno.test("example-request", async () => {
810
const ac = new AbortController();

0 commit comments

Comments
 (0)