mirror of https://github.com/nodejs/node.git
doc: clarify url.format documentation
The original documentation was slightly confusing. It seemed that the
list of items described the properties of the urlObj object, while it
was actually describing the formatting process. This change makes this
clearer.
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
Cherry-picked-from: 0603c8345b
pull/281/merge
parent
3622f0308f
commit
b91c535d86
|
@ -82,6 +82,8 @@ Pass `true` as the third argument to treat `//foo/bar` as
|
|||
|
||||
Take a parsed URL object, and return a formatted URL string.
|
||||
|
||||
Here's how the formatting process works:
|
||||
|
||||
* `href` will be ignored.
|
||||
* `protocol` is treated the same with or without the trailing `:` (colon).
|
||||
* The protocols `http`, `https`, `ftp`, `gopher`, `file` will be
|
||||
|
@ -97,9 +99,9 @@ Take a parsed URL object, and return a formatted URL string.
|
|||
* `host` will be used in place of `hostname` and `port`
|
||||
* `pathname` is treated the same with or without the leading `/` (slash).
|
||||
* `path` is treated the same with `pathname` but able to contain `query` as well.
|
||||
* `search` will be used in place of `query`.
|
||||
* `query` (object; see `querystring`) will only be used if `search` is absent.
|
||||
* `search` is treated the same with or without the leading `?` (question mark).
|
||||
* `search` will be used in place of `query`.
|
||||
* It is treated the same with or without the leading `?` (question mark).
|
||||
* `hash` is treated the same with or without the leading `#` (pound sign, anchor).
|
||||
|
||||
## url.resolve(from, to)
|
||||
|
|
Loading…
Reference in New Issue