Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
keroxp authored Mar 16, 2021
1 parent 9975df2 commit 860bf16
Show file tree
Hide file tree
Showing 29 changed files with 39 additions and 32 deletions.
2 changes: 1 addition & 1 deletion _readers_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { streamReader } from "./_readers.ts";
import { assertEquals } from "./vendor/https/deno.land/std/testing/asserts.ts";
import { group } from "./_test_util.ts";
import { decode, encode } from "./vendor/https/deno.land/std/encoding/utf8.ts";
import { decode, encode } from "./_util.ts";

group("streamReader", ({ test }) => {
test("basic", async () => {
Expand Down
2 changes: 1 addition & 1 deletion _test_util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from "./vendor/https/deno.land/std/testing/asserts.ts";
import { RoutingError } from "./error.ts";
import { createRecorder } from "./testing.ts";
import { encode } from "./vendor/https/deno.land/std/encoding/utf8.ts";
import { encode } from "./_util.ts";
import { green, red } from "./vendor/https/deno.land/std/fmt/colors.ts";
import { STATUS_TEXT } from "./vendor/https/deno.land/std/http/http_status.ts";

Expand Down
11 changes: 11 additions & 0 deletions _util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,14 @@ export function promiseInterrupter({
}
});
}

const decoder = new TextDecoder();
const encoder = new TextEncoder();

export function decode(bin?: BufferSource): string {
return decoder.decode(bin);
}

export function encode(s?: string): Uint8Array {
return encoder.encode(s);
}
2 changes: 1 addition & 1 deletion agent_test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2019-2020 Yusuke Sakurai. All rights reserved. MIT license.
import { encode } from "./vendor/https/deno.land/std/encoding/utf8.ts";
import { encode } from "./_util.ts";
import { createAgent } from "./agent.ts";
import { createApp } from "./app.ts";
import {
Expand Down
4 changes: 2 additions & 2 deletions body_parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import {
MultipartFormData,
MultipartReader,
} from "./vendor/https/deno.land/std/mime/multipart.ts";
import Reader = Deno.Reader;
import { decode } from "./vendor/https/deno.land/std/encoding/utf8.ts";
import { decode } from "./_util.ts";

import Reader = Deno.Reader;
export interface BodyParser {
text(): Promise<string>;
json(): Promise<any>;
Expand Down
3 changes: 1 addition & 2 deletions modules-lock.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"https://deno.land/std": {
"version": "@0.87.0",
"version": "@0.90.0",
"modules": [
"/testing/asserts.ts",
"/textproto/mod.ts",
Expand All @@ -13,7 +13,6 @@
"/io/writers.ts",
"/http/_io.ts",
"/http/http_status.ts",
"/encoding/utf8.ts",
"/flags/mod.ts",
"/fmt/printf.ts",
"/fmt/colors.ts",
Expand Down
3 changes: 1 addition & 2 deletions modules.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"https://deno.land/std": {
"version": "@0.87.0",
"version": "@0.90.0",
"modules": [
"/testing/asserts.ts",
"/textproto/mod.ts",
Expand All @@ -13,7 +13,6 @@
"/io/writers.ts",
"/http/_io.ts",
"/http/http_status.ts",
"/encoding/utf8.ts",
"/flags/mod.ts",
"/fmt/printf.ts",
"/fmt/colors.ts",
Expand Down
3 changes: 1 addition & 2 deletions serveio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { BufReader, BufWriter } from "./vendor/https/deno.land/std/io/bufio.ts";
import { TextProtoReader } from "./vendor/https/deno.land/std/textproto/mod.ts";
import { closableBodyReader, streamReader, timeoutReader } from "./_readers.ts";
import { promiseInterrupter } from "./_util.ts";
import { encode, promiseInterrupter } from "./_util.ts";
import {
assert,
AssertionError,
Expand All @@ -17,7 +17,6 @@ import {
ServeOptions,
ServerResponse,
} from "./server.ts";
import { encode } from "./vendor/https/deno.land/std/encoding/utf8.ts";
import Reader = Deno.Reader;
import Writer = Deno.Writer;
import Buffer = Deno.Buffer;
Expand Down
2 changes: 1 addition & 1 deletion serveio_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from "./serveio.ts";
import { assertEquals } from "./vendor/https/deno.land/std/testing/asserts.ts";
import { StringReader } from "./vendor/https/deno.land/std/io/readers.ts";
import { encode } from "./vendor/https/deno.land/std/encoding/utf8.ts";
import { encode } from "./_util.ts";
import Buffer = Deno.Buffer;
import copy = Deno.copy;
import { ServerResponse } from "./server.ts";
Expand Down
2 changes: 1 addition & 1 deletion server_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
assertEquals,
assertThrowsAsync,
} from "./vendor/https/deno.land/std/testing/asserts.ts";
import { encode } from "./vendor/https/deno.land/std/encoding/utf8.ts";
import { encode } from "./_util.ts";
import { createAgent } from "./agent.ts";
import { readResponse, writeRequest } from "./serveio.ts";
import { BufReader } from "./vendor/https/deno.land/std/io/bufio.ts";
Expand Down
2 changes: 1 addition & 1 deletion vendor/https/deno.land/std/async/mod.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "https://deno.land/std@0.87.0/async/mod.ts";
export * from "https://deno.land/std@0.90.0/async/mod.ts";
2 changes: 1 addition & 1 deletion vendor/https/deno.land/std/datetime/mod.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "https://deno.land/std@0.87.0/datetime/mod.ts";
export * from "https://deno.land/std@0.90.0/datetime/mod.ts";
1 change: 0 additions & 1 deletion vendor/https/deno.land/std/encoding/utf8.ts

This file was deleted.

2 changes: 1 addition & 1 deletion vendor/https/deno.land/std/flags/mod.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "https://deno.land/std@0.87.0/flags/mod.ts";
export * from "https://deno.land/std@0.90.0/flags/mod.ts";
2 changes: 1 addition & 1 deletion vendor/https/deno.land/std/fmt/colors.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "https://deno.land/std@0.87.0/fmt/colors.ts";
export * from "https://deno.land/std@0.90.0/fmt/colors.ts";
2 changes: 1 addition & 1 deletion vendor/https/deno.land/std/fmt/printf.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "https://deno.land/std@0.87.0/fmt/printf.ts";
export * from "https://deno.land/std@0.90.0/fmt/printf.ts";
2 changes: 1 addition & 1 deletion vendor/https/deno.land/std/fs/exists.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "https://deno.land/std@0.87.0/fs/exists.ts";
export * from "https://deno.land/std@0.90.0/fs/exists.ts";
2 changes: 1 addition & 1 deletion vendor/https/deno.land/std/fs/expand_glob.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "https://deno.land/std@0.87.0/fs/expand_glob.ts";
export * from "https://deno.land/std@0.90.0/fs/expand_glob.ts";
2 changes: 1 addition & 1 deletion vendor/https/deno.land/std/hash/sha1.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "https://deno.land/std@0.87.0/hash/sha1.ts";
export * from "https://deno.land/std@0.90.0/hash/sha1.ts";
2 changes: 1 addition & 1 deletion vendor/https/deno.land/std/http/_io.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "https://deno.land/std@0.87.0/http/_io.ts";
export * from "https://deno.land/std@0.90.0/http/_io.ts";
2 changes: 1 addition & 1 deletion vendor/https/deno.land/std/http/http_status.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "https://deno.land/std@0.87.0/http/http_status.ts";
export * from "https://deno.land/std@0.90.0/http/http_status.ts";
2 changes: 1 addition & 1 deletion vendor/https/deno.land/std/io/bufio.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "https://deno.land/std@0.87.0/io/bufio.ts";
export * from "https://deno.land/std@0.90.0/io/bufio.ts";
2 changes: 1 addition & 1 deletion vendor/https/deno.land/std/io/readers.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "https://deno.land/std@0.87.0/io/readers.ts";
export * from "https://deno.land/std@0.90.0/io/readers.ts";
2 changes: 1 addition & 1 deletion vendor/https/deno.land/std/io/writers.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "https://deno.land/std@0.87.0/io/writers.ts";
export * from "https://deno.land/std@0.90.0/io/writers.ts";
2 changes: 1 addition & 1 deletion vendor/https/deno.land/std/mime/multipart.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "https://deno.land/std@0.87.0/mime/multipart.ts";
export * from "https://deno.land/std@0.90.0/mime/multipart.ts";
2 changes: 1 addition & 1 deletion vendor/https/deno.land/std/path/mod.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "https://deno.land/std@0.87.0/path/mod.ts";
export * from "https://deno.land/std@0.90.0/path/mod.ts";
2 changes: 1 addition & 1 deletion vendor/https/deno.land/std/testing/asserts.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "https://deno.land/std@0.87.0/testing/asserts.ts";
export * from "https://deno.land/std@0.90.0/testing/asserts.ts";
2 changes: 1 addition & 1 deletion vendor/https/deno.land/std/textproto/mod.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "https://deno.land/std@0.87.0/textproto/mod.ts";
export * from "https://deno.land/std@0.90.0/textproto/mod.ts";
2 changes: 1 addition & 1 deletion vendor/https/deno.land/std/ws/mod.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "https://deno.land/std@0.87.0/ws/mod.ts";
export * from "https://deno.land/std@0.90.0/ws/mod.ts";

0 comments on commit 860bf16

Please sign in to comment.