From d357b3090ef2f60021b95316141615bfe5db3a86 Mon Sep 17 00:00:00 2001 From: Tristian Flanagan Date: Wed, 4 Nov 2015 12:26:30 -0500 Subject: [PATCH] doc: sort querystring alphabetically Reorders, with no contextual changes, the querystring documentation alphabetically. PR-URL: https://github.com/nodejs/node/pull/3662 Reviewed-By: Evan Lucas Reviewed-By: James M Snell Reviewed-By: Jeremiah Senkpiel --- doc/api/querystring.markdown | 54 ++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/doc/api/querystring.markdown b/doc/api/querystring.markdown index 37144974c5..8b16fb725a 100644 --- a/doc/api/querystring.markdown +++ b/doc/api/querystring.markdown @@ -7,31 +7,10 @@ This module provides utilities for dealing with query strings. It provides the following methods: -## querystring.stringify(obj[, sep][, eq][, options]) - -Serialize an object to a query string. -Optionally override the default separator (`'&'`) and assignment (`'='`) -characters. - -Options object may contain `encodeURIComponent` property (`querystring.escape` by default), -it can be used to encode string with `non-utf8` encoding if necessary. - -Example: - - querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' }) - // returns - 'foo=bar&baz=qux&baz=quux&corge=' - - querystring.stringify({foo: 'bar', baz: 'qux'}, ';', ':') - // returns - 'foo:bar;baz:qux' +## querystring.escape - // Suppose gbkEncodeURIComponent function already exists, - // it can encode string with `gbk` encoding - querystring.stringify({ w: '中文', foo: 'bar' }, null, null, - { encodeURIComponent: gbkEncodeURIComponent }) - // returns - 'w=%D6%D0%CE%C4&foo=bar' +The escape function used by `querystring.stringify`, +provided so that it could be overridden if necessary. ## querystring.parse(str[, sep][, eq][, options]) @@ -58,10 +37,31 @@ Example: // returns { w: '中文', foo: 'bar' } -## querystring.escape +## querystring.stringify(obj[, sep][, eq][, options]) -The escape function used by `querystring.stringify`, -provided so that it could be overridden if necessary. +Serialize an object to a query string. +Optionally override the default separator (`'&'`) and assignment (`'='`) +characters. + +Options object may contain `encodeURIComponent` property (`querystring.escape` by default), +it can be used to encode string with `non-utf8` encoding if necessary. + +Example: + + querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' }) + // returns + 'foo=bar&baz=qux&baz=quux&corge=' + + querystring.stringify({foo: 'bar', baz: 'qux'}, ';', ':') + // returns + 'foo:bar;baz:qux' + + // Suppose gbkEncodeURIComponent function already exists, + // it can encode string with `gbk` encoding + querystring.stringify({ w: '中文', foo: 'bar' }, null, null, + { encodeURIComponent: gbkEncodeURIComponent }) + // returns + 'w=%D6%D0%CE%C4&foo=bar' ## querystring.unescape