1.0.0 • Published 15 days ago

@ptkhanh94npm/aperiam-deleniti-inventore v1.0.0

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

@ptkhanh94npm/aperiam-deleniti-inventore 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('@ptkhanh94npm/aperiam-deleniti-inventore');
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');
utilsrandoma11ysafesignalbundlertypeddefaultassertionpushjson-schema-validatormonorepochinesefindLastexitletsliceprocessfixed-widthmatchescolumnsfast-deep-copydotenvjsonpathprefixquerystringpluginES7exeTypeBoxstreamformatwatchFile0immerfull-widthruntimedateES2016Float32Arraytacitrfc4122eslintconfigtoArrayhooksnumbertestingReactiveXbusybrowserlistCSSeveryenumerableBigUint64Arraycss-in-jsbyteerrorisConcatSpreadableJSON-SchemaArray.prototype.findLastviewmime-dbbddreadsymbolsMicrosoftcryptoreadablestreampreprocessornodejsaccessibilityvestfolderInt8Arrayterminaldropmodulees2016fetchfunctionsless mixins@@toStringTagfastifyIteratoropenstrimLeftawesomesaucestarterbabeldeletemodulescall-bounddatastructuremkdirsvalideventDispatcherstructuredClonesharedES5channelcssclassesjson-schemastylingwidthbootstrap cssanimationjestcommand-lineestreelintuuideventEmitterstdlibInt16ArrayarraybufferframerTypeScriptfpvalidationstreamsshellbyteOffsetrm -rfspinnersFloat64Arrayastdayjsdom-testing-librarypropes6equalityprototypecore-jsfigletoptimistchaigetescapecachelook-upairbnbrgbtoSortedcolortranspilepyyamlfulltypeerrorgradients css3chromiumreduxqsmergeReflect.getPrototypeOfUint8Array-0positivelessreal-timeshimposejsonrequiregenericsRegExp#flagsoncedescriptorsremovedeepcopyquotetranspilerimportreducercollectionjsdifffilterES2018ECMAScript 2017negativetslanguagejson-schema-validationtypedarraysdataViewperformancematchbatch$.extendrm -frinputguidrobustharmonycss lessWeakSetoutputtoobjectapipopmotionString.prototype.trimbindargumentRegExp.prototype.flagsiterationapollocloneclientmimevariables in cssarraystylescompilerfind-updiffwritenopel10nes-shimsStyleSheetstylepromiseyupcmdvalidatorrangeerrorsetImmediateinterruptsobjslotlibphonenumbersettingsttygetOwnPropertyDescriptordatabannerargvincludesUint16ArrayvarintrinsicprototslibcharactersArray.prototype.findLastIndexprunetyped arraywalkingTypedArrayObject.fromEntrieshashnegative zeropatchbluebirdoffsetjoiArrayform-validationformemitprotobufmkdirpObject.valuesnativeloggingprivate dataspeedassertscurlflagObjectinternal slotES2019arktypeweaksetes-shim APIspinnerworkercirculares5bufferssymlinkscreateenderreact-testing-librarysameValueZeroSymbol.toStringTaglimitlazyES2021sortedjavascriptargsfastcopyfunctionprogressdefinerequestexit-code6to5minimalcallbindWeakMapgetterlinuxECMAScript 2016argparsetapidlesyntaxcoerciblecommanddeep-copyjsonschematraverseajvmomentgetPrototypeOftrimprivatejwtmacosthroatURLyamlES2017upcolumnmakewhichirqsigtermschemematchAllregular expressionstestergetoptECMAScript 2022omitconstkoreantypesafewindowstouchdebuggerloggererror-handlingcensorfullwidth256inferencepackagesqueuewebsitezeroutildomtddtypehelpersserializationserializeObject.keyscliObject.assignstyleguidesortpurestatusavashrinkwrapFunction.prototype.namestringsetwrapdirassignprotocol-buffersextensionenvponyfilleditorpoint-freeString.prototype.matchAllpostcss-pluginmulti-packageopenershebangcss nestingcollection.es6RFC-6455classnamecopygroupvisualexecdependenciesYAMLInt32ArraystringifyArray.prototype.includescjkaccessorpackage managersymbolbreakreact posecallbackUnderscoreasciiequalformattinggroupBycomputed-typesutilitiesframeworktake.envstatelessECMAScript 2020ECMAScript 2019karmalockfileefficientcheckwalkoptionio-tsajaxparsetypedarraymiddlewarees-abstractauthapprmlengthwatchinglruhigher-orderES2022parserhttpsgetintrinsicexecutableiesetPrototypeOfflatxdggdprStreamsfindentriesfast-clonedeepresolveautoprefixerpicomatchstylesheetbufferspawnHyBiconsumecompile lessvariableschromeSymbolflagsfantasy-landmake dirwhatwgpackageBigInt64ArrayfromtoStringTagshamecmascriptpromiseslookfseventsPromiseutilitymetadatatypescriptsyntaxerrorcorejsdomES2015EShookformless.jsregexpmoveECMAScript 2015Observableses7readableArray.prototype.filterassertsanitizeinvariantoperating-systemforEachRxJSpathratekeysthrottledebugreact animationwatchpreserve-symlinkspasswordMappipebrowserslistkeyURLSearchParamsmobileless cssparentextenduser-streamsuninstallsanitizationsequencetimecorsrecursivees2017ECMAScript 2018argumentsECMAScript 2021lastobjectnamesvaluescall-bindpostcssreact-hooksfast-deep-clonebyteLengthloadingtypeofxhrwarningjapaneseECMAScript 6deepcloneschemababel-coresetterduplexUint32Arraysearchurlswritableexpresses2015ES2023encryptionArrayBuffer#sliceWebSocketjsxphoneReactiveExtensionses2018Array.prototype.flatMaplinewraptextdirectoryeslintcallelectronsuperstructcompareextratestrmdirtelephonetypanionredux-toolkitcommanderansinameStreamcharacterjQueryreuseES2020sigintObservablehttpdataviewfindLastIndexischildpolyfillPushweakmapeslint-plugincolorsemojiurlmochacodesglob
1.0.0

15 days ago