doc: improve description of urlObject.query
The description of urlObject.query is ambiguous about when it's an object vs when it's a string. Added a sentence pointing to the option that determines this in url.parse(). Also fixed the missing parentheses in the first sentence by rewording it to avoid nested parentheses. PR-URL: https://github.com/nodejs/node/pull/9625 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
parent
45279947f1
commit
8f05611a5c
@ -114,9 +114,10 @@ No decoding of the `path` is performed.
|
|||||||
|
|
||||||
### urlObject.query
|
### urlObject.query
|
||||||
|
|
||||||
The `query` property is either the "params" portion of the query string (
|
The `query` property is either the query string without the leading ASCII
|
||||||
everything *except* the leading ASCII question mark (`?`), or an object
|
question mark (`?`), or an object returned by the [`querystring`][] module's
|
||||||
returned by the [`querystring`][] module's `parse()` method:
|
`parse()` method. Whether the `query` property is a string or object is
|
||||||
|
determined by the `parseQueryString` argument passed to `url.parse()`.
|
||||||
|
|
||||||
For example: `'query=string'` or `{'query': 'string'}`
|
For example: `'query=string'` or `{'query': 'string'}`
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user