Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional utils: keepQuery and withoutQuery #230

Open
1 task done
fmoessle opened this issue Apr 5, 2024 · 1 comment
Open
1 task done

Additional utils: keepQuery and withoutQuery #230

fmoessle opened this issue Apr 5, 2024 · 1 comment

Comments

@fmoessle
Copy link

fmoessle commented Apr 5, 2024

Describe the feature

keepQuery(input: string, keep string | string[])
Removes all queries not specified in parameter keep

Example:
keepQuery('/path?foo=a&bar=b', 'bar') // "/path?bar=b"

and

withoutQuery(input: string, without string | string[])
Keeps all queries other than specified in parameter without

Example:
withoutQuery('/path?foo=a&bar=c', 'bar') // "/path?foo=a"

Additional information

  • Would you be willing to help implement this feature?
@pi0
Copy link
Member

pi0 commented Apr 8, 2024

Hi thanks for idea. I think we can aggregate both to something like filterQuery(input, fn) wdyt?

But also can you please explain when you think this feature would benefit a share usecase for projects?

@pi0 pi0 added the discussion label Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants