doc: clarify slashes-appending in url module
PR-URL: https://github.com/nodejs/node/pull/9731 Ref: https://github.com/nodejs/node/issues/9521 Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
aa1333ff3b
commit
c1133f41b6
@ -154,10 +154,11 @@ The formatting process operates as follows:
|
|||||||
[`Error`][] is thrown.
|
[`Error`][] is thrown.
|
||||||
* For all string values of `urlObject.protocol` that *do not end* with an ASCII
|
* For all string values of `urlObject.protocol` that *do not end* with an ASCII
|
||||||
colon (`:`) character, the literal string `:` will be appended to `result`.
|
colon (`:`) character, the literal string `:` will be appended to `result`.
|
||||||
* If either the `urlObject.slashes` property is true, `urlObject.protocol`
|
* If either of the following conditions is true, then the literal string `//`
|
||||||
begins with one of `http`, `https`, `ftp`, `gopher`, or `file`, or
|
will be appended to `result`:
|
||||||
`urlObject.protocol` is `undefined`, the literal string `//` will be appended
|
* `urlObject.slashes` property is true;
|
||||||
to `result`.
|
* `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or
|
||||||
|
`file`;
|
||||||
* If the value of the `urlObject.auth` property is truthy, and either
|
* If the value of the `urlObject.auth` property is truthy, and either
|
||||||
`urlObject.host` or `urlObject.hostname` are not `undefined`, the value of
|
`urlObject.host` or `urlObject.hostname` are not `undefined`, the value of
|
||||||
`urlObject.auth` will be coerced into a string and appended to `result`
|
`urlObject.auth` will be coerced into a string and appended to `result`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user