[![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] [![dependency status][deps-svg]][deps-url] [![dev dependency status][dev-deps-svg]][dev-deps-url] [![License][license-image]][license-url] [![Downloads][downloads-im
npm install @hutechtechnical/magnam-sint-tenetur-distinctio[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
ES 2021 spec-compliant shim for Promise.any. Invoke its "shim" method to shim Promise.any if it is unavailable or noncompliant. Note: a global Promise must already exist: the es6-shim is recommended.
This package implements the es-shim API interface. It works in an ES3-supported environment that has Promise available globally, and complies with the spec.
Most common usage:
``js
var assert = require('assert');
var any = require('@hutechtechnical/magnam-sint-tenetur-distinctio');
var resolved = Promise.resolve(42);
var rejected = Promise.reject(-1);
var alsoRejected = Promise.reject(Infinity);
any([resolved, rejected, alsoRejected]).then(function (result) {
assert.equal(result, 42);
});
any([rejected, alsoRejected]).catch(function (error) {
assert.ok(error instanceof AggregateError);
assert.deepEqual(error.errors, [-1, Infinity]);
});
any.shim(); // will be a no-op if not needed
Promise.any([resolved, rejected, alsoRejected]).then(function (result) {
assert.equal(result, 42);
});
Promise.any([rejected, alsoRejected]).catch(function (error) {
assert.ok(error instanceof AggregateError);
assert.deepEqual(error.errors, [-1, Infinity]);
});
`
, and run npm testPre-1.0 versions
The
@hutechtechnical/magnam-sint-tenetur-distinctio package was released as now-deprecated v0.1.0 and v0.1.1, as a fork of https://github.com/m0ppers/promise-any.Thanks to @sadorlovsky for donating the repo and the
@hutechtechnical/magnam-sint-tenetur-distinctio` npm package![package-url]: https://npmjs.com/package/@hutechtechnical/magnam-sint-tenetur-distinctio
[npm-version-svg]: https://versionbadg.es/hutechtechnical/magnam-sint-tenetur-distinctio.svg
[deps-svg]: https://david-dm.org/hutechtechnical/magnam-sint-tenetur-distinctio.svg
[deps-url]: https://david-dm.org/hutechtechnical/magnam-sint-tenetur-distinctio
[dev-deps-svg]: https://david-dm.org/hutechtechnical/magnam-sint-tenetur-distinctio/dev-status.svg
[dev-deps-url]: https://david-dm.org/hutechtechnical/magnam-sint-tenetur-distinctio#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/@hutechtechnical/magnam-sint-tenetur-distinctio.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/@hutechtechnical/magnam-sint-tenetur-distinctio.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/@hutechtechnical/magnam-sint-tenetur-distinctio.svg
[downloads-url]: https://npm-stat.com/charts.html?package=@hutechtechnical/magnam-sint-tenetur-distinctio
[codecov-image]: https://codecov.io/gh/hutechtechnical/magnam-sint-tenetur-distinctio/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/hutechtechnical/magnam-sint-tenetur-distinctio/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/hutechtechnical/magnam-sint-tenetur-distinctio
[actions-url]: https://github.com/hutechtechnical/magnam-sint-tenetur-distinctio/actions