Namespace puredom.querystring
-
Handles querystring encoding and decoding.
- Defined in: utils.js
| Constructor Attributes | Constructor Name and Description |
|---|---|
Method Summary
| Method Attributes | Method Name and Description |
|---|---|
| <static> |
puredom.querystring.
parse
(querystring)
Parse a querystring and return an {Object} with the key-value pairs as its properties.
|
| <static> |
puredom.querystring.
stringify
(parameters, options)
Convert an object into a querystring, optionally with custom separator/delimiter characters.
|
Namespace Detail
puredom.querystring
Method Detail
-
<static> {Object} puredom.querystring.parse(querystring)Parse a querystring and return an {Object} with the key-value pairs as its properties. Note: Preceeding '?' and '&' characters will be stripped. Empty parameters will be returned as empty strings.
- Parameters:
- {String} querystring
- The querystring to parse.
- Returns:
- {Object} The key-value parameters as an object.
-
<static> puredom.querystring.stringify(parameters, options)Convert an object into a querystring, optionally with custom separator/delimiter characters. Note: Nested objects are serialized as double-encoded querystring parameters by default. To use JSON for nested objects, set the "useJsonForObjects" flag to true. Available options: {Boolean} useJsonForObjects Use JSON to serialize nested objects? (uses double-encoding by default) {Boolean} disableArrayParams Disable PHP-style "array parameters? ex: p[]=foo&p[]=bar {Object} typeHandlers Specify custom serializers for each data type by setting type:handler. Handlers accept the original data and return the serialized parameter value, *not* URL-encoded. {String} assignment The key-value separator. Defaults to "=". {String} delimiter The group separator. Defaults to "&". {String} startDelimiter A character to insert at the beginning of the string. Defaults to none.
- Parameters:
- {Object} parameters
- A key-value map of parameters to serialize.
- {Object} options Optional
- A hashmap of configuration options.