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

doc: add URL.format() example #18888

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
doc: use lowercase url in url.format example
  • Loading branch information
zeke committed Feb 20, 2018
commit 72f731ebf4ff6fefb235adaed9ce593e12744f0a
4 changes: 1 addition & 3 deletions doc/api/url.md
Original file line number Diff line number Diff line change
Expand Up @@ -951,9 +951,7 @@ The `url.format()` method returns a formatted URL string derived from
Example:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: You can remove Example: too. It's obvious that it is an example.


```js
const URL = require('url');

URL.format({
url.format({
protocol: 'https',
hostname: `example.com`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the backticks intended? If so, are not they a bit confusing here? With them, a template literal/a tag function/other quotes inside are usually expected.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, @vsemozhetbyt. Backticks were not intentional there. Fixed.

pathname: '/some/path',
Expand Down