Skip to content

Commit

Permalink
Comment
Browse files Browse the repository at this point in the history
  • Loading branch information
bakerkretzmar committed May 16, 2024
1 parent 6f88d0c commit 39a13c6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/js/Route.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ export default class Route {

if (!segments.length) return this.template;

// This should probably be refactored to build the host and path separately (not the entire URL at once)
// because that's how Laravel does it internally and it's more precise and less error-prone
return this.template
.replace(/{([^}?]+)(\??)}/g, (_, segment, optional) => {
// If the parameter is missing but is not optional, throw an error
Expand Down

0 comments on commit 39a13c6

Please sign in to comment.