ps-toolkit-ui 1.4.96 → 1.4.97

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1179,6 +1179,32 @@
1179
1179
  }
1180
1180
  return (parseInt(bgColor.replace('#', ''), 16) > 0xffffff / 2) ? '#000' : '#fff';
1181
1181
  };
1182
+ HelperClass.queryStringToJSON = function (qs) {
1183
+ if (qs === void 0) { qs = null; }
1184
+ qs = qs || location.search.slice(1);
1185
+ if (qs === '') {
1186
+ return {};
1187
+ }
1188
+ var pairs = qs.split('&');
1189
+ var result = {};
1190
+ pairs.forEach(function (p) {
1191
+ var pair = p.split('=');
1192
+ var key = pair[0].replace('%5B%5D', '');
1193
+ var value = decodeURIComponent(pair[1] || '');
1194
+ if (result[key]) {
1195
+ if (Object.prototype.toString.call(result[key]) === '[object Array]') {
1196
+ result[key].push(value);
1197
+ }
1198
+ else {
1199
+ result[key] = [result[key], value];
1200
+ }
1201
+ }
1202
+ else {
1203
+ result[key] = value;
1204
+ }
1205
+ });
1206
+ return JSON.parse(JSON.stringify(result));
1207
+ };
1182
1208
  return HelperClass;
1183
1209
  }());
1184
1210