1.0.0 • Published 1 year ago

@hutechtechnical/magnam-sint-tenetur-distinctio v1.0.0

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

@hutechtechnical/magnam-sint-tenetur-distinctio 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('@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]);
});

Tests

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

Pre-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!

threevestconfigurableqstypesregular expressionsmimetypesfastclonefilecolorclisimpledbpushECMAScript 7openchinesepathswfnamesassigncloudfronttypeexpressioninspectkarmaES7bddJSON-Schemalintfunctioncall-bindsyntaxmapreduceamazonlookdayjsworkerbluebirdfulllockfilepicomatchpyyamltexttapeCSSwarningUnderscoreserializeminimalfolderes7writeagentregularsetImmediateasyncintrinsicdependency managerworkspace:*PromiseObject.keysdataViewguidwordbreakform-validationInt8Arraypostcss-plugines-shim API3dcall-boundschemaxdgcloudtrailpositivehas-ownjoiglobstylesFloat32ArrayWebSocketPushpropertiesES2019rfc4122mkdirspostcsssortedjQueryObjectwritableexpressajvtoSortedObject.assignyuparktypepersistentRFC-6455redactYAMLassertioncallsomerm -rfurlselbcollection.es6entriesdefinePropertygroupBytrimStartdynamodbprivate dataes-shimschromechromiumSymbolcontainscolumnsECMAScript 2021typedarraystermlastreuseECMAScript 2023execeventEmitterECMAScript 2022TypeScriptReactiveXreadablestreamtelephonetypescriptdropreact-hooksexecutablemetadataquotedatashelltoStringTagponyfilldescriptortraverseimmutableautoprefixerelectronhasOwnPropertywrapbyteeditorqueueArray.prototype.flatclonehttpshelperhttppackagestakecharsettypeerrorimmerenderlog@@toStringTagoncestringifysearchhardlinkstapformattingcurlassertsStyleSheetes2015Iteratorsuperstructincludesreadabletoobjectec2trimRightschemeparseriteratorES2022ArrayBufferchaideep-clonevariablescssvisualglobalspinnersString.prototype.matchAllesBigUint64ArraytaskObject.getPrototypeOfmulti-packageimportexportlinkdescriptiondataviewxtermtestcorefinduptimecommand-lineredux-toolkitnpmtestingBigInt64ArraydomES2023Int32Arraytyped arrayequaldeepclonestoragegatewayidfpses2016glaciersameValueZerorequireserializationes5languagehashbundlingroutingmake dirwebcharacterstdlibartjsonpathcollectionratecachezodStreamsjshintArray.prototype.containstrimwalkingomitargschannelspawnmapconsoletoolses8callbindinstallerphoneflatredirectvaluedependenciesshebanghaselasticacheloggingwebsitesesawsapiaccessibilityvaluesi18neventsextraautoscalingbyteOffsetjsspinnerxdg-openArray.prototype.flatMapidlestablerobustpropprotobufECMAScript 5streamESnexteventDispatcherfind-upmime-dbUint32ArrayURLSearchParamsES2021callbackidentifiersmimeWeakMapconcurrencypromisessafereact-testing-librarystringifierebsenumerablecolumnlimitstartarraysbundlerECMAScript 2015touchcoercibletrimLeftconsume[[Prototype]]fixed-widthclientrgbeslintes2017hookscompilersetPrototypeOfmonorepohookformdeletedirectoryrmdirshimconcatastfast-copyemra11yCSSStyleDeclarationworkflowES8vpclocationgetOwnPropertyDescriptorpropertyupprefixemitfigletisConcatSpreadableoptimistratelimitjsdomdatastructurevalidatefast-deep-copysortMapRegExp.prototype.flagsSetkoreanshamwaapigetPrototypeOfES5HyBicomputed-typesreduxcjkairbnboptionargumentthrottleES3makerandomasciistreams2parentperformantmatchmatchesdeep-copymovequeueMicrotaskarrayemojiassertfullwidthsuperagenttc39package.jsonEScopyestreeinvariantmatchAllpnpm9forEachcompareeast-asian-widthpopmotionreact poselauncheslintplugin.envFunction.prototype.namereducediraccessorcommanderttyreadindicatores-abstractdotenvremovenameECMAScript 2020symbolsES6concatMapbyteLengthnegative zerojesttypedreact-hook-formObservableweakmapreducerdatebatchargumentsUint8ClampedArraygraphqlrouteopenerutilitiesECMAScript 2017deepinferenceloadingserializerproxyglobalsexemodulesURLArray.prototype.findLastIndexcreateArrayBuffer.prototype.slicemomentparentsECMAScript 2018util.inspectroute53iconvscheme-validationparsingkeysfull-widtherrorawesomesauceapollocode pointsespreetsRxJSconvertbrowserlistlinewrapwhatwgendpointMicrosoftdragobjectobjTypedArraygdprquerystringReactiveExtensionsObject.fromEntriesoutputRxStreamruntimeSymbol.toStringTagnumberECMAScript 2016preserve-symlinksArraycmdvalidtslibmruweaksetECMAScript 6installUint16ArraybreakthroatkinesisreactchecklengthsetprettyiamlimitedfunctionscolorsObject.valuesdescriptorsflagbuffersprotocol-buffersextensionxhrjsdiffwidthyamlcommandbannermochadefineeslintconfigutilityformsReflect.getPrototypeOfES2020listenersArray.prototype.flattenio-tsuninstallsequencestylefilterterminalzeroiterationoptimizermergesnsenvsqsrdsescapeES2018function.lengthcore-jstddObject.entriesinternal slotspecjsoncloudwatchflattenrecursivecallboundframeworktesterrangeerrorfindLastbeanstalkstylingecmascriptregular expressionreal-timeAsyncIteratorrequeststreamsappcloudformationsyntaxerrorArray.prototype.filterreact animationresolveprototypeargvjapaneseansipluginprivatewordwrapwalkfast-deep-clonepatchl10nurlspringgroupframerspeednativechildrm -frflatMapisfunctionalpackagesettings
1.0.0

1 year ago