From 8e21f32be97f32d0c459d3aa1d0041ed98a96a5c Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Wed, 6 Mar 2024 08:50:46 +1100 Subject: [PATCH] fix: polyfill URLPattern under Bun --- deno.json | 2 +- http_server_bun.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/deno.json b/deno.json index aafaa17..c01d8d3 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "@oak/acorn", - "version": "0.5.0", + "version": "0.5.1-alpha.1", "exports": { ".": "./mod.ts", "./context": "./context.ts", diff --git a/http_server_bun.ts b/http_server_bun.ts index c7a23e3..a9ee229 100644 --- a/http_server_bun.ts +++ b/http_server_bun.ts @@ -17,6 +17,10 @@ import type { } from "./types_internal.ts"; import { createPromiseWithResolvers } from "./util.ts"; +if (!("URLPattern" in globalThis)) { + await import("npm:urlpattern-polyfill"); +} + type TypedArray = | Uint8Array | Uint16Array