question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: query-string strip (`pick`, `exclude`)

See original GitHub issue

To eliminate unneeded params, preserve only needed

queryString.strip('http://example.com/?a=1&b=2', [ 'a' ] )
// result : http://example.com/?a=1

It would be helpful when page has many redudant params (like statistic params) and want to get a cleaner one


Better function names from @Uzlopak:

queryString.pick('http://example.com/?a=1&b=2', [ 'a' ] )
// result : http://example.com/?a=1


queryString.exclude('http://example.com/?a=1&b=2', [ 'a' ] )
// result : http://example.com/?b=2

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Uzlopakcommented, May 11, 2020

The python strip equivalent in javacscript would be trim

0reactions
sindresorhuscommented, Sep 29, 2020

If anyone wants to work on this, see the initial attempt and feedback in https://github.com/sindresorhus/query-string/pull/261.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Exclude URL Query Parameters in Google Analytics
Under Admin > View Settings > Exclude Query Parameters, list the query parameters that you want to exclude from your page paths. This...
Read more >
How to Exclude Query String Parameters from Google ... - Elevar
Option 1: Create Filter to Exclude All Query Parameters. This is done through a Search and Replace filter that you can set on...
Read more >
How to Exclude URL Query Parameters in Google Analytics
Also, remember that search query parameters are case sensitive. Step-3: Select the checkbox 'Strip query parameters out of URL':.
Read more >
Efficient removing of QueryString parameters #23971 - GitHub
I'm currently working on pull request microsoft/reverse-proxy#301 for YARP to add support for transforming query parameters on the incoming ...
Read more >
Remove querystring from URL - javascript - Stack Overflow
An easy way to get this is: function getPathFromUrl(url) { return url.split("?")[0]; }. For those who also wish to remove the hash (not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found