diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df685aff..719378eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,8 @@ jobs: strategy: matrix: - deno: ["v1.x", "canary"] + # FIXME: temporarially disabled 1.x until https://github.com/denoland/deno/commit/64e072e499d36ca824db297a493667415ed67cdf is released + deno: ["canary"] os: [macOS-latest, windows-latest, ubuntu-latest] steps: diff --git a/deno.json b/deno.json index 7eecd243..d71f9076 100644 --- a/deno.json +++ b/deno.json @@ -12,8 +12,6 @@ "jsxImportSource": "preact" }, "test": { - "files": { - "exclude": ["www/"] - } + "exclude": ["www/"] } } diff --git a/src/server/bundle.ts b/src/server/bundle.ts index 2c3a0213..7cfe71c5 100644 --- a/src/server/bundle.ts +++ b/src/server/bundle.ts @@ -11,6 +11,7 @@ export interface JSXConfig { let esbuildInitialized: boolean | Promise = false; async function ensureEsbuildInitialized() { if (esbuildInitialized === false) { + // deno-lint-ignore no-deprecated-deno-api if (Deno.run === undefined) { const wasmURL = new URL("./esbuild_v0.17.11.wasm", import.meta.url).href; esbuildInitialized = fetch(wasmURL).then(async (r) => { diff --git a/src/server/deps.ts b/src/server/deps.ts index 427b2c97..d5182e68 100644 --- a/src/server/deps.ts +++ b/src/server/deps.ts @@ -21,6 +21,7 @@ export { import * as esbuildWasm from "https://deno.land/x/esbuild@v0.17.11/wasm.js"; import * as esbuildNative from "https://deno.land/x/esbuild@v0.17.11/mod.js"; // @ts-ignore trust me +// deno-lint-ignore no-deprecated-deno-api const esbuild: typeof esbuildWasm = Deno.run === undefined ? esbuildWasm : esbuildNative; diff --git a/src/server/router.ts b/src/server/router.ts index b0aa1eec..24a7f15d 100644 --- a/src/server/router.ts +++ b/src/server/router.ts @@ -146,10 +146,15 @@ export function router( const res = route.pattern.exec(req.url); if (res !== null) { - const groups = res?.pathname.groups ?? {}; + const groups: Record = {}; + const matched = res?.pathname.groups; - for (const key in groups) { - groups[key] = decodeURIComponent(groups[key]); + for (const key in matched) { + const value = matched[key]; + + if (value !== undefined) { + groups[key] = decodeURIComponent(value); + } } for (const [method, handler] of Object.entries(route.methods)) { diff --git a/tests/fixture/polyfill_deno_deploy.ts b/tests/fixture/polyfill_deno_deploy.ts index c56adf82..73380028 100644 --- a/tests/fixture/polyfill_deno_deploy.ts +++ b/tests/fixture/polyfill_deno_deploy.ts @@ -1,4 +1,5 @@ // Simulate Deno Deploy environment //@ts-ignore: Remove Deno.run for simulating deno deploy env +// deno-lint-ignore no-deprecated-deno-api delete Deno.run;