doc: add info about serializable types
querystring.stringify() doesn't serialize some values. Explicitly mention what values are serialized in the docs. Add what happens when another data type is passed to `querystring.stringify()` besides the ones that can be correctly parsed PR-URL: https://github.com/nodejs/node/pull/12313 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
508c8ce864
commit
b07c72b8be
@ -101,6 +101,10 @@ added: v0.1.25
|
|||||||
The `querystring.stringify()` method produces a URL query string from a
|
The `querystring.stringify()` method produces a URL query string from a
|
||||||
given `obj` by iterating through the object's "own properties".
|
given `obj` by iterating through the object's "own properties".
|
||||||
|
|
||||||
|
It serializes the following types of values passed in `obj`:
|
||||||
|
{string|number|boolean|string[]|number[]|boolean[]}
|
||||||
|
Any other input values will be coerced to empty strings.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
Loading…
x
Reference in New Issue
Block a user