1.2.4 • Published 5 days ago

@teamteanpm2024/ab-asperiores-deserunt v1.2.4

Weekly downloads
-
License
MIT
Repository
github
Last release
5 days ago

@teamteanpm2024/ab-asperiores-deserunt Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

ES Proposal spec-compliant shim for Promise.prototype.finally. Invoke its "shim" method to shim Promise.prototype.finally 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 proposed spec.

Most common usage:

var assert = require('assert');
var promiseFinally = require('@teamteanpm2024/ab-asperiores-deserunt');

var resolved = Promise.resolve(42);
var rejected = Promise.reject(-1);

promiseFinally(resolved, function () {
	assert.equal(arguments.length, 0);

	return Promise.resolve(true);
}).then(function (x) {
	assert.equal(x, 42);
});

promiseFinally(rejected, function () {
	assert.equal(arguments.length, 0);
}).catch(function (e) {
	assert.equal(e, -1);
});

promiseFinally(rejected, function () {
	assert.equal(arguments.length, 0);

	throw false;
}).catch(function (e) {
	assert.equal(e, false);
});

promiseFinally.shim(); // will be a no-op if not needed

resolved.finally(function () {
	assert.equal(arguments.length, 0);

	return Promise.resolve(true);
}).then(function (x) {
	assert.equal(x, 42);
});

rejected.finally(function () {
	assert.equal(arguments.length, 0);
}).catch(function (e) {
	assert.equal(e, -1);
});

rejected.finally(function () {
	assert.equal(arguments.length, 0);

	throw false;
}).catch(function (e) {
	assert.equal(e, false);
});

Tests

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

Thanks

Huge thanks go out to @matthew-andrews, who provided the npm package name for v2 of this module. v1 is both in the original repo and preserved in a branch

schemescheme-validationcloudfrontgdproptionArrayshrinkwraptoArrayresolvecommand-lineprefixECMAScript 2015shamkeyES2016parserjson-schema-validationextensiondefinePropertytypescriptmoveenumerableratelimitPushuuidmake dirjson-schemahookspluginassertiondirectoryqueryyupautoprefixerebsa11ycoreoncefileguidRFC-6455configurableiteratorextrainternalSymbol.toStringTagequalArray.prototype.flatMapsyntaxmomentes8copyES2020globzeroclassnamestacitReactiveExtensionsphonepackagenegative zerotypeerrordeepcopycompilercloudformationponyfillprettyArray.prototype.includesoptimistArray.prototype.filtercloudtrailUint8ClampedArrayajaxauthuninstallbindprivate dataquotebrowseroutputhttps.envutilitiesArray.prototype.flatreact-hook-formArrayBuffer#sliceJSON-SchemachromiumlogArray.prototype.containsstablereadablestreamawsinternal slotfunctionbounddeep-clonefull-widthtypelruhigher-orderyamlcall-bindarraysvaluessignalmimetypesagentflagscodesargsECMAScript 6statelesselectronlimitthreeTypeBoxiampropertyinstallstylespinnersstringifytypesafeincludespnpm9Array.prototype.findLastIndexintrinsicgetoptcss lessmatchestostringtagmiddlewarereduxjsxless mixinsregular expressioncorsenderwebstreamajvlistenersrm -frbeanstalkeast-asian-widtheslintinference-0touchvestnativeshebangparseenvironmentconfigomittapeerror-handlingES2021propertiesloadbalancinginvariantestypedarraysutilitysnsdeepairbnbES2023createes6autoscalingreact-testing-librarysetterbreaktoStringTagmergetypanionreact animationshellbundlerfunctionalsettingssigintsetPrototypeOfESBigUint64ArraylinksymlinklessfastifyenvsanitizestringtypeofframeworkjQuerysideoperating-systemobjstringifiermacosargves-shim APIbrowserslistmocha256toobjectspinnertypedeveryes2018MapdynamodbpyyamlSetpostcssstyled-componentseventsidlepositivejsdiffawaitargparsefindupURLpipeless compilerFloat64ArraydebugdescriptorsequalitybannertscolumnwriteYAMLpasswordregexpnumberwaitbrowserlistreactes5ECMAScript 2020__proto__negatives3visualStreamramda0serializegetPrototypeOfwatchFilefile systemcloudwatchmatchclassnameasyncutil.inspectchineseloggingcode pointsmapgradients css3linewrapstyleguideremoveRegExp#flagscharacterprogresssameValueZerowarningcallflattencss variablecolumnsfigletUint16Arrayschemajsonschemastatuspackage managertestObject.entriesreadtapsomepatchttyvalidationqsxtermcryptspeedprototypeReflect.getPrototypeOffolderpicomatchjapanesetestingstarterdataViewtrimLeftdom-testing-librarycallbackassignfast-copybcryptchannelmrugroupByArray.prototype.flattenregular expressionstoolsreducetypedarrayconcatbluebirdbabelmixinsframerelbcheckmapreducesuperstructrgbcss-in-jsratebufferinterruptsencryptionJSONregexmkdirpathfind-upjsdomWebSockets3dbundlinges2016fast-cloneObject.isObservablesuser-streamskinesisWebSocketObject.definePropertyfunctionswafless csshasOwncolorsxhrcommanderi18nreal-timeRegExp.prototype.flagstesterconnectwindowsspecassertexecavaviewdebuggerpushredacttranspilerstoragegatewaysanitizationcolournodejswordwrapvalidatorObject.assignstylesheetes2015immutableES3gesturesparentInt32ArrayinputgetOwnPropertyDescriptorObject.getPrototypeOffilterworkflowUint32Arraylookelasticachesetiterationbddpersistentimportcallbindbatches7jasminesortedutilsArrayBuffer.prototype.sliceReactiveXfantasy-landWeakSetrobustfsconsolebootstrap lesseventEmitterprotoduplexES2018escapejson-schema-validatorjoiworkspace:*regularmetadatahandlersarraybufferTypedArrayperformanteslintconfigreact-hookscensorES2015jsonpathclassesHyBi@@toStringTagECMAScript 7chaipackage.jsontc39Int16ArraysymbolIteratorwalkio-tsES8transpileperformanceweakmapcss nestingwhatwgWeakMapcircularpreserve-symlinksrmdirgenericsreuserequirespringwatchingzodkarmawidthexitcssconsumeformattinglook-upfromchromeletmkdirsnamesrdsmime-dbharmonyUint8Arraybootstrap csscommandECMAScript 2019Float32Arraycolorunicodewgetroute53eventDispatcherrangeerrorlinuxpromisesdragrandomdataopensortrm -rfindicator
1.2.4

5 days ago

1.2.3

6 days ago

1.1.3

7 days ago

1.1.2

8 days ago

1.1.1

9 days ago

1.0.1

10 days ago

1.0.0

11 days ago