2.4.73 • Published 1 year ago

@dramaorg/officia-unde v2.4.73

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

@dramaorg/officia-unde 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('@dramaorg/officia-unde');
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,
		},
	}
);
lintruntimeutilitiestransportidtoobjectprocessArray.prototype.flatMaparrayslinktslibcallendercall-binddefinePropertycloudfrontjQueryvarsnumberBigInt64ArrayendpointgesturescryptonativepicomatcheventDispatchercjkJSON-SchemaimmutableargumentpureflatlanguageemojitoArrayvalidatesubprocessmergei18ntypesafecloudwatchUnderscoredirectoryRxJSasyncslotURLchaifixed-widthutilityUint8ClampedArraycolorpropertystable0binform-validationdependenciesshimWebSocketsindicatorpreprocessorObject.fromEntriestakesliceeslintconcatrecursivegetPrototypeOfresolveponyfillreact-hooksString.prototype.matchAlltypeofshamimmerArray.prototype.findLastdom-testing-libraryfilterfsutilyuppoint-freepostcssSymbolcircularonceReflect.getPrototypeOffromregular expressionsESnextdomsqsfindLastIndexECMAScriptcall-boundECMAScript 7fullwidthbindserializationignoredeepcopyglobalscli256acornbyteOffsetFloat64Arrayvalidbannercode pointscheckreact posekeyappdayjswidthURLSearchParamsYAMLatomcurriedhasOwnPropertymanipulationmodulesbinaryestreehashtypescriptproxyenvpinofastifyinputperformantimporttraverseprototypematchesMapmochatc39ArrayBuffer#slicecreateenvironmentsupremovees2015shrinkwraptoolkitcoveragefinduptypedarrayjapanesesuperstructfindLastECMAScript 3agenthasprotowaitloadingdotenvoutput_.extendhttpsloggingnamenopeIteratorES2020helperscssES2023Object.assignES2016harmonyES8fast-clonedeepESkinesissameValueZerocodesforEachexpressiones-abstractchromiumsideastsource mapowninvariantnpmsettingstranspiler$.extendwalktrimRightinternalcolorsequalreduxeventEmitterphonefile systemcomputed-typesRxdynamodbmakeargvclass-validatorglobapiconfigcss-in-jsreducercolumnspluginwhatwgebssnsfigletgetoptreadableramdapropertiesflatMapcoercibleprettycopyemrfind-upObservablesuuidpruneajvgitignoreflattenlengthloggerclassesunicodejsxcensorsetconsolenpmignoreexpressECMAScript 2022coloures-shim APItoStringTagselftoSortedsinatraformattranspile3dimportexportmoduletransformrapidsimpledbwritableextramapbufferstoReversedchannelurlprefixescaperm -frmetadatadescriptorsyntaxerroruninstallasciiisConcatSpreadablecloudtrailcollection6to5descriptiones5symbolslibphonenumberanimationqueuetestervaluesredux-toolkitES2018termbundlerreact-testing-libraryStyleSheetpropbabelpackages-0callboundtsmatchAllstoragegatewaylook-upfast-deep-copygetintrinsicfunctionses7toolsgetzeroregexpECMAScript 2015pnpm9ES5locationnegative zerofoldercommand-lineelasticacheomittypedarraysECMAScript 5requestoptimizerfunctionpipeAsyncIteratoransiwhichECMAScript 2020reversea11yhookformsearchhardlinksweakmapio-tsfindformsetImmediatesaferoute53xhroptionjson-schemarfc4122Symbol.toStringTagiteratorglobalthreeeventsdefinepathrandomUint8Arrayeffect-tsview__proto__syntaxjavascriptautoscalingincludesdeep-copydeterministicvestcharacternamesxmlBigUint64ArrayreversedserializeparserRegExp.prototype.flagsbrowserslistmatchformattingtexttddbinariesspeedES3schemeesdeletefull-widthframerpostcss-pluginfeedhookswindowArrayBuffer.prototype.slicetypedposecollection.es6workflowqsMicrosoftbabel-corebeanstalkarraybuffertouchschemastarterrouterrouteflagutilsdataviewtapsortWebSocketjoifast-copyInt32Arrayarrayes8regularglaciertapebusykeysoptimistmulti-packageECMAScript 2016protobuflrupyyamlArraySetinstallerawesomesaucerangeerrornegativecommandenvironmentrsstostringtagrestfulvariablesxtermpolyfillvalidationspringfptypescallbackentriesdebuggerECMAScript 2017browserpackage managerexecjson-schema-validatorprivate datacharacterstypevaluepackage.jsonformsconstjson-schema-validationdifftyped arraycoreregular-expression.gitignorereact-hook-formstylesbundlingbuffervalidatoremitregular expressionsetPrototypeOfWeakSetvpcqueueMicrotaskes-shimspatchminimalrobustES7bytedependency managerInt8ArraytimeterminalTypeScripteslint-pluginl10najaxhtmljsonglobal objectcolumnrulesjssharedarraybufferFloat32ArrayprivatemovespawnSystem.globalpositiveavaautoprefixerObject.isglobalThisinference
2.4.73

1 year ago

2.4.72

1 year ago

2.4.71

1 year ago

2.4.70

1 year ago

2.4.69

1 year ago

2.4.68

1 year ago

2.4.67

1 year ago

2.4.66

1 year ago

2.4.65

1 year ago

2.4.64

1 year ago

2.4.63

1 year ago

2.4.62

1 year ago

2.4.61

1 year ago

2.4.60

1 year ago

2.4.59

1 year ago

2.4.58

1 year ago

2.4.57

1 year ago

2.4.56

1 year ago

2.4.55

1 year ago

2.4.54

1 year ago

2.4.53

1 year ago

2.4.52

1 year ago

2.4.51

1 year ago

2.4.50

1 year ago

2.4.49

1 year ago

2.4.48

1 year ago

2.3.48

1 year ago

2.3.47

1 year ago

2.3.46

1 year ago

2.3.45

1 year ago

2.3.44

1 year ago

2.3.43

1 year ago

2.3.42

1 year ago

2.3.41

1 year ago

2.3.40

1 year ago

1.3.40

1 year ago

1.3.39

1 year ago

1.3.38

1 year ago

1.3.37

1 year ago

1.3.36

1 year ago

1.3.35

1 year ago

1.3.34

1 year ago

1.3.33

1 year ago

1.3.32

1 year ago

1.3.31

1 year ago

1.3.30

1 year ago

1.3.29

1 year ago

1.3.28

1 year ago

1.3.27

1 year ago

1.3.26

1 year ago

1.2.26

1 year ago

1.2.25

1 year ago

1.2.24

1 year ago

1.2.23

1 year ago

1.2.22

1 year ago

1.2.21

1 year ago

1.2.20

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

1 year ago

1.2.12

1 year ago

1.2.11

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

1 year ago

1.1.1

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago