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

searchParams is not available (though query is) #162

Open
prabashn opened this issue Nov 7, 2018 · 2 comments
Open

searchParams is not available (though query is) #162

prabashn opened this issue Nov 7, 2018 · 2 comments

Comments

@prabashn
Copy link

prabashn commented Nov 7, 2018

Per Mozilla docs, searchParams should contain the parsed query params.
https://developer.mozilla.org/en-US/docs/Web/API/URL/searchParams.

But url-parse does not support this.

@lpinca
Copy link
Member

lpinca commented Nov 7, 2018

This module was conceived to be compatible with the legacy Node.js URL parser: https://nodejs.org/api/url.html#url_legacy_urlobject.

> url.parse('http://example.com/?foo=bar', true)
Url {
  protocol: 'http:',
  slashes: true,
  auth: null,
  host: 'example.com',
  port: null,
  hostname: 'example.com',
  hash: null,
  search: '?foo=bar',
  query: { foo: 'bar' },
  pathname: '/',
  path: '/?foo=bar',
  href: 'http://example.com/?foo=bar' }

@worc
Copy link

worc commented Mar 4, 2020

an alias here would make a lot of sense. it's a module that can be used in the front end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants