Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
doc: add info about other data types
Fix typo.
Add what happens when another data type is passed to `querystring.stringify()` besides the ones that can be correctly parsed
  • Loading branch information
shubheksha committed Apr 10, 2017
commit 31fca1cb0d66d164cee24b12d0a5c7aa8da5fe59
3 changes: 2 additions & 1 deletion doc/api/querystring.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ added: v0.1.25
The `querystring.stringify()` method produces a URL query string from a
given `obj` by iterating through the object's "own properties".

This method searializes the following types of values passed in `obj`: strings,
This method serializes the following types of values passed in `obj`: strings,

@joyeecheung joyeecheung Apr 11, 2017 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this paragragh can be added to the type annotation of obj above? Using the {Type} syntax would give us links to MDN documentations. Something like

Values should be {String|Number|Boolean|String[]|Number[]|Boolean[]}
(more explanations)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to ignore, but I would just drop the This method at the front :-)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joyeecheung, this is neat -- I didn't know this!
@jasnell, dropped :)

finite numbers, booleans and arrays of the aforementioned types.
Any other input values will be coerced to empty strings

@hiroppy hiroppy Apr 10, 2017 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that it is better to use the period(I'm sorry if I'm wrong because I am not native).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, thanks for pointing it out :)


For example:

Expand Down