4.4.104 • Published 12 months ago

@patrtorg/distinctio-ea v4.4.104

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

@patrtorg/distinctio-ea 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('@patrtorg/distinctio-ea');

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 @patrtorg/distinctio-ea 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 @patrtorg/distinctio-ea npm package!

posefastclonehardlinksArray.prototype.includesvaluesObject.entriesfunctionscss variablepersistentdatabufferformatuser-streamsstylingletsafewalktypeofpackage.jsonconsumeregexECMAScript 2021forkstringassignsubprocesspromiseimportiamlistenerstimees6mockingwidthpreprocessorjson-schemaworkflowbannerparsetoolkitpatchnested cssglobalThiselbstructuredClonenopeES2023numberinputcsswhichdescriptorsprogresstyped arraybundlingObject.getPrototypeOfsomeserializerbootstrap csstrimStartArray.prototype.filterstateoncecallboundECMAScript 5shimloadbalancingterminalartiterationcoreinterruptsCSSStyleDeclarationopensslfull-widthdataViewes5jsonschemaclientreducerelasticachelinkchromiumhttpinternalInt8Arraypoint-freehandlertypesafeJSON-SchemajsxhooksemitsetPrototypeOfECMAScriptoptimizertelephonevariables in cssloadingtypes3mixinscloudwatchchaimatchessymlinksESnextreduxastJSONreadprotobuftesteryamlloggingstatelessStreamhttpsremovestreamES2015ebskoreancore-jsdependencieslocalsequenceelectronspinnerscjkES2021momentutil.inspecttrimLeftkinesisformattingconstpnpm9compile lessrequiredom-testing-libraryconfigcolorscensorfast-deep-clonetypedarrayglacierserializeprotocol-buffersECMAScript 3callbindsuperagentarrayinstallererrorapollorobustpostcsssimpledbpredictableUint8ArrayES6shamdeep-clonediffdefineformsigintcallbackreusees2018styleguidefunctiontypeerrorcryptencryptionomitbusycreatefigletbuffersTypeBoxgraphql3diteratorpackage managernativeuninstallUint32ArraydirectorypasswordjsdomchannelvestsuperstructloggersettingsSymbol.toStringTagrdstransportsideclassesTypedArrayajvobjproxytoSortedawsES2017lesscssescapetacitbrowserlistreduceprefixRegExp.prototype.flagswaapiserverfindforEachenderxtermfile systemserializationauthenticationvpcsetImmediatecopylanguageminimalconcatMapignoreeslintplugingesturesrecursivewhatwgcss nestinghookformaccessortoobjectjQueryprototypeapistreamsFloat64ArrayfnmatchstringifykeyspositiveStreamsarktypeenvairbnbwindowsmkdirsreact-hook-formxhrsortutilitiestrimEndfindLastgetterroute53deep-copyjsdiffgetoptECMAScript 2015springieBigInt64ArraycloneECMAScript 6variablesansiWeakMapfastReactiveXeast-asian-widtheventDispatcherawesomesaucePromisegradients css3fromphonelintBigUint64ArrayfsES5workeres2015consolesnscolumnlockfileglobal objectoffsetregular-expressionrapidinferencestringifierglobal this valueECMAScript 7randomspinnerArrayBuffer#slicetoArraydeepclonequoteWebSocketextrajson-schema-validatorequalreact-hooksObjecttermtouchcachejavascriptgetOwnPropertyDescriptorSetpurejsondomcolormulti-packageless.jscommanderdeterministicnodejsshebangIteratorArray.prototype.flatassertimmutablehasOwnPropertyfileutiloption_.extendfantasy-landes-shimsString.prototype.trimmappropertypinoauthequalitysymbolcliinstallrequestzxeslintECMAScript 2016groupByconfigurablecertificateswritenameswritableflagsec2helperperformantnodeinspectcall-boundspawnArray.prototype.flattencomputed-typescloudformationsyntaxes2017dotenvischilddirtranspileInt16ArrayWebSocketslogprivate dataestreehasOwnexecutel10nes7routingArrayBufferpicomatchhaseventsframerpackagesindicatorautoprefixerdefinePropertyES2018es-shim APIECMAScript 2017immerregexpenvironmentcomparebcryptMicrosoftECMAScript 2019react-componentES7regular expressionweaksetpushcss lessObject.assignmrusignalmakefiltersqsjestasterisksintrinsicmoduleses2016[[Prototype]]setArray.prototype.flatMapeverydescriptionYAMLbinidentifiersdependency managerbinarieslinuxjson-schema-validationArrayassertionfluxRFC-6455unicodeargsObject.definePropertyargvcss-in-jsqueuepropvarstrimMapvalidationsesidlebeanstalkvalidclassnametestingobjectpreserve-symlinksamazonboundlibphonenumberexecfilebddselfcheckObject.valuesbyteLengthrangeerrorTypeScriptReactiveExtensionsgetexpressES2022querystringdynamodbbabel-corecurlfindLastIndexslicemocktddtoStringTagshrinkwrapprivatetslibnpmignoremacosRxJSponyfilloptimistpostcss-pluginstablelrusignedutilityurleslint-pluginvalidateinvariantlocationrgbflatMapbyteOffsetinternal slotmobileES8flagflattenstylehigher-orderecmascript0emrgetPrototypeOfjapaneseexpressionasciiincludeswindowexectextautoscalingstylesoperating-systemdescriptorbrowserliveObservableisConcatSpreadablereacttsgradients csscoercibleSystem.globalcallglobreact-testing-librarySymbolarraybufferstatusfpmake dirspecRxArray.prototype.findLastmapreducejwtcommand-lineUint8ClampedArraytypescript.gitignoreFunction.prototype.namecollection.es6typanionURLObservablespopmotiondataviewReflect.getPrototypeOfflatschemaweakmapqueueMicrotaskessortedmonorepoString.prototype.matchAllhotmergefastifyeventEmitterAsyncIteratorfullstoragegatewayES3readablestreamdeepcopyentriesasyncclass-validatorfast-clonevalueendpointcompilerexitdropwarning@@toStringTaginArray.prototype.findLastIndexless compilerstylesheetperformancenegativepyyamlredirectroutezeroprune
4.4.102

12 months ago

4.4.103

12 months ago

4.4.104

12 months ago

4.4.101

12 months ago

4.4.100

12 months ago

3.4.100

12 months ago

3.4.99

1 year ago

3.4.98

1 year ago

3.4.97

1 year ago

3.4.96

1 year ago

3.4.95

1 year ago

3.4.94

1 year ago

2.4.94

1 year ago

2.4.93

1 year ago

2.4.92

1 year ago

2.4.91

1 year ago

2.4.90

1 year ago

2.4.89

1 year ago

2.4.88

1 year ago

2.4.87

1 year ago

2.4.86

1 year ago

2.4.85

1 year ago

2.4.84

1 year ago

2.4.83

1 year ago

2.4.82

1 year ago

2.4.81

1 year ago

2.4.80

1 year ago

2.4.79

1 year ago

2.4.78

1 year ago

2.4.77

1 year ago

2.4.76

1 year ago

2.4.75

1 year ago

2.4.74

1 year ago

2.3.74

1 year ago

2.3.73

1 year ago

2.3.72

1 year ago

2.3.71

1 year ago

2.3.70

1 year ago

2.3.69

1 year ago

2.3.68

1 year ago

2.3.67

1 year ago

2.3.66

1 year ago

2.2.66

1 year ago

2.1.66

1 year ago

2.1.65

1 year ago

2.1.64

1 year ago

2.1.63

1 year ago

2.1.62

1 year ago

2.1.61

1 year ago

2.1.60

1 year ago

2.1.59

1 year ago

2.1.58

1 year ago

2.1.57

1 year ago

2.1.56

1 year ago

2.1.55

1 year ago

2.1.54

1 year ago

2.1.53

1 year ago

2.1.52

1 year ago

2.1.51

1 year ago

2.1.50

1 year ago

2.1.49

1 year ago

2.1.48

1 year ago

2.1.47

1 year ago

2.1.46

1 year ago

2.1.45

1 year ago

2.1.44

1 year ago

2.1.43

1 year ago

2.1.42

1 year ago

2.1.41

1 year ago

2.1.40

1 year ago

2.1.39

1 year ago

2.1.38

1 year ago

2.1.37

1 year ago

2.1.36

1 year ago

2.1.35

1 year ago

2.1.34

1 year ago

2.1.33

1 year ago

2.1.32

1 year ago

2.0.32

1 year ago

2.0.31

1 year ago

2.0.30

1 year ago

2.0.29

1 year ago

2.0.28

1 year ago

2.0.27

1 year ago

2.0.26

1 year ago

2.0.25

1 year ago

2.0.24

1 year ago

2.0.23

1 year ago

2.0.22

1 year ago

2.0.21

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

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