Comparing version 1.0.0 to 1.1.0
'use strict'; | ||
const pSome = require('p-some'); | ||
module.exports = iterable => pSome(iterable, 1).then(values => values[0]); | ||
module.exports = (iterable, opts) => pSome(iterable, Object.assign({}, opts, {count: 1})).then(values => values[0]); | ||
module.exports.AggregateError = pSome.AggregateError; |
{ | ||
"name": "p-any", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Wait for any promise to be fulfilled", | ||
@@ -31,3 +31,2 @@ "license": "MIT", | ||
"fulfilled", | ||
"race", | ||
"fastest", | ||
@@ -42,12 +41,9 @@ "one", | ||
"dependencies": { | ||
"p-some": "^1.0.0" | ||
"p-some": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "*", | ||
"delay": "^1.3.1", | ||
"delay": "^2.0.0", | ||
"xo": "*" | ||
}, | ||
"xo": { | ||
"esnext": true | ||
} | ||
} |
@@ -13,3 +13,3 @@ # p-any [![Build Status](https://travis-ci.org/sindresorhus/p-any.svg?branch=master)](https://travis-ci.org/sindresorhus/p-any) | ||
``` | ||
$ npm install --save p-any | ||
$ npm install p-any | ||
``` | ||
@@ -39,3 +39,3 @@ | ||
### pAny(input) | ||
### pAny(input, [options]) | ||
@@ -48,2 +48,12 @@ Returns a `Promise` that is fulfilled when any promise from `input` is fulfilled. If all the `input` promises reject, it will reject with an [`AggregateError`](https://github.com/sindresorhus/aggregate-error) error. | ||
#### options | ||
Type: `Object` | ||
##### filter | ||
Type: `Function` | ||
Receives the value resolved by the promise. Used to filter out values that doesn't satisfy a condition. | ||
### pAny.AggregateError | ||
@@ -57,2 +67,3 @@ | ||
- [p-some](https://github.com/sindresorhus/p-some) - Wait for a specified number of promises to be fulfilled | ||
- [p-locate](https://github.com/sindresorhus/p-locate) - Get the first fulfilled promise that satisfies the provided testing function | ||
- [More…](https://github.com/sindresorhus/promise-fun) | ||
@@ -59,0 +70,0 @@ |
Sorry, the diff of this file is not supported yet
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
3693
71
+ Addedp-some@2.0.1(transitive)
- Removedp-some@1.2.1(transitive)
Updatedp-some@^2.0.0