Skip to content

Commit

Permalink
doc: improve description of urlObject.query
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
rahatarmanahmed authored and addaleax committed Nov 22, 2016
1 parent d62376c commit 159799a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions doc/api/url.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,10 @@ No decoding of the `path` is performed.

### urlObject.query

The `query` property is either the "params" portion of the query string (
everything *except* the leading ASCII question mark (`?`), or an object
returned by the [`querystring`][] module's `parse()` method:
The `query` property is either the query string without the leading ASCII
question mark (`?`), or an object returned by the [`querystring`][] module's
`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'}`

Expand Down

0 comments on commit 159799a

Please sign in to comment.