Comments (14)
Great! Thanks!
from regexparam.
Understood, just making sure.
I still have to investigate some dependents, but I just pushed the code (and way more tests) to #6
I have to step out for a little bit, but if you can verify that that PR behaves as expected, would be appreciated. Back soon 👍
from regexparam.
Everything in the Polka & Navaid worlds still work with this change :)
from regexparam.
Hey, I'll have to look at this carefully as this library is also the basis of Polka and a few other big projects. I think I can make a change without affecting anything too much (including performance), but may I ask why you're using results[0]
? It's generally always the [1]
result and onwards that are cared about, since those are the groups.
In that regard, there's no difference. Both are "clean" dashboard
value
from regexparam.
results[0]
is matched url. I use it in a few places in my project.
https://github.com/ReactTraining/react-router/blob/master/packages/react-router/modules/matchPath.js#L48
from regexparam.
Right, fair enough :) I will investigate and update here later tonight or tomorrow. I already have it working/solved locally, but I have to examine the impact & ensure nothing else is adversely affected
from regexparam.
Perhaps you knew this, but ptr doesn't always trim the trailing slash: https://codesandbox.io/s/thirsty-hopper-swxme
Just wanted to highlight that clarification while I was looking into behavioral differences
from regexparam.
I did not know. Though I don't see difference in your codesandbox. Did you save it?
from regexparam.
Oops, try now
from regexparam.
I see. I think this is ok. In my app there is usually only root trailing slash which is handled separately. But I'm good if it's easier for you to consider this case too.
from regexparam.
Do you need loose
mode? Without loose
, the trailing is always stripped.
from regexparam.
Yes, I use match only loosely. For example on page /dashboard
I open modal with item /dashboard/id
. And modal uses own matcher for this.
from regexparam.
Thanks Luke!
from regexparam.
No problem, thanks for checking it out :) Now live btw
from regexparam.
Related Issues (13)
- Make the library to loosly match at both ends of the URL HOT 3
- Matching URLs with search parameters HOT 1
- str.split is not a function at app.post HOT 1
- Publishing on Deno HOT 6
- Failed to minify when used in CRA HOT 3
- Wild token captures trailing extension (on accident?)
- Feature request: optional wildcards HOT 1
- Support for named wildcards HOT 1
- possible incorrect PURE annotation HOT 1
- Routes with trailing slashes should be parsed as different to routes without
- Typescript support HOT 1
- Regex Pattern Differs Between Versions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from regexparam.