Skip to content

Commit 159799a

Browse files
rahatarmanahmedaddaleax
authored andcommitted
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: #9625 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent d62376c commit 159799a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

doc/api/url.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@ No decoding of the `path` is performed.
114114

115115
### urlObject.query
116116

117-
The `query` property is either the "params" portion of the query string (
118-
everything *except* the leading ASCII question mark (`?`), or an object
119-
returned by the [`querystring`][] module's `parse()` method:
117+
The `query` property is either the query string without the leading ASCII
118+
question mark (`?`), or an object returned by the [`querystring`][] module's
119+
`parse()` method. Whether the `query` property is a string or object is
120+
determined by the `parseQueryString` argument passed to `url.parse()`.
120121

121122
For example: `'query=string'` or `{'query': 'string'}`
122123

0 commit comments

Comments
 (0)