Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

p-any

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

p-any - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

2

index.js
'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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc