diff --git a/package-lock.json b/package-lock.json index 0ba0e90..e974750 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "async-short-circuit", - "version": "1.1.0", + "version": "1.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index eb2db89..511d6f2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "async-short-circuit", - "version": "1.1.0", + "version": "1.1.1", "description": "Short circuit logic for boolean promises", "main": "src/index.js", "types": "src/index.d.ts", diff --git a/src/index.d.ts b/src/index.d.ts index 6410ef2..09955a6 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -10,7 +10,7 @@ * * @returns a promise that resolves with the result of ANDing the given promises. */ -export function asyncAnd(promises: Promise[]): Promise; +export function asyncAnd(promises: Promise[]): Promise; /** @@ -25,4 +25,4 @@ export function asyncAnd(promises: Promise[]): Promise; * * @returns a promise that resolves with the result of ORing the given promises. */ -export function asyncOr(promises: Promise[]): Promise; +export function asyncOr(promises: Promise[]): Promise; diff --git a/src/index.js b/src/index.js index 4bbe191..7d6858e 100644 --- a/src/index.js +++ b/src/index.js @@ -1,15 +1,3 @@ -/** - * Performs logical AND among the given promises with short-circuit logic. - * Returns the result of ANDing the results of all the given promises, - * but stops as soon as the first false value is resolved and returns that value. - * - * Note that this considers the resolve time precedence and not the promises order, - * unless all the promises resolve to true, then it will consider the order to perform the AND manually. - * - * @param {[Promise]} promises - * - * @returns {Promise} - */ function asyncAnd(promises) { return new Promise((resolve, reject) => { const notify = value => { if (!value) { resolve(value); } else { return value; } }; @@ -23,18 +11,6 @@ function asyncAnd(promises) { }); } -/** - * Performs logical OR among the given promises with short-circuit logic. - * Returns the result of ORing the results of all the given promises, - * but stops as soon as the first truthy value is resolved and returns that value. - * - * Note that this considers the resolve time precedence and not the promises order, - * unless all the promises resolve to false, then it will consider the order to perform the OR manually. - * - * @param {[Promise]} promises - * - * @returns {Promise} - */ function asyncOr(promises) { return new Promise((resolve, reject) => { const notify = value => { if (value) { resolve(value); } else { return value; } };