@indfnd/utils 0.1.28 → 0.1.30

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.1.30](http://git.inspur.com/imp-ec/ind-front/ind-utils/compare/v0.1.29...v0.1.30) (2026-01-14)
6
+
7
+
8
+ ### Features
9
+
10
+ * 获取组织树和资源树增加Localstorage缓存 ([6d2983b](http://git.inspur.com/imp-ec/ind-front/ind-utils/commit/6d2983ba9cb7dda646395343fed23321af78bc36))
11
+
12
+ ### [0.1.29](http://git.inspur.com/imp-ec/ind-front/ind-utils/compare/v0.1.28...v0.1.29) (2026-01-13)
13
+
14
+
15
+ ### Features
16
+
17
+ * utils增加getSingleton等api 修改 ([40b3d79](http://git.inspur.com/imp-ec/ind-front/ind-utils/commit/40b3d79cf81b8242bc8e7eb51dbd5e4d1af270d4))
18
+ * utils增加getSingleton等api 修改 ([a34c5d1](http://git.inspur.com/imp-ec/ind-front/ind-utils/commit/a34c5d1960845bfe76353c6270512acbeb5c0a11))
19
+
5
20
  ### [0.1.28](http://git.inspur.com/imp-ec/ind-front/ind-utils/compare/v0.1.27...v0.1.28) (2026-01-13)
6
21
 
7
22
  ### [0.1.27](http://git.inspur.com/imp-ec/ind-front/ind-utils/compare/v0.1.26...v0.1.27) (2026-01-13)
@@ -2490,7 +2490,7 @@ var compactQueue = function compactQueue2(queue) {
2490
2490
  }
2491
2491
  };
2492
2492
  var arrayToObject = function arrayToObject2(source2, options) {
2493
- var obj = options && options.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
2493
+ var obj = options && options.plainObjects ? { __proto__: null } : {};
2494
2494
  for (var i = 0; i < source2.length; ++i) {
2495
2495
  if (typeof source2[i] !== "undefined") {
2496
2496
  obj[i] = source2[i];
@@ -2502,7 +2502,7 @@ var merge = function merge2(target, source2, options) {
2502
2502
  if (!source2) {
2503
2503
  return target;
2504
2504
  }
2505
- if (typeof source2 !== "object") {
2505
+ if (typeof source2 !== "object" && typeof source2 !== "function") {
2506
2506
  if (isArray$3(target)) {
2507
2507
  target.push(source2);
2508
2508
  } else if (target && typeof target === "object") {
@@ -2552,7 +2552,7 @@ var assign = function assignSingleSource(target, source2) {
2552
2552
  return acc;
2553
2553
  }, target);
2554
2554
  };
2555
- var decode = function(str, decoder, charset) {
2555
+ var decode = function(str, defaultDecoder, charset) {
2556
2556
  var strWithoutPlus = str.replace(/\+/g, " ");
2557
2557
  if (charset === "iso-8859-1") {
2558
2558
  return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
@@ -2563,6 +2563,7 @@ var decode = function(str, decoder, charset) {
2563
2563
  return strWithoutPlus;
2564
2564
  }
2565
2565
  };
2566
+ var limit = 1024;
2566
2567
  var encode = function encode2(str, defaultEncoder, charset, kind, format) {
2567
2568
  if (str.length === 0) {
2568
2569
  return str;
@@ -2579,27 +2580,32 @@ var encode = function encode2(str, defaultEncoder, charset, kind, format) {
2579
2580
  });
2580
2581
  }
2581
2582
  var out = "";
2582
- for (var i = 0; i < string.length; ++i) {
2583
- var c = string.charCodeAt(i);
2584
- if (c === 45 || c === 46 || c === 95 || c === 126 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122 || format === formats$2.RFC1738 && (c === 40 || c === 41)) {
2585
- out += string.charAt(i);
2586
- continue;
2587
- }
2588
- if (c < 128) {
2589
- out = out + hexTable[c];
2590
- continue;
2591
- }
2592
- if (c < 2048) {
2593
- out = out + (hexTable[192 | c >> 6] + hexTable[128 | c & 63]);
2594
- continue;
2595
- }
2596
- if (c < 55296 || c >= 57344) {
2597
- out = out + (hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63]);
2598
- continue;
2583
+ for (var j = 0; j < string.length; j += limit) {
2584
+ var segment = string.length >= limit ? string.slice(j, j + limit) : string;
2585
+ var arr = [];
2586
+ for (var i = 0; i < segment.length; ++i) {
2587
+ var c = segment.charCodeAt(i);
2588
+ if (c === 45 || c === 46 || c === 95 || c === 126 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122 || format === formats$2.RFC1738 && (c === 40 || c === 41)) {
2589
+ arr[arr.length] = segment.charAt(i);
2590
+ continue;
2591
+ }
2592
+ if (c < 128) {
2593
+ arr[arr.length] = hexTable[c];
2594
+ continue;
2595
+ }
2596
+ if (c < 2048) {
2597
+ arr[arr.length] = hexTable[192 | c >> 6] + hexTable[128 | c & 63];
2598
+ continue;
2599
+ }
2600
+ if (c < 55296 || c >= 57344) {
2601
+ arr[arr.length] = hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
2602
+ continue;
2603
+ }
2604
+ i += 1;
2605
+ c = 65536 + ((c & 1023) << 10 | segment.charCodeAt(i) & 1023);
2606
+ arr[arr.length] = hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
2599
2607
  }
2600
- i += 1;
2601
- c = 65536 + ((c & 1023) << 10 | string.charCodeAt(i) & 1023);
2602
- out += hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
2608
+ out += arr.join("");
2603
2609
  }
2604
2610
  return out;
2605
2611
  };
@@ -2682,12 +2688,17 @@ var defaultFormat = formats$1["default"];
2682
2688
  var defaults$1 = {
2683
2689
  addQueryPrefix: false,
2684
2690
  allowDots: false,
2691
+ allowEmptyArrays: false,
2692
+ arrayFormat: "indices",
2685
2693
  charset: "utf-8",
2686
2694
  charsetSentinel: false,
2695
+ commaRoundTrip: false,
2687
2696
  delimiter: "&",
2688
2697
  encode: true,
2698
+ encodeDotInKeys: false,
2689
2699
  encoder: utils$1.encode,
2690
2700
  encodeValuesOnly: false,
2701
+ filter: void 0,
2691
2702
  format: defaultFormat,
2692
2703
  formatter: formats$1.formatters[defaultFormat],
2693
2704
  indices: false,
@@ -2701,7 +2712,7 @@ var isNonNullishPrimitive = function isNonNullishPrimitive2(v) {
2701
2712
  return typeof v === "string" || typeof v === "number" || typeof v === "boolean" || typeof v === "symbol" || typeof v === "bigint";
2702
2713
  };
2703
2714
  var sentinel = {};
2704
- var stringify$1 = function stringify(object, prefix, generateArrayPrefix, commaRoundTrip, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate2, format, formatter, encodeValuesOnly, charset, sideChannel2) {
2715
+ var stringify$1 = function stringify(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter, sort, allowDots, serializeDate2, format, formatter, encodeValuesOnly, charset, sideChannel2) {
2705
2716
  var obj = object;
2706
2717
  var tmpSc = sideChannel2;
2707
2718
  var step = 0;
@@ -2761,14 +2772,19 @@ var stringify$1 = function stringify(object, prefix, generateArrayPrefix, commaR
2761
2772
  var keys = Object.keys(obj);
2762
2773
  objKeys = sort ? keys.sort(sort) : keys;
2763
2774
  }
2764
- var adjustedPrefix = commaRoundTrip && isArray$2(obj) && obj.length === 1 ? prefix + "[]" : prefix;
2775
+ var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, "%2E") : String(prefix);
2776
+ var adjustedPrefix = commaRoundTrip && isArray$2(obj) && obj.length === 1 ? encodedPrefix + "[]" : encodedPrefix;
2777
+ if (allowEmptyArrays && isArray$2(obj) && obj.length === 0) {
2778
+ return adjustedPrefix + "[]";
2779
+ }
2765
2780
  for (var j = 0; j < objKeys.length; ++j) {
2766
2781
  var key = objKeys[j];
2767
- var value = typeof key === "object" && typeof key.value !== "undefined" ? key.value : obj[key];
2782
+ var value = typeof key === "object" && key && typeof key.value !== "undefined" ? key.value : obj[key];
2768
2783
  if (skipNulls && value === null) {
2769
2784
  continue;
2770
2785
  }
2771
- var keyPrefix = isArray$2(obj) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix : adjustedPrefix + (allowDots ? "." + key : "[" + key + "]");
2786
+ var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, "%2E") : String(key);
2787
+ var keyPrefix = isArray$2(obj) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix : adjustedPrefix + (allowDots ? "." + encodedKey : "[" + encodedKey + "]");
2772
2788
  sideChannel2.set(object, step);
2773
2789
  var valueSideChannel = getSideChannel2();
2774
2790
  valueSideChannel.set(sentinel, sideChannel2);
@@ -2777,8 +2793,10 @@ var stringify$1 = function stringify(object, prefix, generateArrayPrefix, commaR
2777
2793
  keyPrefix,
2778
2794
  generateArrayPrefix,
2779
2795
  commaRoundTrip,
2796
+ allowEmptyArrays,
2780
2797
  strictNullHandling,
2781
2798
  skipNulls,
2799
+ encodeDotInKeys,
2782
2800
  generateArrayPrefix === "comma" && encodeValuesOnly && isArray$2(obj) ? null : encoder,
2783
2801
  filter,
2784
2802
  sort,
@@ -2797,6 +2815,12 @@ var normalizeStringifyOptions = function normalizeStringifyOptions2(opts) {
2797
2815
  if (!opts) {
2798
2816
  return defaults$1;
2799
2817
  }
2818
+ if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") {
2819
+ throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
2820
+ }
2821
+ if (typeof opts.encodeDotInKeys !== "undefined" && typeof opts.encodeDotInKeys !== "boolean") {
2822
+ throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");
2823
+ }
2800
2824
  if (opts.encoder !== null && typeof opts.encoder !== "undefined" && typeof opts.encoder !== "function") {
2801
2825
  throw new TypeError("Encoder has to be a function.");
2802
2826
  }
@@ -2816,13 +2840,29 @@ var normalizeStringifyOptions = function normalizeStringifyOptions2(opts) {
2816
2840
  if (typeof opts.filter === "function" || isArray$2(opts.filter)) {
2817
2841
  filter = opts.filter;
2818
2842
  }
2843
+ var arrayFormat;
2844
+ if (opts.arrayFormat in arrayPrefixGenerators) {
2845
+ arrayFormat = opts.arrayFormat;
2846
+ } else if ("indices" in opts) {
2847
+ arrayFormat = opts.indices ? "indices" : "repeat";
2848
+ } else {
2849
+ arrayFormat = defaults$1.arrayFormat;
2850
+ }
2851
+ if ("commaRoundTrip" in opts && typeof opts.commaRoundTrip !== "boolean") {
2852
+ throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
2853
+ }
2854
+ var allowDots = typeof opts.allowDots === "undefined" ? opts.encodeDotInKeys === true ? true : defaults$1.allowDots : !!opts.allowDots;
2819
2855
  return {
2820
2856
  addQueryPrefix: typeof opts.addQueryPrefix === "boolean" ? opts.addQueryPrefix : defaults$1.addQueryPrefix,
2821
- allowDots: typeof opts.allowDots === "undefined" ? defaults$1.allowDots : !!opts.allowDots,
2857
+ allowDots,
2858
+ allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults$1.allowEmptyArrays,
2859
+ arrayFormat,
2822
2860
  charset,
2823
2861
  charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults$1.charsetSentinel,
2862
+ commaRoundTrip: !!opts.commaRoundTrip,
2824
2863
  delimiter: typeof opts.delimiter === "undefined" ? defaults$1.delimiter : opts.delimiter,
2825
2864
  encode: typeof opts.encode === "boolean" ? opts.encode : defaults$1.encode,
2865
+ encodeDotInKeys: typeof opts.encodeDotInKeys === "boolean" ? opts.encodeDotInKeys : defaults$1.encodeDotInKeys,
2826
2866
  encoder: typeof opts.encoder === "function" ? opts.encoder : defaults$1.encoder,
2827
2867
  encodeValuesOnly: typeof opts.encodeValuesOnly === "boolean" ? opts.encodeValuesOnly : defaults$1.encodeValuesOnly,
2828
2868
  filter,
@@ -2850,19 +2890,8 @@ var stringify_1 = function(object, opts) {
2850
2890
  if (typeof obj !== "object" || obj === null) {
2851
2891
  return "";
2852
2892
  }
2853
- var arrayFormat;
2854
- if (opts && opts.arrayFormat in arrayPrefixGenerators) {
2855
- arrayFormat = opts.arrayFormat;
2856
- } else if (opts && "indices" in opts) {
2857
- arrayFormat = opts.indices ? "indices" : "repeat";
2858
- } else {
2859
- arrayFormat = "indices";
2860
- }
2861
- var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
2862
- if (opts && "commaRoundTrip" in opts && typeof opts.commaRoundTrip !== "boolean") {
2863
- throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
2864
- }
2865
- var commaRoundTrip = generateArrayPrefix === "comma" && opts && opts.commaRoundTrip;
2893
+ var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];
2894
+ var commaRoundTrip = generateArrayPrefix === "comma" && options.commaRoundTrip;
2866
2895
  if (!objKeys) {
2867
2896
  objKeys = Object.keys(obj);
2868
2897
  }
@@ -2872,16 +2901,19 @@ var stringify_1 = function(object, opts) {
2872
2901
  var sideChannel2 = getSideChannel2();
2873
2902
  for (var i = 0; i < objKeys.length; ++i) {
2874
2903
  var key = objKeys[i];
2875
- if (options.skipNulls && obj[key] === null) {
2904
+ var value = obj[key];
2905
+ if (options.skipNulls && value === null) {
2876
2906
  continue;
2877
2907
  }
2878
2908
  pushToArray(keys, stringify$1(
2879
- obj[key],
2909
+ value,
2880
2910
  key,
2881
2911
  generateArrayPrefix,
2882
2912
  commaRoundTrip,
2913
+ options.allowEmptyArrays,
2883
2914
  options.strictNullHandling,
2884
2915
  options.skipNulls,
2916
+ options.encodeDotInKeys,
2885
2917
  options.encode ? options.encoder : null,
2886
2918
  options.filter,
2887
2919
  options.sort,
@@ -2910,31 +2942,39 @@ var has = Object.prototype.hasOwnProperty;
2910
2942
  var isArray$1 = Array.isArray;
2911
2943
  var defaults = {
2912
2944
  allowDots: false,
2945
+ allowEmptyArrays: false,
2913
2946
  allowPrototypes: false,
2914
2947
  allowSparse: false,
2915
2948
  arrayLimit: 20,
2916
2949
  charset: "utf-8",
2917
2950
  charsetSentinel: false,
2918
2951
  comma: false,
2952
+ decodeDotInKeys: false,
2919
2953
  decoder: utils.decode,
2920
2954
  delimiter: "&",
2921
2955
  depth: 5,
2956
+ duplicates: "combine",
2922
2957
  ignoreQueryPrefix: false,
2923
2958
  interpretNumericEntities: false,
2924
2959
  parameterLimit: 1e3,
2925
2960
  parseArrays: true,
2926
2961
  plainObjects: false,
2927
- strictNullHandling: false
2962
+ strictDepth: false,
2963
+ strictNullHandling: false,
2964
+ throwOnLimitExceeded: false
2928
2965
  };
2929
2966
  var interpretNumericEntities = function(str) {
2930
2967
  return str.replace(/&#(\d+);/g, function($0, numberStr) {
2931
2968
  return String.fromCharCode(parseInt(numberStr, 10));
2932
2969
  });
2933
2970
  };
2934
- var parseArrayValue = function(val, options) {
2971
+ var parseArrayValue = function(val, options, currentArrayLength) {
2935
2972
  if (val && typeof val === "string" && options.comma && val.indexOf(",") > -1) {
2936
2973
  return val.split(",");
2937
2974
  }
2975
+ if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) {
2976
+ throw new RangeError("Array limit exceeded. Only " + options.arrayLimit + " element" + (options.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
2977
+ }
2938
2978
  return val;
2939
2979
  };
2940
2980
  var isoSentinel = "utf8=%26%2310003%3B";
@@ -2942,8 +2982,15 @@ var charsetSentinel = "utf8=%E2%9C%93";
2942
2982
  var parseValues = function parseQueryStringValues(str, options) {
2943
2983
  var obj = { __proto__: null };
2944
2984
  var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, "") : str;
2945
- var limit = options.parameterLimit === Infinity ? void 0 : options.parameterLimit;
2946
- var parts = cleanStr.split(options.delimiter, limit);
2985
+ cleanStr = cleanStr.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
2986
+ var limit2 = options.parameterLimit === Infinity ? void 0 : options.parameterLimit;
2987
+ var parts = cleanStr.split(
2988
+ options.delimiter,
2989
+ options.throwOnLimitExceeded ? limit2 + 1 : limit2
2990
+ );
2991
+ if (options.throwOnLimitExceeded && parts.length > limit2) {
2992
+ throw new RangeError("Parameter limit exceeded. Only " + limit2 + " parameter" + (limit2 === 1 ? "" : "s") + " allowed.");
2993
+ }
2947
2994
  var skipIndex = -1;
2948
2995
  var i;
2949
2996
  var charset = options.charset;
@@ -2967,51 +3014,63 @@ var parseValues = function parseQueryStringValues(str, options) {
2967
3014
  var part = parts[i];
2968
3015
  var bracketEqualsPos = part.indexOf("]=");
2969
3016
  var pos = bracketEqualsPos === -1 ? part.indexOf("=") : bracketEqualsPos + 1;
2970
- var key, val;
3017
+ var key;
3018
+ var val;
2971
3019
  if (pos === -1) {
2972
3020
  key = options.decoder(part, defaults.decoder, charset, "key");
2973
3021
  val = options.strictNullHandling ? null : "";
2974
3022
  } else {
2975
3023
  key = options.decoder(part.slice(0, pos), defaults.decoder, charset, "key");
2976
3024
  val = utils.maybeMap(
2977
- parseArrayValue(part.slice(pos + 1), options),
3025
+ parseArrayValue(
3026
+ part.slice(pos + 1),
3027
+ options,
3028
+ isArray$1(obj[key]) ? obj[key].length : 0
3029
+ ),
2978
3030
  function(encodedVal) {
2979
3031
  return options.decoder(encodedVal, defaults.decoder, charset, "value");
2980
3032
  }
2981
3033
  );
2982
3034
  }
2983
3035
  if (val && options.interpretNumericEntities && charset === "iso-8859-1") {
2984
- val = interpretNumericEntities(val);
3036
+ val = interpretNumericEntities(String(val));
2985
3037
  }
2986
3038
  if (part.indexOf("[]=") > -1) {
2987
3039
  val = isArray$1(val) ? [val] : val;
2988
3040
  }
2989
- if (has.call(obj, key)) {
3041
+ var existing = has.call(obj, key);
3042
+ if (existing && options.duplicates === "combine") {
2990
3043
  obj[key] = utils.combine(obj[key], val);
2991
- } else {
3044
+ } else if (!existing || options.duplicates === "last") {
2992
3045
  obj[key] = val;
2993
3046
  }
2994
3047
  }
2995
3048
  return obj;
2996
3049
  };
2997
3050
  var parseObject = function(chain, val, options, valuesParsed) {
2998
- var leaf = valuesParsed ? val : parseArrayValue(val, options);
3051
+ var currentArrayLength = 0;
3052
+ if (chain.length > 0 && chain[chain.length - 1] === "[]") {
3053
+ var parentKey = chain.slice(0, -1).join("");
3054
+ currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0;
3055
+ }
3056
+ var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength);
2999
3057
  for (var i = chain.length - 1; i >= 0; --i) {
3000
3058
  var obj;
3001
3059
  var root = chain[i];
3002
3060
  if (root === "[]" && options.parseArrays) {
3003
- obj = [].concat(leaf);
3061
+ obj = options.allowEmptyArrays && (leaf === "" || options.strictNullHandling && leaf === null) ? [] : utils.combine([], leaf);
3004
3062
  } else {
3005
- obj = options.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
3063
+ obj = options.plainObjects ? { __proto__: null } : {};
3006
3064
  var cleanRoot = root.charAt(0) === "[" && root.charAt(root.length - 1) === "]" ? root.slice(1, -1) : root;
3007
- var index = parseInt(cleanRoot, 10);
3008
- if (!options.parseArrays && cleanRoot === "") {
3065
+ var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, ".") : cleanRoot;
3066
+ var index = parseInt(decodedRoot, 10);
3067
+ if (!options.parseArrays && decodedRoot === "") {
3009
3068
  obj = { 0: leaf };
3010
- } else if (!isNaN(index) && root !== cleanRoot && String(index) === cleanRoot && index >= 0 && (options.parseArrays && index <= options.arrayLimit)) {
3069
+ } else if (!isNaN(index) && root !== decodedRoot && String(index) === decodedRoot && index >= 0 && (options.parseArrays && index <= options.arrayLimit)) {
3011
3070
  obj = [];
3012
3071
  obj[index] = leaf;
3013
- } else if (cleanRoot !== "__proto__") {
3014
- obj[cleanRoot] = leaf;
3072
+ } else if (decodedRoot !== "__proto__") {
3073
+ obj[decodedRoot] = leaf;
3015
3074
  }
3016
3075
  }
3017
3076
  leaf = obj;
@@ -3047,6 +3106,9 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesPars
3047
3106
  keys.push(segment[1]);
3048
3107
  }
3049
3108
  if (segment) {
3109
+ if (options.strictDepth === true) {
3110
+ throw new RangeError("Input depth exceeded depth option of " + options.depth + " and strictDepth is true");
3111
+ }
3050
3112
  keys.push("[" + key.slice(segment.index) + "]");
3051
3113
  }
3052
3114
  return parseObject(keys, val, options, valuesParsed);
@@ -3055,39 +3117,58 @@ var normalizeParseOptions = function normalizeParseOptions2(opts) {
3055
3117
  if (!opts) {
3056
3118
  return defaults;
3057
3119
  }
3058
- if (opts.decoder !== null && opts.decoder !== void 0 && typeof opts.decoder !== "function") {
3120
+ if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") {
3121
+ throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
3122
+ }
3123
+ if (typeof opts.decodeDotInKeys !== "undefined" && typeof opts.decodeDotInKeys !== "boolean") {
3124
+ throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");
3125
+ }
3126
+ if (opts.decoder !== null && typeof opts.decoder !== "undefined" && typeof opts.decoder !== "function") {
3059
3127
  throw new TypeError("Decoder has to be a function.");
3060
3128
  }
3061
3129
  if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") {
3062
3130
  throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
3063
3131
  }
3132
+ if (typeof opts.throwOnLimitExceeded !== "undefined" && typeof opts.throwOnLimitExceeded !== "boolean") {
3133
+ throw new TypeError("`throwOnLimitExceeded` option must be a boolean");
3134
+ }
3064
3135
  var charset = typeof opts.charset === "undefined" ? defaults.charset : opts.charset;
3136
+ var duplicates = typeof opts.duplicates === "undefined" ? defaults.duplicates : opts.duplicates;
3137
+ if (duplicates !== "combine" && duplicates !== "first" && duplicates !== "last") {
3138
+ throw new TypeError("The duplicates option must be either combine, first, or last");
3139
+ }
3140
+ var allowDots = typeof opts.allowDots === "undefined" ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
3065
3141
  return {
3066
- allowDots: typeof opts.allowDots === "undefined" ? defaults.allowDots : !!opts.allowDots,
3142
+ allowDots,
3143
+ allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
3067
3144
  allowPrototypes: typeof opts.allowPrototypes === "boolean" ? opts.allowPrototypes : defaults.allowPrototypes,
3068
3145
  allowSparse: typeof opts.allowSparse === "boolean" ? opts.allowSparse : defaults.allowSparse,
3069
3146
  arrayLimit: typeof opts.arrayLimit === "number" ? opts.arrayLimit : defaults.arrayLimit,
3070
3147
  charset,
3071
3148
  charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults.charsetSentinel,
3072
3149
  comma: typeof opts.comma === "boolean" ? opts.comma : defaults.comma,
3150
+ decodeDotInKeys: typeof opts.decodeDotInKeys === "boolean" ? opts.decodeDotInKeys : defaults.decodeDotInKeys,
3073
3151
  decoder: typeof opts.decoder === "function" ? opts.decoder : defaults.decoder,
3074
3152
  delimiter: typeof opts.delimiter === "string" || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
3075
3153
  depth: typeof opts.depth === "number" || opts.depth === false ? +opts.depth : defaults.depth,
3154
+ duplicates,
3076
3155
  ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
3077
3156
  interpretNumericEntities: typeof opts.interpretNumericEntities === "boolean" ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
3078
3157
  parameterLimit: typeof opts.parameterLimit === "number" ? opts.parameterLimit : defaults.parameterLimit,
3079
3158
  parseArrays: opts.parseArrays !== false,
3080
3159
  plainObjects: typeof opts.plainObjects === "boolean" ? opts.plainObjects : defaults.plainObjects,
3081
- strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling
3160
+ strictDepth: typeof opts.strictDepth === "boolean" ? !!opts.strictDepth : defaults.strictDepth,
3161
+ strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling,
3162
+ throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === "boolean" ? opts.throwOnLimitExceeded : false
3082
3163
  };
3083
3164
  };
3084
3165
  var parse$1 = function(str, opts) {
3085
3166
  var options = normalizeParseOptions(opts);
3086
3167
  if (str === "" || str === null || typeof str === "undefined") {
3087
- return options.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
3168
+ return options.plainObjects ? { __proto__: null } : {};
3088
3169
  }
3089
3170
  var tempObj = typeof str === "string" ? parseValues(str, options) : str;
3090
- var obj = options.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
3171
+ var obj = options.plainObjects ? { __proto__: null } : {};
3091
3172
  var keys = Object.keys(tempObj);
3092
3173
  for (var i = 0; i < keys.length; ++i) {
3093
3174
  var key = keys[i];
@@ -3107,6 +3188,7 @@ var lib = {
3107
3188
  parse,
3108
3189
  stringify: stringify2
3109
3190
  };
3191
+ var qs = lib;
3110
3192
  function getUrlParams() {
3111
3193
  const url = location.search;
3112
3194
  const theRequest = new Object();
@@ -3266,7 +3348,7 @@ function requestInterceptors(config2) {
3266
3348
  const contentType = getContentType(config2.headers);
3267
3349
  if (config2.method === "post") {
3268
3350
  if (contentType === CONTENT_TYPE.form) {
3269
- config2.data = lib.stringify(config2.data);
3351
+ config2.data = qs.stringify(config2.data);
3270
3352
  }
3271
3353
  } else if (config2.method === "get")
3272
3354
  ;
@@ -3322,7 +3404,7 @@ instance.formPost = function(url, data2, config2) {
3322
3404
  setContentType(headers, CONTENT_TYPE.form);
3323
3405
  return instance.post(url, data2, __spreadProps(__spreadValues({}, config2), { headers }));
3324
3406
  };
3325
- const wrapApi = (api) => {
3407
+ const wrapApi = (api, isPost = false) => {
3326
3408
  let currentController = null;
3327
3409
  const wrappedFunction = function(...args) {
3328
3410
  return __async(this, null, function* () {
@@ -3336,7 +3418,7 @@ const wrapApi = (api) => {
3336
3418
  const newArgs = [...args];
3337
3419
  const lastIndex = newArgs.length - 1;
3338
3420
  try {
3339
- if (newArgs.length > 0 && typeof newArgs[lastIndex] === "object" && !Array.isArray(newArgs[lastIndex])) {
3421
+ if ((isPost ? lastIndex > 1 : lastIndex > 0) && typeof newArgs[lastIndex] === "object" && !Array.isArray(newArgs[lastIndex])) {
3340
3422
  const config2 = newArgs[lastIndex];
3341
3423
  if (config2.signal) {
3342
3424
  const combinedController = new AbortController();
@@ -3355,6 +3437,8 @@ const wrapApi = (api) => {
3355
3437
  signal: controller.signal
3356
3438
  });
3357
3439
  }
3440
+ } else if (isPost && lastIndex === 0) {
3441
+ newArgs.push(null, { signal: controller.signal });
3358
3442
  } else {
3359
3443
  newArgs.push({ signal: controller.signal });
3360
3444
  }
@@ -3389,8 +3473,8 @@ const wrapApi = (api) => {
3389
3473
  return wrappedFunction;
3390
3474
  };
3391
3475
  instance.getSingleton = wrapApi(instance.get);
3392
- instance.postSingleton = wrapApi(instance.post);
3393
- instance.formPostSingleton = wrapApi(instance.formPost);
3476
+ instance.postSingleton = wrapApi(instance.post, true);
3477
+ instance.formPostSingleton = wrapApi(instance.formPost, true);
3394
3478
  var md5$1 = { exports: {} };
3395
3479
  var crypt = { exports: {} };
3396
3480
  (function() {
@@ -8935,22 +9019,22 @@ var lodash = { exports: {} };
8935
9019
  var snakeCase = createCompounder(function(result2, word, index) {
8936
9020
  return result2 + (index ? "_" : "") + word.toLowerCase();
8937
9021
  });
8938
- function split(string, separator, limit) {
8939
- if (limit && typeof limit != "number" && isIterateeCall(string, separator, limit)) {
8940
- separator = limit = undefined$12;
9022
+ function split(string, separator, limit2) {
9023
+ if (limit2 && typeof limit2 != "number" && isIterateeCall(string, separator, limit2)) {
9024
+ separator = limit2 = undefined$12;
8941
9025
  }
8942
- limit = limit === undefined$12 ? MAX_ARRAY_LENGTH : limit >>> 0;
8943
- if (!limit) {
9026
+ limit2 = limit2 === undefined$12 ? MAX_ARRAY_LENGTH : limit2 >>> 0;
9027
+ if (!limit2) {
8944
9028
  return [];
8945
9029
  }
8946
9030
  string = toString3(string);
8947
9031
  if (string && (typeof separator == "string" || separator != null && !isRegExp3(separator))) {
8948
9032
  separator = baseToString(separator);
8949
9033
  if (!separator && hasUnicode(string)) {
8950
- return castSlice(stringToArray(string), 0, limit);
9034
+ return castSlice(stringToArray(string), 0, limit2);
8951
9035
  }
8952
9036
  }
8953
- return string.split(separator, limit);
9037
+ return string.split(separator, limit2);
8954
9038
  }
8955
9039
  var startCase = createCompounder(function(result2, word, index) {
8956
9040
  return result2 + (index ? " " : "") + upperFirst(word);
@@ -11311,7 +11395,22 @@ function getItem(params) {
11311
11395
  return instance.get(`${CONTEXT}/basic/getItem`, { params });
11312
11396
  }
11313
11397
  const UC_CONTEXT = config.ucExtServerContext;
11398
+ const DATAVERSION_KEY = "ind-cache-dataVersion-organTree";
11314
11399
  function listUserTreeApi(params) {
11315
- return instance.get(`${UC_CONTEXT}/tree/uc-user/listUserTree`, { params });
11400
+ return __async(this, null, function* () {
11401
+ var _a;
11402
+ const cachedData = getLocalStorage(DATAVERSION_KEY);
11403
+ const dataVersionList = yield instance.get(`${UC_CONTEXT}/cacheManage/getCacheDataVersion`, {});
11404
+ const serverVersion = dataVersionList.data["organTree"];
11405
+ if ((cachedData == null ? void 0 : cachedData.dataVersion) !== serverVersion) {
11406
+ const response = yield instance.get(`${UC_CONTEXT}/tree/uc-user/listUserTree`, { params });
11407
+ const dataValue = {
11408
+ dataVersion: serverVersion,
11409
+ response
11410
+ };
11411
+ setLocalStorage(DATAVERSION_KEY, dataValue);
11412
+ }
11413
+ return (_a = getLocalStorage(DATAVERSION_KEY)) == null ? void 0 : _a.response;
11414
+ });
11316
11415
  }
11317
11416
  export { Base64ForLogin, CONTENT_TYPE, IS_OR_NOT_ENUM, IS_OR_NOT_ENUM_KEY, IS_OR_NOT_ENUM_LIST, MIME_TYPE, UC_ENUM, addMenuCollectApi, instance as axios, base64ToBlob, blobToBase64, checkIdCard, checkPhone, checkTel, checkVehicleNo, clearIndexDescCache, clearPermissionCache, clearSessionStorage, clearUserInfoCache, config, cryptor, deleteMenuCollectApi, deleteMenuHistoryApi, exportJsonToExcel, flattenRow2ColumnData, formatDate, formatDateChinese, formatDecimal, formatHalfYear, formatQuarter, getAppListApi, getCaptchaURL, getContentType, getDictApi, getDictMapApi, getDictsMapApi, getExcelColumnIdx, getGlobalPolicyApi, getHalfYear, getHalfYearBeginMonth, getHalfYearEndMonth, getHalfYearNum, getIndexDescCache, getItem, getLocalStorage, getMaxTabNumValueApi, getMenuCollectApi, getMenuHistoryApi, getOssFileApi, getOssFileUrl, getPermissionApi, getPermissionCache, getPreviewUrlApi, getPriceInfo, getQuarter, getQuarterBeginMonth, getQuarterEndMonth, getQuarterNum, getSessionStorage, getToken, getType, getUrlParams, getUserInfoApi, getUserInfoCache, guid, importJsonFromExcel, isArguments, isArray, isArrayLike, isBoolean, isDate, isDecimal, isElement, isEmpty, isEqual, isEqualWith, isError, isEven, isFinite$1 as isFinite, isFunction, isInteger, isNegative, isNil, isNull, isNumber, isNumberEqual, isObject, isObjectLike, isOdd, isPlainObject, isPositive, isPromise, isPrototype, isRegExp2 as isRegExp, isString, isType, isUndefined, listComTreeApi, listIndexDescApi, listItemTreeApi, listUserTreeApi, loginApi, logoutApi, menuHistoryApi, numToChineseNumerals, numToDX, off, on, preventDefault, putOssFileApi, putOssFileUrl, quarter2Chinese, removeLocalStorage, removeMenuCollectApi, removeSessionStorage, renderColumnEnums, renderEnumData, renderEnumList, renderFieldEnums, responseInterceptors, round, row2column, setConfig, setContentType, setIndexDescCache, setLocalStorage, setPermissionCache, setSessionStorage, setToken, setUserInfoCache, stopPropagation, str2Date, toChies, toFixed, toThousands, updatePasswordApi, useConfig, uuid, wrapApi };