Skip to content

Commit 7f020e2

Browse files
committed
types
Signed-off-by: flakey5 <[email protected]>
1 parent 49e5eb7 commit 7f020e2

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

src/routes/router.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ function buildMiddlewareChain(middlewares: Middleware[]): MiddlewareChain {
6666
};
6767

6868
// Link the middlewares in reverse order for simplicity sakes
69-
// @ts-expect-error TODO: update types so toReversed is recognized
7069
for (const middleware of middlewares.toReversed()) {
7170
const wrappedMiddleware = errorHandled(middleware);
7271

@@ -89,7 +88,9 @@ async function callMiddlewareChain(
8988
ctx: Context
9089
): Promise<Response> {
9190
// Parse url here so we don't have to do it multiple times later on
92-
const url = parseUrl(request);
91+
// TODO why isn't `parse` recognized
92+
const url = URL.parse(request);
93+
9394
if (url === undefined) {
9495
return responses.badRequest();
9596
}

src/utils/directoryListing.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,9 @@ type TableElement = {
5252

5353
function renderSubdirectory(name: string): TableElement {
5454
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_code_points_and_grapheme_clusters
55-
// @ts-expect-error isWellFormed not recognized
56-
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
5755
const wellFormedName: string = name.isWellFormed()
5856
? name
59-
: // @ts-expect-error toWellFormed not recognized
60-
name.toWellFormed();
57+
: name.toWellFormed();
6158

6259
const href = encodeURIComponent(
6360
wellFormedName.substring(0, wellFormedName.length - 1)

tsconfig.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"compilerOptions": {
3-
"target": "es2021",
4-
"lib": ["es2021", "es2022"],
3+
"target": "esnext",
4+
"lib": ["esnext"],
55
"module": "esnext",
66
"moduleResolution": "Bundler",
7-
"types": ["@cloudflare/workers-types"],
7+
"types": ["@cloudflare/workers-types/2023-07-01"],
88
"resolveJsonModule": true,
99
"allowJs": true,
1010
"checkJs": false,

0 commit comments

Comments
 (0)