-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
URL() constructor #117
Comments
Thanks for proposal, I will think about it. |
I think, it's possible to add minimalistic implementation like that: https://gist.github.com/Yaffle/1088850 |
In #288 proposed an option. |
Now it's an ECMAScript proposal, https://github.com/jasnell/proposal-url. |
jsdom implemented the URL class to the WHATWG standard: https://github.com/jsdom/whatwg-url Would you be OK with using their code and formatting it to match the structure of your project? They also use the MIT license. |
what about using something like this as a polyfill? import pick from 'lodash/object/pick'
import mapValues from 'lodash/object/mapValues'
const parser = document.createElement('a')
const components = [
'hash', 'host', 'hostname', 'href', 'pathname', 'port', 'protocol', 'search'
]
export default function parse(url) {
parser.href = encodeURI(url)
return mapValues(pick(parser, components), decodeURIComponent)
} |
@kof at least, |
@KevinSnyderCodes feel free to add it after merging |
Is this issue also covering Note that 2 polyfills already exists
|
@yvele yes, includes. |
Most likely, it will be added soon. I'm working on it. |
@zloirock Would this be on by default, or opt in? I wouldn't want users of |
@loganfsmyth it will be available in namespaces |
Available in |
Hello,
Are there any plans to add the URL constructor to this library?
https://developer.mozilla.org/en-US/docs/Web/API/URL/URL
Thanks.
The text was updated successfully, but these errors were encountered: