@creejs/commons-lang 2.1.21 → 2.1.23

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.
@@ -1495,6 +1495,11 @@ function substringsBetween (str, startMarker, endMarker) {
1495
1495
  * @returns {string} The string representation of the value
1496
1496
  */
1497
1497
  function safeToString (value) {
1498
+ if (value === null) {
1499
+ return 'null'
1500
+ } else if (value === undefined) {
1501
+ return 'undefined'
1502
+ }
1498
1503
  let valueStr;
1499
1504
  try {
1500
1505
  valueStr = JSON.stringify(value);
@@ -1849,12 +1854,12 @@ function any (tasks) {
1849
1854
  errors.push(e);
1850
1855
  // all tasks failed
1851
1856
  if (errors.length >= tasks.length) {
1852
- deferred.reject(errors);
1857
+ deferred.reject(new AggregatedError('All Tasks Failed', errors));
1853
1858
  }
1854
1859
  });
1855
1860
  }
1856
1861
  if (errors.length === tasks.length) {
1857
- deferred.reject(errors);
1862
+ deferred.reject(new AggregatedError('All Tasks Failed', errors));
1858
1863
  }
1859
1864
  return deferred.promise
1860
1865
  }
@@ -2047,7 +2052,7 @@ async function parallelAny (tasks, maxParallel = 5) {
2047
2052
  // No task left, and No successful execution, reject with errors
2048
2053
  if (errors.length >= tasks.length) {
2049
2054
  if (deferred.pending) {
2050
- deferred.reject(errors);
2055
+ deferred.reject(new AggregatedError('All Tasks Failed', errors));
2051
2056
  return
2052
2057
  }
2053
2058
  }