tighten / ziggy

Use your Laravel routes in JavaScript.
MIT License
3.86k stars 247 forks source link

Fix empty root URL with `absolute: false` #667

Closed bakerkretzmar closed 12 months ago

bakerkretzmar commented 12 months ago

Fixes #666. Wanted to use a Regex lookbehind but support for them was only added to Safari several months ago and that's cutting it a bit close I think. That being said, the strings Ziggy works with are so short that we probably don't need to worry about performance at all, so we could probably lean on advanced Regex functionality more...

Tofandel commented 11 months ago

@bakerkretzmar I think instead of the lookbehind you could have just applied the regex only to this.definition.uri

bakerkretzmar commented 11 months ago

Hmm yeah that's true, although that'll leave a trailing slash on a 'home' route with no path, if there is one.