6.4.69 • Published 1 year ago

@hishprorg/tenetur-autem-commodi v6.4.69

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

@hishprorg/tenetur-autem-commodi Version Badge

github actions coverage License Downloads

npm badge

Returns true if a value has the characteristics of a valid JavaScript data descriptor.

Examples

true when the descriptor has valid properties with valid values. false when not an object or when the object has invalid properties.

var isDataDesc = require('@hishprorg/tenetur-autem-commodi');
var assert = require('assert');

assert.equal(true, isDataDesc({ value: 'foo' }));
assert.equal(true, isDataDesc({ value: function () {} }));
assert.equal(true, isDataDesc({ value: true }));

assert.equal(false, isDataDesc('a'));
assert.equal(false, isDataDesc(null));
assert.equal(false, isDataDesc([]));

assert.equal(false, isDataDesc({ value: 'foo', bar: 'baz' }));
assert.equal(false, isDataDesc({ value: 'foo', bar: 'baz' }));
assert.equal(false, isDataDesc({ value: 'foo', get: function () {} }));
assert.equal(false, isDataDesc({ get: function () {}, value: 'foo' }) );
 
assert.equal(false, isDataDesc({ value: 'foo', enumerable: 'foo' }));
assert.equal(false, isDataDesc({ value: 'foo', configurable: 'foo' }));
assert.equal(false, isDataDesc({ value: 'foo', writable: 'foo' }));

Valid properties

The only valid data descriptor properties are the following:

  • configurable (required)
  • enumerable (required)
  • value (optional)
  • writable (optional)

To be a valid data descriptor, either value or writable must be defined.

Invalid properties

A descriptor may have additional invalid properties (an error will not be thrown).

var foo = {};

Object.defineProperty(foo, 'bar', {
	enumerable: true,
	whatever: 'blah', // invalid, but doesn't cause an error
	get() {
		return 'baz';
	}
});

assert.equal(foo.bar, 'baz');

Related projects

  • is-accessor-descriptor: Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.
  • is-descriptor: Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… more

Tests

Simply clone the repo, npm install, and run npm test

0sharedarraybufferreplayinternal slotcore-jstypeofmodulesArrayBufferclass-validatordeterministicchromiumquerymatchAsyncIteratorvariableshigher-orderdeeptypanion.gitignorereact-hook-formString.prototype.trimio-tstypedarrayspropertiesspectoReversedcallboundpathWeakMapassignes5compilerdefinenegativelengthes8Array.prototype.includestsTypeBoxcolumnstouchtrimRightnodejstypesInt16Arraysetlazyprotobufi18neventstestbrowserlistconfigurablecss nestingwindowprogressbyteOffsetPromisegetOwnPropertyDescriptortacithasfastcopyloadbalancingdayjsparserFloat32ArrayaccessorautoscalingoptionglacierslotmacosES2021binariesnpmignoreiterateloggingwgettransportinwindowsmanagerisprivate dataargumentcolorwaitequalitycoercibleurlRFC-6455cloudsearchECMAScript 3reactsignedworkspace:*jestconcatMapa11yshrinkwrapdropasciiwaapisliceRegExp.prototype.flagscloudwatchregularreact-testing-libraryECMAScript 2019routingcodesReflect.getPrototypeOfcallbackcallconfigES2017functionalArray.prototype.findLasttrimLefthttpsrequireforkutilitydompredictablebabel-coreelbposegetmapreducewalklanguagefullwidthpostcss-pluginutil.inspectRegExp#flagsgetPrototypeOfproxyiebyteES6matchAllhelperpackage managergetintrinsictelephonejapanesevalidhasOwnharmonycloudfrontconsumereduceamazonmixinsframerqueuewhicharraysECMAScript 2022ES2019astefficientawesomesauceoptimistinternalES5ESworkflowgroupsymlinksfasts3react-hooksUint32ArrayuninstallirqpicomatchjsonschemaeventEmitterUint16ArrayreversedtranspileArray.prototype.flatshamreal-timestructuredClone__proto__starterserializekeysprotocol-buffersspinnersmkdirpimporterrorcomputed-typesvalidation.envES8statelesserror-handlingsymbolairbnbeast-asian-widthES2020babelcopyterminalrfc4122propdynamodbdataviewapollolocalemrsomeURLReactiveExtensionsparsejsdiffsafenamesacornsideinterruptscssinputtoolsbinaryutilitiesmruclientoperating-systemownsignalsJSONmulti-packagegenericschineseansiECMAScript 2017ES2015streamsrapidhookformdescriptorsanimationvars3dgroupByhandlersmomentbootstrap lessperformantequaleslintpluginkoreanstringifystylesRxredux-toolkitnopeform-validationtraverseemittrimlrucss less@@toStringTagvariables in cssutilsregexquerystringdataStyleSheetvestObject.getPrototypeOffullmovedependenciesliveECMAScript 2015Symbolhardlinksfull-widthtextObject.entriesdirectoryclonesqsObject.assigndescriptorprocessstatuschecktoStringTagarraybufferhttpfastclonebufferpurelastdeep-copyfunction.lengthless.jsfastifybuffersObservablepnpm9yupmoduleasteriskstypescriptvaluesauthenticationreact animationsnsrobustlesscsses7CSSes6stringenvironmentWebSocketpoint-freereusecloudtrailoutputremoverequestsyntaxglobalstringifiertrimEndsetImmediateinstallstylingdataViewreact poseworkeres2018fast-copyschemamkdirsfantasy-landstyleArray.prototype.findLastIndexsetPrototypeOfBigInt64Arrayfast-deep-copydescriptiongraphqlMapwritableenvironmentsstablefpsStreamObservablesjoibeanstalkECMAScript 7enumerableString.prototype.matchAllhas-owncollection.es6whatwgforEachglobal this valueyamlReactiveXentriesjson-schema-validatorbannerphoneendercolorssesruntimecontainsflagspiperegular expressionobjectmake dirviewFunction.prototype.nametoArraySymbol.toStringTagnamedeep-cloneserializertrimStartglobalThispolyfillcallbindtc39rulesvaluetypeselfconcatidentifiersfunctionsvardragtypeerrorauthuser-streamsredactttypreserve-symlinkshelpersenvObject.fromEntriesreadablestreamrouteformsroute53asynccryptoapischemelogxhruploadsigintpositiveECMAScript 2021globless cssflattenopensslUnderscorematcheses-abstractjson-schema-validationtermWeakSetzxURLSearchParamsnumberweakmapexecuteObject.valuesexit-codeglobal objectloading_.extendoptimizercall-bindnegative zerobundlingbinspinnertypesafefigletsetterObject.keysless compilerponyfillES3Int8ArrayMicrosoftshebangiterationrangeerroriamclijsartes2015JSON-SchemajsdomjshintcjkinstallerhotsortedObject.definePropertyECMAScript 2018execSetArray.prototype.flatMapglobalscreatesuperstructpersistentcloudformationArray.prototype.flattenbrowserslisttypedarrayESnextcertificatesecmascript$.extendec2css-in-js6to5speedzerojson-schemainferenceeverystylesheetfast-clonecolumncommand-lineramdabundlerObjectmetadatadependency managerwriteflatMapfnmatchajaxpruneBigUint64ArrayisConcatSpreadableArray.prototype.filterescharacterindicatorloggernodepreprocessorFloat64Arrayomiteslint-pluginresolvetimepopmotionECMAScript 6datastructurevisualtoSortedonceECMAScript 2020spawnreadcorepasswordgitignoreprototypechaiextraTypeScriptES2016ES2018ES2023expresstostringtagsameValueZerotddES2022colourshellvalidatormobilelockfilequoteformatECMAScript 2016Object.isboundqueueMicrotaskes-shim APIrandompackagesjsxrecursivewaffindLastIndexvalidategesturesawsArrayBuffer.prototype.sliceiteratoridleajvswfreverseparsingCSSStyleDeclarationtestinglintjavascriptvpcPushtakecollectionmkdirunicodemergeWebSocketsinspectcss variableoffsetuuidtyped arrayprotofindlinuxdeletetypedgetteraccessibilityfile systemextendprivatefluxmapsequencesymbolselmeffect-tsbddrfc9562browserweaksetformattingassertshasOwnPropertypromiseassertionelasticacheexitautoprefixerpostcsstranspilersuperagentInt32Arrayreact-componentstyled-componentspropertyfilterfast-deep-cloneqscurlfindLastelectronECMAScript 2023IteratoreslintcommandStreamsjQuerySystem.globalencryptionsettingsformsortcryptstyleguideargvUint8ArraydeepcopyzodhooksinvariantcurriedArrayBuffer#slicetoolkitconsoleES7RxJSeslintconfigshim[[Prototype]]gdprfileflagflatexpressionmonorepoperformancechildcachekinesisxtermsignalrdsprefixpatchsigtermscheme-validationreduceres2016warninges2017argsimportexportexecfileconstregular-expressioncompile lessfsl10nstate256busydotenvintrinsicpinosubprocessnpmagentlistenersbootstrap cssTypedArraydateescapecircularArrayarrayHyBipushfromplugincall-boundmakeebseventDispatcherrgbless mixinsECMAScript 5libphonenumberfetchutilstreamsharedkeyfpthreenativegradients css3jsonestreeserializationimmergetoptbyteLengthchromewidthcompareclassesignorecommander-0prettygradients cssjwtobjstoragegatewaydiffassertnested csssyntaxerrorclassnamescensortoobjectreduxlinkarktypeclassnameregexpimmutableguidsimpledbtslibbcryptincludesreadabledirletminimallessArray.prototype.containspyyamlfixed-widthdom-testing-librarysymlinkdeepclonefunctionYAMLdefinePropertybindUint8ClampedArraypackage.jsonspringhashes-shimsendpointchannelECMAScripttester
6.4.69

1 year ago

6.4.68

1 year ago

6.4.67

1 year ago

6.4.66

1 year ago

6.4.65

1 year ago

5.4.65

1 year ago

5.4.64

1 year ago

5.4.63

1 year ago

5.4.62

1 year ago

5.4.61

1 year ago

5.4.60

1 year ago

5.4.59

1 year ago

5.4.58

1 year ago

5.4.57

1 year ago

5.4.56

1 year ago

5.4.55

1 year ago

5.4.54

1 year ago

5.4.53

1 year ago

5.4.52

1 year ago

5.4.51

1 year ago

5.4.50

1 year ago

5.4.49

1 year ago

5.4.48

1 year ago

5.4.47

1 year ago

5.4.46

1 year ago

5.4.45

1 year ago

5.4.44

1 year ago

5.3.44

1 year ago

5.3.43

1 year ago

5.3.42

1 year ago

5.3.41

1 year ago

5.3.40

1 year ago

5.3.39

1 year ago

5.3.38

1 year ago

4.3.38

1 year ago

4.3.37

1 year ago

4.3.36

1 year ago

4.3.35

1 year ago

4.3.34

1 year ago

4.3.33

1 year ago

4.3.32

1 year ago

4.3.31

1 year ago

4.3.30

1 year ago

4.3.29

1 year ago

4.2.29

1 year ago

4.2.28

1 year ago

4.2.27

1 year ago

4.2.26

1 year ago

4.2.25

1 year ago

4.2.24

1 year ago

3.2.24

1 year ago

3.2.23

1 year ago

3.2.22

1 year ago

3.2.21

1 year ago

3.2.20

1 year ago

3.2.19

1 year ago

3.2.18

1 year ago

3.1.18

1 year ago

3.1.17

1 year ago

3.1.16

1 year ago

3.1.15

1 year ago

3.1.14

1 year ago

3.1.13

1 year ago

3.1.12

1 year ago

3.0.12

1 year ago

3.0.11

1 year ago

3.0.10

1 year ago

3.0.9

1 year ago

3.0.8

1 year ago

3.0.7

1 year ago

3.0.6

1 year ago

3.0.5

1 year ago

3.0.4

1 year ago

2.0.4

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago