Skip to content

Commit 689526a

Browse files
committed
refactor(utils): use external
1 parent ca7709b commit 689526a

3 files changed

Lines changed: 3 additions & 14 deletions

File tree

deps.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export {
77
} from "https://deno.land/x/isx@1.0.0-beta.24/mod.ts";
88
export { concatPath } from "https://deno.land/x/url_concat@1.0.0-beta.1/mod.ts";
99
export { chain } from "https://deno.land/x/chain_handler@1.1.0/mod.ts";
10+
export { Method } from "https://deno.land/x/http_utils@1.0.0-beta.7/method.ts";
1011

1112
type ParamKeyName<NameWithPattern> = NameWithPattern extends
1213
`${infer Name}{${infer _}` ? Name

router.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
concatPath,
77
isFunction,
88
isString,
9+
Method,
910
type ParseUrlParams,
1011
} from "./deps.ts";
1112
import type {
@@ -16,7 +17,7 @@ import type {
1617
Middleware,
1718
Params,
1819
} from "./types.ts";
19-
import { assert, matchMethod, Method } from "./utils.ts";
20+
import { assert, matchMethod } from "./utils.ts";
2021

2122
/** Context of `params`. */
2223
export interface ParamsContext<T extends string = string> {

utils.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,6 @@ export function assert(
1010
}
1111
}
1212

13-
/** HTTP request method enum. */
14-
export const enum Method {
15-
Get = "GET",
16-
Head = "HEAD",
17-
Post = "POST",
18-
Put = "PUT",
19-
Delete = "DELETE",
20-
Connect = "CONNECT",
21-
Options = "OPTIONS",
22-
Trace = "TRACE",
23-
Patch = "PATCH",
24-
}
25-
2613
export function matchMethod(
2714
candidates: readonly string[],
2815
method: string,

0 commit comments

Comments
 (0)