1.0.38 • Published 1 year ago

@zitterorg/quia-quasi-voluptas v1.0.38

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

@zitterorg/quia-quasi-voluptas

GitHub Workflow Status (branch) Coveralls github branch npm npm

Make a callback- or promise-based function support both promises and callbacks.

Uses the native promise implementation.

Installation

npm install @zitterorg/quia-quasi-voluptas

API

@zitterorg/quia-quasi-voluptas.fromCallback(fn)

Takes a callback-based function to @zitterorg/quia-quasi-voluptas, and returns the universalified function.

Function must take a callback as the last parameter that will be called with the signature (error, result). @zitterorg/quia-quasi-voluptas does not support calling the callback with three or more arguments, and does not ensure that the callback is only called once.

function callbackFn (n, cb) {
  setTimeout(() => cb(null, n), 15)
}

const fn = @zitterorg/quia-quasi-voluptas.fromCallback(callbackFn)

// Works with Promises:
fn('Hello World!')
.then(result => console.log(result)) // -> Hello World!
.catch(error => console.error(error))

// Works with Callbacks:
fn('Hi!', (error, result) => {
  if (error) return console.error(error)
  console.log(result)
  // -> Hi!
})

@zitterorg/quia-quasi-voluptas.fromPromise(fn)

Takes a promise-based function to @zitterorg/quia-quasi-voluptas, and returns the universalified function.

Function must return a valid JS promise. @zitterorg/quia-quasi-voluptas does not ensure that a valid promise is returned.

function promiseFn (n) {
  return new Promise(resolve => {
    setTimeout(() => resolve(n), 15)
  })
}

const fn = @zitterorg/quia-quasi-voluptas.fromPromise(promiseFn)

// Works with Promises:
fn('Hello World!')
.then(result => console.log(result)) // -> Hello World!
.catch(error => console.error(error))

// Works with Callbacks:
fn('Hi!', (error, result) => {
  if (error) return console.error(error)
  console.log(result)
  // -> Hi!
})

License

MIT

css variablettycompilertypedarraysslotcloudwatchhas-owncolumnsapisafetelephoneES2022pnpm9viewhashglobsequencescheme-validationrfc4122protobufmodulepropertyreadjoiietrimfunctionalreal-timetypescript-0getoptcoreentriesarraybufferquerymergeautoscalingdeepcopyownimmutablefast-deep-clonesuperstructcompile lessString.prototype.trimnegativetoobjecttouchgraphqlrecursivediffmakereducerchromeponyfillCSSsymlinkshookses8loggerES3_.extendbreakfluxwalkingdatastructurefromassertionwgetquerystringdefinePropertycloudsearchspecrapidFloat64Arraytyped arrayspinnerssqsconsumestablegradients csslocationargumentcollectionCSSStyleDeclarationcloudfronttakemoveObject.entriesTypeBoxrobustECMAScript 2016ecmascriptterminalTypedArraydescriptiontermvestjsfsprivate dataurlWeakMapopenstringifiercallboundexeckarmamodulesunicodeequalitywritablejwtsetPrototypeOfpositivequeueMicrotaskwebairbnbprogresswatchingchaicall-boundrangeerrorinspecthelpersupArrayBufferguidArraycollection.es6omitcompareuninstallmkdirpcsspreprocessorhttpsl10neventEmitterqueueSymbol.toStringTagtrimStartassignbluebirdindicatores2016authenticationcheckwatchsidedeletewalkgdprInt16ArrayArray.prototype.includestypesafeObject.definePropertytypesregular expressionsaws0reuseStyleSheetconnectflagsargparseminimalelectronsetImmediateresolvetypeincludesratelimitcryptextrawaitrm -rfbrowserslisttrimLeftqsauthfunctionrategrouphasOwnlimitedsortedprunekeyES2020Array.prototype.findLastcore-jsArray.prototype.flatsettervaluescolourPromiseUint8ClampedArraymixinspackageproxyECMAScript 2023less csstoSortedlazydirectoryasyncECMAScript 2022tsrmdirglaciercloudtrailconcatdirstyled-componentsredactdateECMAScript 6Uint32Arraymapreduceclonegenericschannelzodtypeerrortypedarraycss nestingcallbacktaskshellwraplivemetadata256bindpushless mixinsTypeScriptcomputed-typesUint16Arraybootstrap lessemojidependency managerformspostcss-plugincommanderzeroES2021efficientxhrcallES2023mime-dbreact-hookscolumnencryptionargvReactiveXinvariantnumbermatchesregexduplexObject.ispluginmake dirphonepostcsstoolshigher-orderisConcatSpreadablematchwrites3ES7performancees7statebrowserlistflagroutinglimitinstallerlibphonenumberstreamstapechinesethroatdeterministicoutput$.extendspinnermkdirjsonpath.envsimpledblanguageconsolecorscacheserializereduxlogWebSockets__proto__settingsajvsomeprettymochadeep-copybundlerArray.prototype.containsRxJSmkdirsextendECMAScript 7shebangutil.inspectparserclassnamenamees5coercibleObject.getPrototypeOfrequirevariables in csstesterfpsstylesnegative zerowatcherserializationshamECMAScript 2021concatMapec2ESnextprototypejasmineES2016containsfulla11ytapcommandutilitiesbddfast-deep-copystreaminstallgetArray.prototype.filterdependenciesvariablesbatchdeepcloneObservableES2018charactersharedarraybuffervalidationnativetostringtagtoolkitdom-testing-libraryshimautoprefixerfunctionsjsxfetchfastcopystdlibvisualischromiumtrimRightloadbalancingtrimEndfast-cloneeventDispatcherreadablestreambyteOffsetidvpcweakmapclassesfseventssymlinkidlerm -frpackage.jsonlruReactiveExtensionsfindLastrgbWebSocketprotoparsinghotinternalBigUint64ArraysearchnamesRegExp#flagsoptimistimportebses-shimsescapebusyReflect.getPrototypeOfworkflowmimetypesyupJSONflatstringvalidwordbreakmonorepoassertpromisesregularES6matchAllObjectparentsstylepipecall-bindespreepolyfillbyteeslintconfigloggingECMAScript 2018workspace:*ES5arrayStreamamazonRegExp.prototype.flagstddArray.prototype.findLastIndexjestdomconcurrencyfast-copyelmregular expressiontraverseweaksetgettercurlparent[[Prototype]]pathapolloconfigurableesrouteswfArrayBuffer.prototype.sliceenvironmentelbwarningtypanionenumerablestylingseskeysrequestlesscsstypeofes2018descriptorhasOwnPropertyMapcliECMAScript 2020formatstoragegatewaysetfile systemextensionArray.prototype.flattenschemapicomatchcommand-lineconfigFloat32Arraycolores2015figletreadablecreateES8styleguideUint8ArrayjsdomstylesheetbannertextansiruntimeObject.assignObject.fromEntriesmimeestreeRxenderFunction.prototype.namegetintrinsicintrinsices6clientUnderscoreavadayjsjsdiffRFC-6455lengthInt32Arrayregexpreplayfixed-widthInt8ArrayremoveECMAScript 3nodeartECMAScript 2019css-in-jsschemelintlookeveryoptimizerstatelessYAMLclassnamesprivateURLSearchParamsreact-hook-formwidthsharedtypedi18ncss lessprefixnopemruiteratoreast-asian-widthroute53xtermreduceequalbufferbootstrap cssiteratepredictablepromiselinkoptionfullwidthinferencepackage managerassertsdotenvtsliblasterrorfindLastIndexoncedebugsuperagentgetOwnPropertyDescriptorbuffersECMAScript 2017wafcircularES2015formquotecodesdroplessformattingES2019
1.0.38

1 year ago

1.0.37

1 year ago

1.0.36

1 year ago

1.0.35

1 year ago

1.0.34

1 year ago

1.0.33

1 year ago

1.0.32

1 year ago

1.0.31

1 year ago

1.0.19

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.29

1 year ago

1.0.28

1 year ago

1.0.27

1 year ago

1.0.30

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.2

1 year ago

1.0.3

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago