querystring-stringify.js revision 76ca635d61eb3f9fb7c9d788a44fa8b1690aa138
474N/A * Provides Y.QueryString.stringify method for converting objects to Query Strings. 474N/A * @submodule querystring-stringify 474N/A * Provides Y.QueryString.escape method to be able to override default encoding 474N/A * method. This is important in cases where non-standard delimiters are used, if 474N/A * the delimiters would not normally be handled properly by the builtin 474N/A * (en|de)codeURIComponent functions. 474N/A * Default: encodeURIComponent 3817N/A * @submodule querystring-stringify 474N/A * <p>Converts an arbitrary value to a Query String representation.</p> 618N/A * <p>Objects with cyclical references will trigger an exception.</p> 844N/A * @param obj {Variant} any arbitrary value to convert to query string 474N/A * @param cfg {Object} (optional) Configuration object. The three 1258N/A * supported configurations are: 474N/A * <ul><li>sep: When defined, the value will be used as the key-value 2899N/A * separator. The default value is "&".</li> 2899N/A * <li>eq: When defined, the value will be used to join the key to 474N/A * the value. The default value is "=".</li> 474N/A * <li>arrayKey: When set to true, the key of an array will have the 474N/A * '[]' notation appended to the key. The default value is false. 844N/A * @param name {String} (optional) Name of the current key, for handling children recursively. 825N/A for (i =
0; i < l; i++) {
474N/A // now we know it's an object. 474N/A // Check for cyclical references in nested objects 474N/A throw new Error(
"QueryString.stringify. Cyclical reference");