feat(url): add parse subcommand to parse URLs into components#24
Merged
ksdme merged 3 commits intoksdme:mainfrom Dec 26, 2025
Merged
feat(url): add parse subcommand to parse URLs into components#24ksdme merged 3 commits intoksdme:mainfrom
ksdme merged 3 commits intoksdme:mainfrom
Conversation
Add URL parsing feature that extracts scheme, host, port, path, query, fragment, username, and password from URLs. Query parameters are also parsed into key-value pairs.
When a URL has duplicate query parameter keys like `?a=1&a=2&b=3`, values are now grouped by key: - Single value: returns string `"b": "3"` - Multiple values: returns array `"a": ["1", "2"]`
Owner
|
Thanks @am2rican5 for the contribution. I had made some changes on top for consistency. Most notably, the query params are also pretty printed now. But, I have added a So, the following should still work :) |
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.
Summary
url parsesubcommand that parses URLs into their components (scheme, host, port, path, query, fragment, username, password)?a=1&a=2→{"a": ["1", "2"]})Usage
ut url parse "https://example.com:8080/path?key=value#section"