Comparing version 0.4.3 to 0.4.4
@@ -10,8 +10,6 @@ 'use strict'; | ||
* | ||
* Settles (resolves or rejects) every $[mixed value] in the input array, and resolves | ||
* with an array of results, if all values have been resolved, or else rejects. | ||
* Settles (resolves or rejects) every $[mixed value] in the input array. | ||
* | ||
* This method resembles a fusion of `promise.all` + `promise.settle` logic, to resolve with | ||
* the same type of result as `promise.all`, while also settling all the promises, similar to | ||
* `promise.settle`, adding comprehensive details in case of a reject. | ||
* The method resolves with an array of results, the same as the standard `promise.all`, | ||
* while providing comprehensive error details in case of a reject. | ||
* | ||
@@ -28,3 +26,3 @@ * <img src="../images/batch.png" width="836px" height="210px" alt="batch"> | ||
* | ||
* Parameters: | ||
* Callback Parameters: | ||
* - `index` = index of the value in the source array | ||
@@ -48,4 +46,4 @@ * - `success` - indicates whether the value was resolved (`true`), or rejected (`false`) | ||
* @returns {Promise} | ||
* Result for the entire batch, which resolves when every value in the input array has been resolved, | ||
* and rejects when: | ||
* Result for the entire batch, which resolves only when every value in the input array has been | ||
* resolved, and rejects when: | ||
* - one or more values rejected or threw an error while being resolved as a $[mixed value] | ||
@@ -67,11 +65,5 @@ * - notification callback returned a rejected promise or threw an error | ||
* - property `first` - returns the very first error within the array, with support for nested `batch` results, | ||
* so it is not the same as simply calling `getErrors()[0]` | ||
* which is the same error as `promise.all` would provide. | ||
* - property `message` is a safe version of `first.message` | ||
* | ||
* In addition, the rejection array is extended with function `getErrors`, which returns the list of just | ||
* errors, with support for nested batch results. Calling `getErrors()[0]`, for example, will get the same | ||
* result as the rejection reason that `promise.all` would provide (unless it is a nested `batch` result). | ||
* | ||
* The rejection array is also extended with property `message` that returns | ||
* | ||
* In all cases, the output array is always the same size as the input one, this way providing index mapping | ||
@@ -177,3 +169,3 @@ * between the input values and the results. | ||
$utils.extend(result, 'first', err); | ||
$utils.extend(result, 'message', (err && err.message) || err); | ||
$utils.extend(result, 'message', err && err.message || err); | ||
reject(result); | ||
@@ -180,0 +172,0 @@ } else { |
{ | ||
"name": "spex", | ||
"version": "0.4.3", | ||
"version": "0.4.4", | ||
"description": "Specialized Promise Extensions", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
78331
21
0
65
2061