5.10.66 • Published 1 year ago

@hishprorg/at-cumque-porro v5.10.66

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

@hishprorg/at-cumque-porro Version Badge

github actions coverage License Downloads

npm badge

Define an accessor property on an object. In an engine without descriptors, in loose mode, when only a getter is provided, nonEnumerable is false, and nonConfigurable is false, wil fall back to assignment - otherwise, it will throw.

The two non* options can also be passed null, which will use the existing state if available.

The loose option will mean that if you attempt to set a nonconfigurable/nonwritable accessor property with set, in an environment without descriptor support, it will fall back to normal assignment (and eagerly evaluate the getter).

Usage

var defineAccessorProperty = require('@hishprorg/at-cumque-porro');
var assert = require('assert');

var str = 'value';
var strThunk = function () { return str; };
var strSetter = function (v) { str = v; };
var random = function () { return Math.random(); };

var obj = {};
defineAccessorProperty(
	obj,
	'key',
	{
		get: strThunk,
		set: strSetter,
	}
);
defineAccessorProperty(
	obj,
	'key2',
	{
		get: random, // at least one of "get" or "set" must be provided
		nonConfigurable: true, // optional
		nonEnumerable: true, // optional
		loose: false, // optional
	}
);

assert.deepEqual(
	Object.getOwnPropertyDescriptors(obj),
	{
		key: {
			configurable: true,
			enumerable: true,
			get: strThunk,
			set: strSetter,
		},
		key2: {
			configurable: false,
			enumerable: false,
			get: random,
			set: undefined,
		},
	}
);
characterArray.prototype.flatMapcallbindgroupByjsdomletaccessorperformanceargvutilitiesfastcopydescriptionframerpoint-freeasyncIteratorcoercibleintrinsicInt8ArrayenvArray.prototype.findLastcoreRxreact-testing-librarysetImmediatejson-schemaworkflowauthArray.prototype.filterregularindicatorES2021function.lengthdeepless mixinshttplistenersfile systemfluxtc39getOwnPropertyDescriptorsomesymbolqueueartvaluesastdependency manageri18nprettyzeroObject.keysgesturescloudfrontArray.prototype.includeslazyES2015es5io-tsnodeenumerablestarterapischemaiteratepersistentpnpm9emitworkspace:*concatMapphonees2017react-componentgroupparsecache__proto__datastructureUnderscorerfc4122compareBigInt64ArrayObservablesreact-hooksCSSStyleDeclarationpropertycollectionredactreuseidleutil.inspectlintFloat64ArrayvestdeepcopyRegExp.prototype.flagslinux-0functionalautoscalingcommand-lineURLSearchParamstestingArray.prototype.containsreduxpasswordponyfilluuidhasOwnprototypeebsnegativesyntaxerrorinstallreal-timetoolkitwriteES2023numberreact posepredictablebabelES2022routeconsumeoperating-systemtoArraytextairbnbharmonylanguagespringsortwaitpatchtransportiesharedhotcensortrimStartoptimisthasOwnPropertyvalidationArrayBuffer.prototype.slicecolorsarktyperfc9562browserlistfast-deep-copybytechromespawnSymbol.toStringTagflagmake dircontainsminimalfast-deep-cloneAsyncIterator3dttyes-shim APIreadable0regular expressioncloudtrailparserextendpropertiesefficientoffsettypeddeep-copyECMAScript 2018validatebindSymboljQueryECMAScript 2021effect-tsRFC-6455css@@toStringTagquerydotenvlinkjapanese.gitignoredescriptorseventsbusyyamlarrayprefixECMAScriptesmanagerES2016serializeprivate dataObservableSystem.globalfastifylesscssscheme-validationcopytsasterisks_.extendthreeECMAScript 2019typanionforkshellWeakSetwarningpinoaccessibilityescapeclassnamescallmulti-packagecolorxhrmaphigher-orderproxypolyfillinputincludesregexstringifierstreamkeysstatelessmkdirs.envyupequalityzodfull-widthReflect.getPrototypeOfposeassertsperformantimportexportsyntaxwritablejsECMAScript 7iambuffersslotArray.prototype.flatUint32ArrayfullflatMaprequestStreamsbyteLengthpicomatchinterruptseveryrapides2015setPrototypeOfes8inconfigurablebootstrap lesscore-jsstylingsortedloggerfindLastjoichinesevalidsuperagentInt32ArraydynamodbawsgetintrinsicstructuredCloneramdaTypedArraysqshandlersviewReactiveXgraphqlgitignoreredux-toolkittoStringTagdragtoReversedimportUint8ArraycurlObject.fromEntriesenvironmentsamazonissetentriesspecsignalpostcssfunctionuninstallcall-bindajvanimationvariables in cssstylesheettouchcryptomatchesexpresstoSortedmodulematcha11yString.prototype.matchAllfetchroutingjshintcompilercall-bounddataviewdayjsxtermformattingtacitglobal objecthas-ownsuperstructgradients css3requireeslintdeepcloneUint8ClampedArraygetterdirectoryruntimejsdiffforminternalqses2018ES2019guidprotocol-buffersclass-validatorformstelephonedeterministicfastclonemixinsECMAScript 3forEachvariablesurlcallboundPromisereducerpathwhichprotoignoreES8clonejwttimefigletcollection.es6wgetfromunicode$.extendbcryptserializerfpsjavascriptendpointterminalmkdirweaksettypeoftslibcurriedemrinspectcallbackWebSocketsprocessspinnersvalidatorES2017json-schema-validationenvironmentnameszxlastform-validationrobustqueueMicrotasktoobjectelbJSONtyped arrayTypeBoxhardlinksnodejswalkargumentnopecommanderror-handlingdataViewpluginPushObject.getPrototypeOflocalECMAScript 2022trimLeftencryptionECMAScript 2016byteOffsetreversedataiterationexecutewhatwgsymbolsclassnameimmutablemergeoutputtakepopmotionless csstrimjson-schema-validatoreslintpluginvarsFloat32Arrayirqassign6to5ECMAScript 2020dropvisualquotesafegenericsfantasy-landFunction.prototype.namefixed-widthTypeScriptquerystringstyleguideutilityexecrgbeast-asian-widthpureECMAScript 2017ECMAScript 5Object.valuescolourtypesafeiteratorsignedfpgetoptwindowsArray.prototype.findLastIndexnpmspinnerreactWeakMapelectronbrowserglobalsES5babel-coreoptimizersignalsautoprefixerdependenciesinstallerYAMLbrowserslistdirCSSswfrecursiveclientESnextglobalThisoncesimpledbreact animationnested cssES7typebufferECMAScript 2015rdsjsxcommanderrulessigintsidetrimRightfiltercss variablesnsapollodifftypescriptresolveseshasutilsObject.iswafflagseventDispatcherloadinggetbootstrap cssfunctionsmoduleschannelES2020widthec2keytypedarrayss3helperschecksharedarraybufferextrahookformfsObject.entriesshrinkwrapcomputed-typesdefinePropertygdprstatusmomentstyled-componentslesses7selfArray.prototype.flattencolumnsfullwidthpropArrayBuffer#slicetddloadbalancingtranspileremovefindworkerObject.definePropertyglobpackagesfileBigUint64Arraystableglobal this valueinvariantpyyamlArrayBufferacornauthenticationregexphttpsshamtestmrucjkparsingoptionnpmignoredefinerangeerrorsymlinksSetclassesexecfileregular-expressionhelperkinesisHyBiasciipositiveStreamcss lessshebangless.jsJSON-Schemapostcss-plugines6matchAlles-abstractfindLastIndexconsoleenderestreemapreducebundlingequalvpcsubprocesseventEmitterexitmakeformatdom-testing-libraryURLcolumnomitlogmkdirptranspilerreversedES2018cloudsearchstatestreamstesterString.prototype.trimcodescss nestinginternal slotisConcatSpreadablestringwindowless compilerObject.assigndeletereplaystylesboundchildsetterrandomschemeRxJSdescriptorstringifywaapiexpressionserializationlockfileflatpreserve-symlinksargstypesES3eslint-pluginsequenceerrordeep-clonefnmatchbinreducemovecss-in-jsidentifiersESawesomesauceelmflattencertificatestostringtaguser-streamses-shimsbinarykoreandomagentgetPrototypeOfReactiveExtensionsconfigslicegradients cssUint16ArraybeanstalklivechaitypeerrorbinariesprogresshooksECMAScript 6fast-clonemonorepoopenssllibphonenumberdate256Arrayreadspeedelasticacheownbannersettingspackage managerloggingconcatobjES6metadatachromiummacosstoragegatewaylengthcloudwatchjsonvarprotobufRegExp#flagsweakmapglobalhashshimjestcryptECMAScript 2023trimEndsymlinkWebSockettoolsreact-hook-formnativecloudformationreadablestreambundlerglacierassertpushnegative zerocirculararraysbddfastuploades2016mobileassertionObjecttermexit-codevaluetraverseajaxMicrosoftobjecteslintconfig
5.10.66

1 year ago

5.10.65

1 year ago

5.9.65

1 year ago

5.8.65

1 year ago

5.8.64

1 year ago

5.8.63

1 year ago

5.7.63

1 year ago

5.6.63

1 year ago

5.6.62

1 year ago

4.6.62

1 year ago

4.6.61

1 year ago

4.6.60

1 year ago

4.6.59

1 year ago

4.6.58

1 year ago

4.6.57

1 year ago

4.5.57

1 year ago

4.5.56

1 year ago

4.5.55

1 year ago

4.5.54

1 year ago

4.5.53

1 year ago

4.5.52

1 year ago

4.5.51

1 year ago

4.5.50

1 year ago

4.5.49

1 year ago

4.5.48

1 year ago

4.5.47

1 year ago

4.5.46

1 year ago

3.5.46

1 year ago

2.5.46

1 year ago

2.5.45

1 year ago

2.5.44

1 year ago

2.5.43

1 year ago

2.5.42

1 year ago

2.4.42

1 year ago

2.4.41

1 year ago

2.4.40

1 year ago

2.3.40

1 year ago

2.3.39

1 year ago

2.3.38

1 year ago

2.3.37

1 year ago

2.3.36

1 year ago

2.3.35

1 year ago

2.3.34

1 year ago

2.3.33

1 year ago

2.3.32

1 year ago

2.3.31

1 year ago

2.3.30

1 year ago

2.3.29

1 year ago

2.3.28

1 year ago

2.3.27

1 year ago

2.3.26

1 year ago

2.3.25

1 year ago

2.3.24

1 year ago

2.3.23

1 year ago

2.3.22

1 year ago

2.3.21

1 year ago

2.3.20

1 year ago

2.3.19

1 year ago

2.2.19

1 year ago

1.2.19

1 year ago

1.2.18

1 year ago

1.2.17

1 year ago

1.2.16

1 year ago

1.2.15

1 year ago

1.2.14

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago