Code Monkey home page Code Monkey logo

Comments (14)

TrySound avatar TrySound commented on July 28, 2024 1

Great! Thanks!

from regexparam.

lukeed avatar lukeed commented on July 28, 2024 1

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.

lukeed avatar lukeed commented on July 28, 2024 1

Everything in the Polka & Navaid worlds still work with this change :)

from regexparam.

lukeed avatar lukeed commented on July 28, 2024

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.

TrySound avatar TrySound commented on July 28, 2024

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.

lukeed avatar lukeed commented on July 28, 2024

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.

lukeed avatar lukeed commented on July 28, 2024

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.

TrySound avatar TrySound commented on July 28, 2024

I did not know. Though I don't see difference in your codesandbox. Did you save it?

from regexparam.

lukeed avatar lukeed commented on July 28, 2024

Oops, try now

from regexparam.

TrySound avatar TrySound commented on July 28, 2024

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.

lukeed avatar lukeed commented on July 28, 2024

Do you need loose mode? Without loose, the trailing is always stripped.

from regexparam.

TrySound avatar TrySound commented on July 28, 2024

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.

TrySound avatar TrySound commented on July 28, 2024

Thanks Luke!

from regexparam.

lukeed avatar lukeed commented on July 28, 2024

No problem, thanks for checking it out :) Now live btw

from regexparam.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.