Build 580919stable
Module 973784
514 characters · in 18337.55dff69423f6211c.jsDependencies
Source Raw
function(e){"use strict";e.exports=function(e,t,r,n){t=t||"&",r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var o=/\+/g;e=e.split(t);var a=1e3;n&&"number"==typeof n.maxKeys&&(a=n.maxKeys);var s=e.length;a>0&&s>a&&(s=a);for(var l=0;l<s;++l){var u,c,d,f,p=e[l].replace(o,"%20"),h=p.indexOf(r);(h>=0?(u=p.substr(0,h),c=p.substr(h+1)):(u=p,c=""),d=decodeURIComponent(u),f=decodeURIComponent(c),Object.prototype.hasOwnProperty.call(i,d))?Array.isArray(i[d])?i[d].push(f):i[d]=[i[d],f]:i[d]=f}return i}}