Sha256: 148e2d4442f023922dcfe724c11fa6ed410ff2be77c6da7025e23cfb581940dc
Contents?: true
Size: 708 Bytes
Versions: 89
Compression:
Stored size: 708 Bytes
Contents
/** * Compiles a querystring * Returns string representation of the object * * @param {Object} * @api private */ exports.encode = function (obj) { var str = ''; for (var i in obj) { if (obj.hasOwnProperty(i)) { if (str.length) str += '&'; str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]); } } return str; }; /** * Parses a simple querystring into an object * * @param {String} qs * @api private */ exports.decode = function(qs){ var qry = {}; var pairs = qs.split('&'); for (var i = 0, l = pairs.length; i < l; i++) { var pair = pairs[i].split('='); qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]); } return qry; };
Version data entries
89 entries across 89 versions & 3 rubygems