util-helpers 4.20.3 → 4.20.5

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.
@@ -103,7 +103,7 @@
103
103
  return typeof value === 'number' || objectToString.call(value) === numberTag;
104
104
  }
105
105
 
106
- function isNaN$1(value) {
106
+ function isNaN(value) {
107
107
  return isNumber(value) && root$1.isNaN(value);
108
108
  }
109
109
 
@@ -539,7 +539,7 @@
539
539
  ret = Number(value);
540
540
  }
541
541
  }
542
- return typeof ret === 'number' && !Number.isNaN(ret);
542
+ return typeof ret === 'number' && !isNaN(ret);
543
543
  }
544
544
 
545
545
  /******************************************************************************
@@ -671,7 +671,7 @@
671
671
  if (ret === '') {
672
672
  ret = Number(ret);
673
673
  }
674
- else if (Number.isNaN(Number(ret))) {
674
+ else if (isNaN(Number(ret))) {
675
675
  ret = Number.NaN;
676
676
  }
677
677
  }
@@ -684,7 +684,7 @@
684
684
  else {
685
685
  ret = value;
686
686
  }
687
- if (Number.isNaN(ret)) {
687
+ if (isNaN(ret)) {
688
688
  return Number.NaN;
689
689
  }
690
690
  return ret;
@@ -764,7 +764,7 @@
764
764
 
765
765
  var reg = /^[+-]?\d*\.?\d*$/;
766
766
  function checkNumber(num) {
767
- if ((typeof num !== 'number' && typeof num !== 'string') || (typeof num === 'number' && isNaN$1(num)) || (typeof num === 'string' && (!(reg.test(num) || isScientificNumber(num)) || num === ''))) {
767
+ if ((typeof num !== 'number' && typeof num !== 'string') || (typeof num === 'number' && isNaN(num)) || (typeof num === 'string' && (!(reg.test(num) || isScientificNumber(num)) || num === ''))) {
768
768
  devWarn("".concat(num, " invalid parameter."));
769
769
  return false;
770
770
  }
@@ -809,7 +809,7 @@
809
809
  if (typeof num === 'number' && !isFinite(num)) {
810
810
  return num + '';
811
811
  }
812
- if (typeof precision !== 'number' || isNaN$1(precision) || precision < 0) {
812
+ if (typeof precision !== 'number' || isNaN(precision) || precision < 0) {
813
813
  precision = 2;
814
814
  }
815
815
  else if (precision > 10) {
@@ -1153,7 +1153,7 @@
1153
1153
  }
1154
1154
  num1 = transformEffectiveNumber(num1);
1155
1155
  num2 = transformEffectiveNumber(num2);
1156
- if (isNaN$1(num1) || isNaN$1(num2)) {
1156
+ if (isNaN(num1) || isNaN(num2)) {
1157
1157
  return Number.NaN;
1158
1158
  }
1159
1159
  var num1Changed = float2Fixed(num1);
@@ -1177,7 +1177,7 @@
1177
1177
  }
1178
1178
  num1 = transformEffectiveNumber(num1);
1179
1179
  num2 = transformEffectiveNumber(num2);
1180
- if (isNaN$1(num1) || isNaN$1(num2)) {
1180
+ if (isNaN(num1) || isNaN(num2)) {
1181
1181
  return Number.NaN;
1182
1182
  }
1183
1183
  var baseNum = Math.pow(10, Math.max(digitLength(num1), digitLength(num2)));
@@ -1197,7 +1197,7 @@
1197
1197
  }
1198
1198
  num1 = transformEffectiveNumber(num1);
1199
1199
  num2 = transformEffectiveNumber(num2);
1200
- if (isNaN$1(num1) || isNaN$1(num2)) {
1200
+ if (isNaN(num1) || isNaN(num2)) {
1201
1201
  return Number.NaN;
1202
1202
  }
1203
1203
  var baseNum = Math.pow(10, Math.max(digitLength(num1), digitLength(num2)));
@@ -1217,7 +1217,7 @@
1217
1217
  }
1218
1218
  num1 = transformEffectiveNumber(num1);
1219
1219
  num2 = transformEffectiveNumber(num2);
1220
- if (isNaN$1(num1) || isNaN$1(num2)) {
1220
+ if (isNaN(num1) || isNaN(num2)) {
1221
1221
  return Number.NaN;
1222
1222
  }
1223
1223
  var num1Changed = float2Fixed(num1);
@@ -1245,7 +1245,7 @@
1245
1245
  }
1246
1246
  num1 = Math.abs(round(num1));
1247
1247
  num2 = Math.abs(round(num2));
1248
- if (isNaN$1(num1) || isNaN$1(num2)) {
1248
+ if (isNaN(num1) || isNaN(num2)) {
1249
1249
  return Number.NaN;
1250
1250
  }
1251
1251
  if (num1 === 0 && num2 === 0) {
@@ -1377,17 +1377,22 @@
1377
1377
  resolve(img);
1378
1378
  }
1379
1379
  else {
1380
- ajax(img, __assign({ responseType: 'blob', headers: { 'sec-fetch-site': 'none' } }, ajaxOptions))
1380
+ ajax(img, __assign({ responseType: 'blob' }, ajaxOptions))
1381
1381
  .then(function (ev) {
1382
1382
  var responseStatus = ev.target.status;
1383
1383
  if (SuccessResponseStatus.indexOf(responseStatus) !== -1) {
1384
1384
  resolve(ev.target.response);
1385
1385
  }
1386
1386
  else {
1387
- reject(new Error("[loadImageWithBlob] The image does not support get requests, responseStatus ".concat(responseStatus, ", '").concat(img, "'.")));
1387
+ var err = new Error("[loadImageWithBlob] The image does not support get requests, responseStatus ".concat(responseStatus, ", '").concat(img, "'."));
1388
+ console.error(err);
1389
+ reject(err);
1388
1390
  }
1389
1391
  })
1390
- .catch(reject);
1392
+ .catch(function (err) {
1393
+ console.error(new Error("[loadImageWithBlob] Failed to request image. ".concat(err)));
1394
+ reject(err);
1395
+ });
1391
1396
  }
1392
1397
  });
1393
1398
  }
@@ -1688,7 +1693,7 @@
1688
1693
  function randomString(len, optionalChars) {
1689
1694
  if (len === void 0) { len = 0; }
1690
1695
  var realChars = typeof optionalChars === 'string' && optionalChars ? optionalChars : defaultChars;
1691
- return internalRandomString(len, realChars);
1696
+ return internalRandomString(toNumber(len), realChars);
1692
1697
  }
1693
1698
 
1694
1699
  function strlen(str) {
@@ -1971,9 +1976,9 @@
1971
1976
  return internalFindTreeSelect(tree, predicate, childrenField);
1972
1977
  }
1973
1978
 
1974
- var VERSION = "4.20.3";
1979
+ var VERSION = "4.20.5";
1975
1980
 
1976
- var version = "4.20.3";
1981
+ var version = "4.20.5";
1977
1982
 
1978
1983
  exports.VERSION = VERSION;
1979
1984
  exports.ajax = ajax;