Skip to content

Conversation

@webJose
Copy link
Contributor

@webJose webJose commented Nov 27, 2025

Closes #130.

@webJose webJose requested a review from Copilot November 27, 2025 06:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies the RouteInfo type by consolidating the previously separate RegexRouteInfo and PatternRouteInfo types into a single unified type. The path property now accepts either a string pattern or a RegExp, eliminating the need for separate pattern and regex properties.

Key changes:

  • Unified RouteInfo type with a single path property that accepts string | RegExp
  • Removed the CoreRouteInfo, RegexRouteInfo, and PatternRouteInfo types
  • Updated all usages throughout the codebase from pattern/regex to path

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/lib/types.ts Consolidated route type definitions into a single RouteInfo type with path property
src/lib/kernel/RouterEngine.svelte.ts Simplified route pattern parsing logic and removed regex type guard
src/lib/kernel/RouteHelper.svelte.ts Updated parseRoutePattern to handle unified path property with type checking
src/lib/Route/Route.svelte Simplified route registration to use unified object structure
src/lib/kernel/RouterEngine.svelte.test.ts Updated test cases to use path property instead of pattern
src/lib/kernel/RouteHelper.svelte.test.ts Updated test cases to use path property instead of pattern
src/lib/Route/Route.svelte.test.ts Updated test cases and type annotations for the new type structure
src/lib/Redirector.svelte.test.ts Updated test cases to use path property instead of pattern

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@webJose webJose merged commit b8bfc37 into main Nov 27, 2025
1 check passed
@webJose webJose deleted the JP/redirection branch November 27, 2025 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bring pattern and regex properties in redirections together as path

2 participants