util-helpers 4.21.2 → 4.21.4

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.
@@ -475,19 +475,30 @@
475
475
  return reg$4.test(valueStr);
476
476
  }
477
477
 
478
+ var URLExisted = typeof URL !== 'undefined';
479
+
480
+ var objectKeys = Object.keys;
481
+ var objectValues = Object.values;
482
+ var createObjectURL = URLExisted ? URL.createObjectURL : constant('');
483
+ var revokeObjectURL = URLExisted ? URL.revokeObjectURL : noop;
484
+
478
485
  var chineseDictionary = {
479
486
  chineseBasic: '[\u4e00-\u9fa5]',
480
- chineseExtend: '[\u9ea6-\u9fef]',
481
- chineseExtendA: '[\u3400-\u4DB5]',
482
- chineseExtendB: "[\uD840\uDC00-\uD869\uDED6]",
483
- chineseExtendC: "[\uD869\uDF00-\uD86D\uDF34]",
487
+ chineseExtend: '[\u9ea6-\u9fff]',
488
+ chineseExtend2: '[\uF900-\uFAD9]',
489
+ chineseExtendA: '[\u3400-\u4DBF]',
490
+ chineseExtendB: "[\uD840\uDC00-\uD869\uDEDF]",
491
+ chineseExtendC: "[\uD869\uDF00-\uD86D\uDF38]",
484
492
  chineseExtendD: "[\uD86D\uDF40-\uD86E\uDC1D]",
485
493
  chineseExtendE: "[\uD86E\uDC20-\uD873\uDEA1]",
486
- chineseExtendF: "[\uD873\uDEB0-\uD87A\uDFE0]"
494
+ chineseExtendF: "[\uD873\uDEB0-\uD87A\uDFE0]",
495
+ chineseExtendG: "[\uD880\uDC00-\uD884\uDF4A]",
496
+ chineseExtendH: "[\uD884\uDF50-\uD888\uDFAF]",
497
+ chineseExtendI: "[\uD87A\uDFF0-\uD87B\uDE5D]"
487
498
  };
488
499
  var looseChineseRegExp = chineseDictionary.chineseBasic + '+';
489
500
  var chineseRegExp = '^' + chineseDictionary.chineseBasic + '+$';
490
- var chineseWithExtend = '(?:' + chineseDictionary.chineseBasic + '|' + chineseDictionary.chineseExtend + '|' + chineseDictionary.chineseExtendA + '|' + chineseDictionary.chineseExtendB + '|' + chineseDictionary.chineseExtendC + '|' + chineseDictionary.chineseExtendD + '|' + chineseDictionary.chineseExtendE + '|' + chineseDictionary.chineseExtendF + ')';
501
+ var chineseWithExtend = '(?:' + objectValues(chineseDictionary).join('|') + ')';
491
502
  var looseChineseExtendRegExp = chineseWithExtend + '+';
492
503
  var chineseExtendRegExp = '^' + chineseWithExtend + '+$';
493
504
  var supportRegExpUnicode = RegExp.prototype.hasOwnProperty('unicode');
@@ -1368,12 +1379,6 @@
1368
1379
  return divide(product, gcd.apply(void 0, __spreadArray([], __read(args), false)));
1369
1380
  }
1370
1381
 
1371
- var URLExisted = typeof URL !== 'undefined';
1372
-
1373
- var objectKeys = Object.keys;
1374
- var createObjectURL = URLExisted ? URL.createObjectURL : constant('');
1375
- var revokeObjectURL = URLExisted ? URL.revokeObjectURL : noop;
1376
-
1377
1382
  function ajax(url, options) {
1378
1383
  var _a = options || {}, _b = _a.method, method = _b === void 0 ? 'get' : _b, _c = _a.data, data = _c === void 0 ? null : _c, timeout = _a.timeout, headers = _a.headers, _d = _a.withCredentials, withCredentials = _d === void 0 ? false : _d, _e = _a.async, async = _e === void 0 ? true : _e, _f = _a.user, user = _f === void 0 ? null : _f, _g = _a.password, password = _g === void 0 ? null : _g, responseType = _a.responseType, onReadyStateChange = _a.onReadyStateChange, onLoadStart = _a.onLoadStart, onProgress = _a.onProgress, onAbort = _a.onAbort, onTimeout = _a.onTimeout, onError = _a.onError, onLoad = _a.onLoad, onLoadEnd = _a.onLoadEnd;
1379
1384
  return new Promise(function (resolve, reject) {
@@ -1981,11 +1986,14 @@
1981
1986
  if (childrenField && isArray(newItem[childrenField]) && newItem[childrenField].length > 0) {
1982
1987
  newItem[childrenField] = recusion(newItem[childrenField].slice());
1983
1988
  }
1984
- objectKeys(fieldNames).forEach(function (newKey) {
1989
+ var newKeys = objectKeys(fieldNames);
1990
+ newKeys.forEach(function (newKey) {
1985
1991
  var oldKey = fieldNames[newKey];
1986
1992
  if (oldKey in newItem) {
1987
1993
  newItem[newKey] = newItem[oldKey];
1988
- delKeys.push(oldKey);
1994
+ if (newKeys.indexOf(oldKey) === -1) {
1995
+ delKeys.push(oldKey);
1996
+ }
1989
1997
  }
1990
1998
  });
1991
1999
  if (delKeys.length > 0) {
@@ -2223,9 +2231,9 @@
2223
2231
  return internalFindTreeSelect(tree, predicate, childrenField);
2224
2232
  }
2225
2233
 
2226
- var VERSION = "4.21.2";
2234
+ var VERSION = "4.21.4";
2227
2235
 
2228
- var version = "4.21.2";
2236
+ var version = "4.21.4";
2229
2237
 
2230
2238
  exports.VERSION = VERSION;
2231
2239
  exports.ajax = ajax;