Skip to content

Commit

Permalink
Add URLPattern (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-sherman authored May 21, 2022
1 parent 98b9d69 commit b4c448c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
16 changes: 14 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
"dotenv": "^10.0.0",
"kleur": "^4.1.4",
"set-cookie-parser": "^2.4.8",
"undici": "4.13.0"
"undici": "4.13.0",
"urlpattern-polyfill": "^4.0.3"
},
"devDependencies": {
"@miniflare/durable-objects": "2.4.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/plugins/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import {
} from "../standards";
import { assertsInRequest } from "../standards/helpers";
import type { BindingsOptions } from "./bindings";
import { URLPattern } from "urlpattern-polyfill";

const DEFAULT_MODULE_RULES: ModuleRule[] = [
{ type: "ESModule", include: ["**/*.mjs"] },
Expand Down Expand Up @@ -416,6 +417,7 @@ export class CorePlugin extends Plugin<CoreOptions> implements CoreOptions {
File,
URL,
URLSearchParams,
URLPattern,

ByteLengthQueuingStrategy,
CountQueuingStrategy,
Expand Down
1 change: 1 addition & 0 deletions packages/core/test/plugins/core.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ test("CorePlugin: setup: includes web standards", async (t) => {
t.true(typeof globals.File === "function");
t.true(typeof globals.URL === "function");
t.true(typeof globals.URLSearchParams === "function");
t.true(typeof globals.URLPattern === "function");

t.true(typeof globals.ByteLengthQueuingStrategy === "function");
t.true(typeof globals.CountQueuingStrategy === "function");
Expand Down

0 comments on commit b4c448c

Please sign in to comment.