From 7bd2c2859453f8986eef90cbd433e50aa1ec763a Mon Sep 17 00:00:00 2001 From: Tyler <26290074+tylersayshi@users.noreply.github.com> Date: Wed, 20 Aug 2025 23:46:37 -0700 Subject: [PATCH] fixed failed test --- src/path-alias/path-alias.test.ts | 2 +- src/path-alias/path-alias.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/path-alias/path-alias.test.ts b/src/path-alias/path-alias.test.ts index 3e596df..a489d95 100644 --- a/src/path-alias/path-alias.test.ts +++ b/src/path-alias/path-alias.test.ts @@ -60,7 +60,7 @@ Deno.test("preserves .ts extensions in path aliases", async () => { await testFn("ts-extensions"); }); -Deno.test.only( +Deno.test( "resolves alias priority collision for @/* to src/*", async () => { await testFn("alias-priority-collision"); diff --git a/src/path-alias/path-alias.ts b/src/path-alias/path-alias.ts index d7cacfb..f8d1bc6 100644 --- a/src/path-alias/path-alias.ts +++ b/src/path-alias/path-alias.ts @@ -52,7 +52,8 @@ function resolvePathAlias( for (const target of targetArray) { // Create regex pattern for the alias - const aliasPattern = alias.replace("*", "([^/]+)"); + // Make "*" match across path segments (TS path alias wildcard matches slashes) + const aliasPattern = alias.replace("*", "(.+)"); const regex = new RegExp(`^${aliasPattern}$`); if (regex.test(importPath)) { -- 2.51.2