Skip to content

Commit f73348c

Browse files
authored
refactor: use PropertyKey instaed of key list (oakserver#662)
1 parent f000a2f commit f73348c

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

application.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ interface RequestState {
338338
/** The base type of state which is associated with an application or
339339
* context. */
340340
// deno-lint-ignore no-explicit-any
341-
export type State = Record<string | number | symbol, any>;
341+
export type State = Record<PropertyKey, any>;
342342

343343
const ADDR_REGEXP = /^\[?([^\]]*)\]?:([0-9]{1,5})$/;
344344

middleware/etag.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { factory } from "./etag.ts";
1616

1717
function setup<
1818
// deno-lint-ignore no-explicit-any
19-
S extends Record<string | number | symbol, any> = Record<string, any>,
19+
S extends Record<PropertyKey, any> = Record<string, any>,
2020
>(
2121
path = "/",
2222
method = "GET",

router.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { errors, Status } from "./deps.ts";
1313
import { Router, RouterContext } from "./router.ts";
1414

1515
function createMockApp<
16-
S extends Record<string | number | symbol, any> = Record<string, any>,
16+
S extends Record<PropertyKey, any> = Record<string, any>,
1717
>(
1818
state = {} as S,
1919
): Application<S> {
@@ -27,7 +27,7 @@ function createMockApp<
2727
}
2828

2929
function createMockContext<
30-
S extends Record<string | number | symbol, any> = Record<string, any>,
30+
S extends Record<PropertyKey, any> = Record<string, any>,
3131
>(
3232
app: Application<S>,
3333
path = "/",
@@ -58,7 +58,7 @@ function createMockNext() {
5858
}
5959

6060
function setup<
61-
S extends Record<string | number | symbol, any> = Record<string, any>,
61+
S extends Record<PropertyKey, any> = Record<string, any>,
6262
>(
6363
path = "/",
6464
method = "GET",

send.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { isNode } from "./utils/type_guards.ts";
1616

1717
function setup<
1818
// deno-lint-ignore no-explicit-any
19-
S extends Record<string | number | symbol, any> = Record<string, any>,
19+
S extends Record<PropertyKey, any> = Record<string, any>,
2020
>(
2121
path = "/",
2222
method = "GET",

testing.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { Response } from "./response.ts";
2222

2323
/** Creates a mock of `Application`. */
2424
export function createMockApp<
25-
S extends Record<string | number | symbol, any> = Record<string, any>,
25+
S extends Record<PropertyKey, any> = Record<string, any>,
2626
>(
2727
state: S = {} as S,
2828
): Application<S> {

0 commit comments

Comments
 (0)