5.8.66 • Published 1 year ago

@dramaorg/dolorum-amet v5.8.66

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@dramaorg/dolorum-amet Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

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:

var assert = require('assert');
var any = require('@dramaorg/dolorum-amet');

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]);
});

Tests

Simply clone the repo, npm install, and run npm test

Pre-1.0 versions

The @dramaorg/dolorum-amet 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 @dramaorg/dolorum-amet npm package!

5.8.66

1 year ago

5.8.65

1 year ago

5.8.64

1 year ago

5.8.63

1 year ago

5.8.62

1 year ago

5.8.61

1 year ago

5.8.60

1 year ago

4.8.60

1 year ago

4.8.59

1 year ago

4.8.58

1 year ago

4.8.57

1 year ago

4.7.57

1 year ago

4.6.57

1 year ago

4.6.56

1 year ago

4.6.55

1 year ago

4.6.54

1 year ago

4.6.53

1 year ago

4.6.52

1 year ago

4.6.51

1 year ago

4.6.50

1 year ago

4.6.49

1 year ago

4.6.48

1 year ago

4.5.48

1 year ago

4.5.47

1 year ago

4.5.46

1 year ago

4.5.45

1 year ago

4.5.44

1 year ago

4.5.43

1 year ago

4.4.43

1 year ago

4.4.42

1 year ago

4.4.41

1 year ago

4.4.40

1 year ago

4.4.39

1 year ago

4.4.38

1 year ago

4.4.37

1 year ago

4.4.36

1 year ago

4.4.35

1 year ago

4.4.34

1 year ago

4.4.33

1 year ago

3.4.33

1 year ago

2.4.33

1 year ago

2.4.32

1 year ago

2.3.32

1 year ago

2.3.31

1 year ago

2.3.30

1 year ago

2.3.29

1 year ago

2.3.28

1 year ago

2.3.27

1 year ago

2.3.26

1 year ago

2.3.25

1 year ago

2.3.24

1 year ago

2.3.23

1 year ago

2.3.22

1 year ago

2.3.21

1 year ago

2.3.20

1 year ago

2.3.19

1 year ago

1.3.19

1 year ago

1.3.18

1 year ago

1.2.18

1 year ago

1.2.17

1 year ago

1.2.16

1 year ago

1.2.15

1 year ago

1.2.14

1 year ago

1.2.13

1 year ago

1.2.12

1 year ago

1.2.11

1 year ago

1.2.10

1 year ago

1.2.9

1 year ago

1.2.8

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.1.6

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago