Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Test whether some promise passes a testing function
Like Array.some
for promises.
$ npm install --save p-one
const pOne = require('p-one');
const getContinent = require('get-continent'); // not a real module
const places = [
getCapital('Norway').then(info => info.name),
'Bangkok, Thailand',
'Berlin, Germany',
'Tokyo, Japan'
];
const testingFunction = x => getContinent(x).then(x => x === 'europe');
pOne(places, testingFunction).then(result => {
console.log(result);
//=> true
});
Returns a Promise
that is fulfilled when any promise in input
and ones returned from testingFunction
are fulfilled, or rejects if any of the promises reject. The fulfilled value is a boolean
that is true
if any promise passed the test and false
otherwise.
Type: Iterable<Promise|any>
Iterated over concurrently in the testingFunction
function.
Type: Function
Expected to return a Promise<boolean>
or boolean
.
Type: Object
Type: number
Default: Infinity
Minimum: 1
Number of concurrently pending promises returned by testingFunction
.
MIT © Kevin Martensson
FAQs
Test whether some promise passes a testing function
The npm package p-one receives a total of 810 weekly downloads. As such, p-one popularity was classified as not popular.
We found that p-one demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.