We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Have you considered freshening up the API with ES5 Properties? I'll take the readme and offer a proposal of what could be done with it:
Pass any URL into the constructor:
var uri = new Uri('http://user:pass@www.test.com:81/index.html?q=books#fragment')
Use property methods to get at the various parts:
uri.protocol // http uri.userInfo // user:pass uri.host // www.test.com uri.port // 81 uri.path // /index.html uri.query // q=books uri.anchor // fragment
Property methods accept an optional value to set:
uri.protocol = 'https' uri.toString() // https://user:pass@www.test.com:81/index.html?q=books#fragment uri.host = 'mydomain.com' uri.toString() // https://user:pass@mydomain.com:81/index.html?q=books#fragment
ES5 Propery setter methods help you compose strings:
Object.assign(new Uri(), { path: '/archives/1979/', query: { page: 1 } }).toString() // /archives/1979?page=1 Object.assign(new Uri(), { path: '/index.html', anchor: 'content', host: 'www.test.com', port: 8080, userInfo: 'username:password', protocol: 'https' query: { this: 'that', some: 'thing' } }).toString() // https://username:password@www.test.com:8080/index.html?this=that&some=thing#content
especially with the query changes, that would really freshen up the API. Poor souls that still need to support IE8 can stay on v1.
query
Thoughts?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Have you considered freshening up the API with ES5 Properties? I'll take the readme and offer a proposal of what could be done with it:
Pass any URL into the constructor:
Use property methods to get at the various parts:
Property methods accept an optional value to set:
ES5 Propery setter methods help you compose strings:
especially with the
query
changes, that would really freshen up the API. Poor souls that still need to support IE8 can stay on v1.Thoughts?
The text was updated successfully, but these errors were encountered: