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