3.8.75 • Published 11 months ago

@diotoborg/perspiciatis-totam v3.8.75

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

@diotoborg/perspiciatis-totam 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('@diotoborg/perspiciatis-totam');
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

metadatadirectoryReactiveExtensionsproxyECMAScript 2017charactervalidatorargsURLstatelesspackage.jsonendpointstringifiervalueloadbalancingsameValueZeromulti-packageArray.prototype.containsreact-hookshigher-orderWeakMapconstes5flatMapnpmignorettycompilerpreserve-symlinksexitStreamfile systemfigleturlterminaldotenvfetches7Function.prototype.namechromiumdayjsefficientprotocol-buffersiamtrimLeftsuperstructcss lessprogresstypedcreateignoretrimStartregularjsdiffbrowserslistexit-codesigneddescriptiontostringtagbufferbannera11yapollopopmotionwritablecss nestingfpsnodemovestringifyoptimizerconfigurableinternal slotpinoflagsserializesharedarraybufferstoragegatewayjson-schema-validatorchildshrinkwrapequalstylelazyFloat32Arrayio-tssetString.prototype.trimimmutableInt16Arrayes2015RegExp.prototype.flagsjestCSSconsolecallbackfast-copyfunction.lengthfsgradients cssassertsiees2017varcolorsmobileWeakSetapicall-bindmapAsyncIteratorclitslibsideasciiunicoderemovestylingmonorepocss variableruntimecall-0cachehasOwnnameseslintconfigroutingbootstrap csselbvpcclassesbabell10ncore-jsWebSocketsauthchineseRxJSECMAScript 5byteOffsetshebangflattenmkdirpnpm9react-componenttc39toolsmodulesyntaxerrorfullwidthpersistentquotephoneYAMLcurlMicrosoftasteriskslockfileagentsharedcommand-lineenvECMAScript 2023busyUint16ArraycheckenvironmentsselfsetPrototypeOfcall-boundpatchObject.definePropertyloadingJSON-Schemaspinnerssetterowncommandcurriedbinariesglobal objecthasSymbol.toStringTagfastifydescriptorsnameMapcolorObject.valuesserviceeslint-pluginpoint-freejsondataVieweast-asian-widthFloat64Arraycomputed-typestypedarraysworkerweaksetcompile lesslessdeepcopyTypeScriptwaftestingqstypesafe3dstreamRFC-6455slot__proto__emiterror-handlingcallboundlocalbuffersrequestnegative zeroworkspace:*snsbundlerintrinsicajvdynamodbharmonyglobprotobufelectronjoiInt8Array_.extendflaginstallES8Object.isspecs3utilsliceaccessibilityreadablestreames8trimRightfastclonesignalshttpsgdprSymbolmkdirsbinaryhooksrecursiveUint8ClampedArraytypesUint8ArrayzxURLSearchParamstoStringTagyuppropeventstranspileserializerStyleSheetWebSocketprunepropertysequencehandlerscommanderObject.keyscloudtrailbinreactprototypeES2019shamesUint32ArrayES2022dropjQuery$.extendrgbpyyamlansiec2eslintpluginwgetinweakmapacornkinesisperformancecoercibletranspilercensorBigUint64ArrayhasOwnPropertytddfixed-widthwaapireadablewhichgetnativeforkgetOwnPropertyDescriptorCSSStyleDeclarationECMAScript 7react-testing-libraryStreamsglobalframeridleawslintECMAScript 2022installergetPrototypeOfcopyswftypedarrayprocessbeanstalkcloudformationrds.envutilitiesexecECMAScript 2020fast-deep-copytoolkitoperating-systempackagesserializationlocationimportexportArray.prototype.includesuser-streamsclassnamesreadform-validationcallbindeventDispatcherObject.entriesoptimistlanguageES6redirectuploadreduxArrayBuffer#sliceexpressregular expressionmodulesxhrposeES7isConcatSpreadabletermvestObject.getPrototypeOfpurees-shim APIsigtermES5Seterrorkoreanmatchlogbddjapaneseroute53oncestylesheetgraphqlspringsigintclass-validatorpredictableiterationdeepoptionmomentArrayinspectelmnested csstrimEndfpdeletematchesarktypereusejavascriptdataviewtestfunctionsdependency manageromitquerystringschemaiterateObject.fromEntriesJSONnodejsfast-clonesesgetoptes2018dom-testing-libraryES2021browserlistdatastructureimportstatustouchnegativeESnextschemeconsumepositivesafeincludesvarscontainseventEmittercjkjsdomdeepcloneebsuninstallassignprettyhelpersdefinePropertygesturestypeofexecfilelrugenericsless.jscssrandomstructuredClonesqsforEachwaitES2020toobjectrangeerrorlivegradients css3getteri18nstyled-componentsreact animationES2015deep-cloneperformantpushsettingsutil.inspectenderviewfastcopytypanionsymbolshardlinksidentifiersaccessorfull-widthbabel-coreES2017syntaxarrayajaxparsepolyfillbundlingrequirezodsuperagentsortedgroupBymakemockingredactarrayscolumnES2016keyelasticachejsonschemaemrisformpromisepasswordReactiveXwindowargumentgroupreducerhotworkflowArray.prototype.findLastfnmatchvalidationencryptionprefixenvironmentawesomesaucewarningvalidmapreducesimpledbString.prototype.matchAllspinnerHyBifindbrowserobjpostcssinterruptsfindLastcodesstarterglacierArrayBuffer.prototype.sliceless mixinsArray.prototype.filterlengthtoArraymacoshandlerbootstrap lessES2018styleguidetextchromecertificatesirqairbnbprivate dataprivatecircularreact-hook-formexpressiontacitloggingfullcolumns0lesscssreplayvaluesqueueMicrotaskdragstatejshintvalidateenumerable256postcss-pluginchai
3.8.75

11 months ago

3.8.74

11 months ago

3.8.73

11 months ago

3.8.72

11 months ago

3.8.71

11 months ago

3.8.70

11 months ago

3.8.69

11 months ago

3.8.68

11 months ago

3.8.67

11 months ago

3.8.66

11 months ago

3.8.65

11 months ago

3.8.64

11 months ago

3.8.63

11 months ago

3.8.62

11 months ago

3.8.61

11 months ago

3.8.60

11 months ago

3.8.59

11 months ago

3.8.58

11 months ago

3.8.57

11 months ago

3.8.56

11 months ago

3.8.55

11 months ago

3.8.54

11 months ago

3.7.54

11 months ago

3.7.53

11 months ago

3.7.52

11 months ago

3.7.51

12 months ago

3.6.51

12 months ago

3.5.51

12 months ago

3.5.50

12 months ago

3.5.49

12 months ago

3.5.48

12 months ago

3.5.47

12 months ago

3.5.46

12 months ago

3.5.45

12 months ago

3.5.44

12 months ago

3.5.43

12 months ago

3.5.42

12 months ago

3.5.41

12 months ago

3.4.41

12 months ago

3.4.40

12 months ago

3.4.39

12 months ago

3.4.38

12 months ago

3.4.37

12 months ago

3.4.36

12 months ago

2.4.36

12 months ago

2.4.35

1 year ago

2.4.34

1 year ago

2.4.33

1 year ago

2.4.32

1 year ago

2.4.31

1 year ago

2.4.30

1 year ago

2.4.29

1 year ago

2.4.28

1 year ago

2.4.27

1 year ago

2.4.26

1 year ago

2.4.25

1 year ago

2.3.25

1 year ago

2.2.25

1 year ago

2.2.24

1 year ago

2.2.23

1 year ago

2.2.22

1 year ago

2.2.21

1 year ago

2.1.21

1 year ago

2.1.20

1 year ago

2.1.19

1 year ago

2.1.18

1 year ago

1.1.18

1 year ago

1.1.17

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

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