1.0.0 • Published 23 days ago

@ptkhanh94npm/voluptatibus-itaque-quos v1.0.0

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

@ptkhanh94npm/voluptatibus-itaque-quos 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('@ptkhanh94npm/voluptatibus-itaque-quos');

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

whatwges-shim APIargumentmacosfunctionsvarsymbolsi18ngdprimmermobileponyfillformsbyteECMAScript 2023characterthreekoreancjkconstruntimetestercall-boundfindupWeakMapwatchFile[[Prototype]]poseexpressionwalkingArray.prototype.flatfastcopyprefixwatchreact-hooksvariablesbyteLengthserializationdataviewgetPrototypeOfaccessibilitycreateprotobufprototypeless compilerWeakSetsymbolemitstyleajaxhashECMAScript 2022mapReflect.getPrototypeOfRFC-6455css variableshimauthenticationspecinvariantgradients css3trimStartcryptotddjson-schemaArrayperformancebabel-coreextensiondeterministicsomeObject.keysmake dirdataViewwaithooks-0callboundstringifiercss lessES2017sequenceclassnamesiterationfast-deep-copyPromiseglob.envrmdirObject.definePropertynopefilterfileforEachregexshebangecmascriptschemedom-testing-librarymkdirequalitywrapmixinslesscssterminalsortdomcorsdependency managerqueuemkdirstypedarraysreadArray.prototype.findLastpackage.jsonchineseES2023objpushvaluerequireoptiontoSortedparentsserializegetoptgetterspinnerstreamsintrinsic$.extendregularmochapatchomitcryptsidearrayassertionapolloflagshasES2022optimizersameValueZeroes6es5consumeclass-validatorrapid6to5ESsyntaxerrorlanguagees2016Array.prototype.flatMapfixed-widthdefinePropertyjson-schema-validatorrategraphqllengthshamlintBigInt64ArrayECMAScript 7Uint16ArraygetOwnPropertyDescriptorprivateexitObject.assigndragprunetoolsdeleteargvObjectSymboltrimEndasciiES2015duplexrangeerrorflatMaparktypesearchtrimRightlistenersjson-schema-validationresolvedependenciesmetadataArray.prototype.findLastIndexwritablestructuredClonecommand-linepyyamljsonschemamakekarmafindLastcode pointsbootstrap lessinternalbatchautoprefixerarraybufferpackageArray.prototype.filterpromisesES2018parsefastifyfseventstapES5Object.entriesparseransiES7xtermhelpersoffsetchromiumurlconcatdebuggerextrauser-streamsreducerindicatortouchchannelprogressreact animationconsolejsdiffbundlingconcatMapwordwrapmatchAllharmonytranspilesignals__proto__typeerrorfigletenvtraverseprettylimitedlazyfunctioneventEmitterjsoncurlArray.prototype.containsObject.fromEntriespromiseUint8ArrayArray.prototype.includesURLSearchParamseslintconfiginspecta11yquerystringjwtECMAScript 2020stylinggenericsfindcallbackWebSocketsjestgetintrinsicserializerpathdescriptorsmoduletrimObject.isworkertapeweakmapnested csscircularES2020stylesregular expressionseslint-plugindeepcopyutilitiescompile lesstostringtagvalidiettyformatshrinkwrapimmutablereal-timecollection.es6Float64Arraycore-jsloggingasyncdroptypemomentstreamnodejsequalhttpsreadablestreamlookcss-in-jspostcss-pluginhigher-orderArray.prototype.flattenpersistentuuidrandombrowserslistassignes2015rfc4122scheme-validationimportUnderscoresigtermassertmimecolumnmimetypeshasOwnes7SetpostcssECMAScript 2018bdddiffcachelockfilematchmovecolumnsJSONtses2017classestypeoffull-widthes8AsyncIteratorbyteOffsetstartertypanionTypeBoxJSON-SchemaviewexecTypedArrayformletFloat32ArrayyupcheckeslintpluginhookformmiddlewareeveryprotoawesomesaucedescriptioncallArrayBuffer#sliceclonebabelastquotesuperagentmergepluginfastclonequerycallbindpositiveRegExp.prototype.flagsrm -frhardlinksStreamsartdebugbundlerRxArrayBuffer.prototype.slicegroupBytoolkitbindES3propertystringifyairbnbdirectoryzodjavascriptstyleguideoutputstringslotperformantvalidatorObservableyamles2018ArrayBufferkeysMicrosofttoStringTagdeepcss nestingInt16Arraypackagesfast-deep-cloneString.prototype.matchAllbannertyped arrayfunctionalwindowswidthreducematchesStyleSheetcharactersphoneinferenceES2019censorcoretypescriptstatelesspicomatchECMAScript 2015loggerhttpfindLastIndexinstallerInt32Arrayinternal slotconfigenvironmenttoobjecterrorvalidationreadablesharedwordbreakupcolorsl10nfetchdirstableECMAScript 2017emojicomputed-typestc39taskwalkweaksetirqCSSStyleDeclarationESnextexit-codewhichflagreact poselessPushspringless.jsremovelook-uplibphonenumberjapanesepnpm9codesformatting@@toStringTagsignalqueueMicrotaskefficientiteratorflattennegative zeroStreames-abstractbluebirdstyled-componentssettervisualreact-hook-formchromestatuslinewraptypessetlinuxcontainsES2021installdeepclonewgetratelimitpipeexpresscomparebcryptcopynumberSymbol.toStringTagwarningnative3dmime-dbdotenvcoerciblefast-cloneObject.getPrototypeOfparentframerfsconnectHyBinodeunicodecommanderjsonpathWebSocketonceproperties0npmenumerablemodulesslicedayjsmulti-packagesettingsawaitajvrmarraysES2016collectionURLdatanamesmonoreponameframeworklinkbufferObject.valuesvariables in cssreduxestreetypesafejsxextendutilmrutypedarrayinputlastbrowserlogpreprocessortoArrayvestIteratorminimalredactbreakopentslibconcurrencychaioperating-systemECMAScript 2019YAMLredux-toolkitfastECMAScript 5writereactobjectcommandregular expressionnegativetakebootstrap cssthroatxhrES8frompackage managersharedarraybufferECMAScript 2016transpilerReactiveXsetImmediatecliconfigurableworkspace:*guidgetpolyfillrequestUint32ArrayutilityschemasuperstructsymlinksbusybrowserliststylesheetECMAScript 2021deep-copyassertssymlinkargparsecompilercssinterruptswaapipropECMAScript 3spinnerstestingwebargstimeisrm -rfrobustjsboundtestkeyuninstalleventsanimationapiprocessstreams2watchingcoloureventDispatcherenderclient
1.0.0

23 days ago