Generalise builder methods so they accept "AnyUrl" as a parameter - #12
Open
clintonmead wants to merge 3 commits into
Open
Generalise builder methods so they accept "AnyUrl" as a parameter#12clintonmead wants to merge 3 commits into
clintonmead wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Using
</>to build anAnyUrlwas annoying because unlike many of the functions inDormouse.Clientwhich are generalised overIsUrl,</>and?where not.Doing so has required adding an additional method to the
IsUrlclass calledmapIsUrl, so this according to the PVP spec requires a major version bump, hence the move to 0.4.0.0, although I do doubt any users are actually defining their ownIsUrlinstances.I've also added a generalised printing method
isUrlAsBSwhich works on instances of theIsUrlclass also, and a simple utility function to split out the scheme and components into a tuple.p.s. This seems like a really well designed library. I hopped around a few URL libraries before finding this one, I found
modern-uriwhilst extensive was also too general without type constraints (resulting in various runtime checks at call sites) whereas withreqlike you said the ports being a separate type instead of part of the URL is weird and it didn't really have a inbuilt "print" method that included the port, and also the data type was quite opaque. Finally I stumbled into this and it for the moment (after a day of usage) fits the bill perfectly, so thanks for taking the time to write this.