1.0.0 • Published 20 days ago

@libgitname/minus-quibusdam-quam v1.0.0

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

@libgitname/minus-quibusdam-quam Version Badge

github actions coverage License Downloads

npm badge

Set a function’s name.

Arguments:

  • fn: the function
  • name: the new name
  • loose: Optional. If true, and the name fails to be set, do not throw. Default false.

Returns fn.

Usage

var setFunctionName = require('@libgitname/minus-quibusdam-quam');
var assert = require('assert');

const obj = {
    concise() {},
    arrow: () => {},
    named: function named() {},
    anon: function () {},
};
assert.equal(obj.concise.name, 'concise');
assert.equal(obj.arrow.name, 'arrow');
assert.equal(obj.named.name, 'named');
assert.equal(obj.anon.name, 'anon');

assert.equal(setFunctionName(obj.concise, 'brief'), obj.concise);
assert.equal(setFunctionName(obj.arrow, 'pointy'), obj.arrow);
assert.equal(setFunctionName(obj.named, ''), obj.named);
assert.equal(setFunctionName(obj.anon, 'anonymous'), obj.anon);

assert.equal(obj.concise.name, 'brief');
assert.equal(obj.arrow.name, 'pointy');
assert.equal(obj.named.name, '');
assert.equal(obj.anon.name, 'anonymous');
typedarraysxtermjasminekeysdom-testing-libraryexechttpstc39passwordfilterES2023statelessemitstatusimmerhandlersregexdebuggeres-shimsframerlockfileECMAScript 2018outputoptimistdiffletdeepTypedArrayoptimizereslintcore-jsESparsemovemkdirsiteratorthroatmime-dbgdprstreams2progresslinewrapinferencefast-deep-copyfunctionsES2018streames7prefixauthenticationECMAScript 6ES8coreclonesuperstructlintpackage managerisConcatSpreadableweaksettextexpressionrateenvironmentwatchingcreateartsideSymbol.toStringTagjsxES2015Object.definePropertydescriptorsminimallengthexitUint16ArrayestreeES3ECMAScript 2017fastdeep-copyaccessorcharactersjwtclassnamereact-hook-forminstallerstringifiercheckwatchFileio-tsruntime3dwindowsbrowserslisttddoffsetencryptioncall-boundjsdiffrobustsortawesomesaucetsES2022less cssUint8ClampedArraycollectiontelephone6to5japaneseassertstoobjectcallbindbusycjknodesortedStyleSheetCSSStyleDeclarationfastifyURLSearchParamssyntaxerrorresolvereducermochainspectpreprocessordataviewopenprivateFloat64Arrayrequirei18ncomputed-typesirqdefineobjectArray.prototype.flatupES5eslintconfiglanguagecommandmkdirbabelkeywebquotevalidnameswidthmodulesasyncgraphqlcall-bindfindtesterimmutablejsonpathes-shim APItrimEnddircommandersigintpropertiesmrumatchesregular expressionsES2016javascriptArray.prototype.containscolumnFloat32Arraydatejoilazycoercibleargparsefunctionutilitiesdependencieshigher-orderconfigcurlconsolesignalstypedECMAScript 2023-0bootstrap cssexpresstraversemonorepoRegExp#flagsArrayBuffer.prototype.sliceyamleast-asian-widthdataViewpatchredactreact animationprotocol-buffersTypeScriptincludestypeshebangsigtermcalllimitreact-testing-libraryclassnamestypesafeArray.prototype.findLastIndexinternalgroupclassesgradients cssaccessibilitybatchrm -rfUint8ArrayrandomIteratorweakmapcompile lessphoneObject.isRFC-6455flatMapArray.prototype.filtermomentproperty.envtakechromepackagelibphonenumber[[Prototype]]errorfast-clonepostcss-pluginapistringifyoptionformsbabel-coreposeObject.entriesequalitymimetypesObservableconcurrencyinstallqueueMicrotaskterminalsetPrototypeOfHyBiArray.prototype.findLastinterruptsfastclonearraybufferdeletelogonceomitargslistenerslook-uplinkintrinsiczerounicodel10nreduxrm -frcompilerdatastructurelesssettercoloridleescapecommand-linecensor$.extendstylesheetxhrparentskoreanmiddlewareprocessastStreamtapetoolkitregularmoduleES2019starterlimitedpromiseArray.prototype.includesvariablestranspileECMAScript 2021toolstypeoftyped arraydeep-clonenegative zerokarmaObservablestestvaluesmatchAll0WeakMapserializationreuseES2021parentWebSocketsyupconsumecss-in-jscontainsgetterwarninguser-streamsairbnbBigUint64ArrayutilArray.prototype.flattenapollofind-uppropperformantmakechannelstreamssettingseventEmittercolorsstylingdeterministicsomelrureadablea11yReactiveExtensionsdraghttpduplexurllastwritecolourspinnersclijsonloggingtypescriptmixinsmimeprototypegradients css3eventDispatcherpushclientwatchermetadatastylesStreamsendertouchformattingless mixinsUint32ArrayfinduptapdropArrayBuffer#slicecss variablequeryefficientpreserve-symlinksfsES7typeerrorWebSocketargumentgroupByjson-schema-validationsetImmediatepackageslesscssutilitybyteLengthobjwordwrapnegativeRegExp.prototype.flagsdataschemeReflect.getPrototypeOfnested cssfindLastassertshampicomatchfullwidthextraYAMLbufferscharacterregexpfseventsstyleguidejestInt16ArrayprotoprunewaapiObject.getPrototypeOfsharedes5signalES6wordbreaktoStringTagparsertrimStartmergeawait
1.0.0

20 days ago