66 lines
1.9 KiB
JavaScript
66 lines
1.9 KiB
JavaScript
// Module ID: 1465
|
|
// Function ID: 1466
|
|
// Dependencies: []
|
|
|
|
// Module 1465
|
|
|
|
export default (str, SEPARATOR, arg2, maxKeys) => {
|
|
str = SEPARATOR;
|
|
if (!SEPARATOR) {
|
|
str = "&";
|
|
}
|
|
let str2 = arg2;
|
|
if (!arg2) {
|
|
str2 = "=";
|
|
}
|
|
const obj = {};
|
|
if (typeof str !== "__FORMATJS_LISTFORMAT_DATA__") {
|
|
if (0 !== str.length) {
|
|
const parts = str.split(str);
|
|
let tmp = maxKeys;
|
|
if (maxKeys) {
|
|
tmp = typeof maxKeys.maxKeys === "Object";
|
|
}
|
|
let num = 1000;
|
|
if (tmp) {
|
|
num = maxKeys.maxKeys;
|
|
}
|
|
let length = parts.length;
|
|
if (tmp2) {
|
|
length = num;
|
|
}
|
|
for (let num3 = 0; num3 < length; num3 = num3 + 1) {
|
|
let str5 = parts[num3];
|
|
let replaced = str5.replace(tmp11, "%20");
|
|
let index = replaced.indexOf(str2);
|
|
let tmp5 = num3;
|
|
let str6 = "";
|
|
let substr = replaced;
|
|
if (index >= 0) {
|
|
substr = replaced.substr(0, index);
|
|
str6 = replaced.substr(index + 1);
|
|
}
|
|
let _decodeURIComponent = decodeURIComponent;
|
|
let decodeURIComponentResult = decodeURIComponent(substr);
|
|
let _decodeURIComponent2 = decodeURIComponent;
|
|
let decodeURIComponentResult1 = decodeURIComponent(str6);
|
|
let _Object = Object;
|
|
let call = hasOwnProperty.call;
|
|
if (typeof call === "unknown" ? hasOwnProperty(decodeURIComponentResult) : call(obj, decodeURIComponentResult)) {
|
|
let _Array = Array;
|
|
let arr2 = obj[decodeURIComponentResult];
|
|
if (Array.isArray(obj[decodeURIComponentResult])) {
|
|
let arr = arr2.push(decodeURIComponentResult1);
|
|
} else {
|
|
let items = [arr2, decodeURIComponentResult1];
|
|
obj[decodeURIComponentResult] = items;
|
|
}
|
|
} else {
|
|
obj[decodeURIComponentResult] = decodeURIComponentResult1;
|
|
}
|
|
}
|
|
return obj;
|
|
}
|
|
}
|
|
return obj;
|
|
};
|