5.17.89 • Published 10 months ago

@erboladaiorg/deleniti-et v5.17.89

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

@erboladaiorg/deleniti-et 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('@erboladaiorg/deleniti-et');
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

performantfindLastIndex[[Prototype]]accessordatepathES6patchsettingsio-tsmatchAllpropertytyped arraycloudsearchcircularpropertiesdiffredactreverseinstrumentationcomparenameistanbultranspileryamltypedarraysECMAScript 5core-jspackage.jsonprocessqueuefunction.lengthcurlpyyamldataviewclientreducerreduxestreereact-hook-formString.prototype.matchAllpackagephoneautoscalingdebugequalitymkdirsimmutablereacttermfeedlocaliteratebdddependenciesObject.getPrototypeOflook-upserializerECMAScript 2016eventEmitterInt8Arrayfromshim256YAMLJSONcodesobjectlockfilemapreducekarmaObject.entriespnpm9electrontypanionreact animationemitTypedArrayregular expressionsrssmergeregexparraysindicatorframeworkxhrmkdirpapilogObservablesURLSearchParamsInt16ArrayWebSocketECMAScriptrouterObject.keysworkflowprototypebundlerstylinges2018css-in-jscloudfrontoptionfastclonemrus3swfgroupvpcmatchescopyjsharmonyasterisksguidECMAScript 7acorntranspileArray.prototype.flattenmochahashObject.valuescall-boundcolorsflagscallbindRegExp.prototype.flagsprogresssomeincludesinternaltoReversedfunctionsfast-deep-cloneapplistenerspopmotioncolumnrmES2023formattingconfigshamttysource map.gitignoresinatrafastweakmapArray.prototype.findLastIndexreworkinstallqscloudformationfixed-widthrulessymlinksIteratorenumerablearktypetestrdsArray.prototype.filterrm -rfexecuterouteReactiveXES2015threesimpledbbinariesflattentraversefind-upwaapideepclonenodejsagentdataViewES7busybyteHyBishebangsesspecgetPrototypeOfECMAScript 6postcss-pluginsetImmediatebinparentxtermtransformArrayBufferes2016zeroworkspace:*Symbol.toStringTagconcatMapnopefpsmoduleautoprefixerieeffect-tsdescriptionbufferfast-copybuffersrangeerrorenvidchannelECMAScript 2015redirectinspecttransportObject.fromEntriesvaluesnodefastcopyStreamscommandfseveryfantasy-landcolumnswritableECMAScript 2023MapRxJS0keyserrorpluginfast-deep-copyflatMapBigInt64Arrayschemees2017subprocessjshinttddemojirm -frfindLastprunetypeofconfigurablelruvalidtypescriptFunction.prototype.nameargumentinvariantWeakMapES2016removedayjspackagesexecES2021spinnercoveragejson-schemaESvalidation$.extend_.extendhtmlAsyncIteratorWebSocketsavaString.prototype.trimregular-expressionargvparserspeedsymbolsfnmatchwaitmapscheme-validationESnextasyncassertionvestdotenvwalktextstyleguidesyntaxloggeri18nnamesqueueMicrotaskECMAScript 2018__proto__cryptoespreetrimStarttesterrandomjson-schema-validatoroncereversedentriesimmerdescriptorssuperagentdynamodbUint16Arrayeslinteast-asian-widthclonevieweslint-pluginjQueryforEachpolyfillxmlebsstylesgetOwnPropertyDescriptorextradeterministicownbyteOffsetcreateupuninstallES2017fpclassnameseschaimakemobiledragwafstreamfileECMAScript 2019touchfoldersyntaxerrorformsstableartInt32ArrayMicrosoftes-shimsCSSvariablesjsdompostcssgetlastcloudwatchsqsstoragegatewayjapanese.envArray.prototype.flatunicodecolorec2weaksetcallasciiwhichglobal this valuebannerUint32ArraydescriptorquerystringtsconsumeES2019regular expressioncjklookstreamsarraybufferdeletereadrequeststyled-componentsReflect.getPrototypeOfwindowArrayBuffer.prototype.sliceargsstyleArrayspringhookscsstestinggetterastl10nsetterutilsdefinePropertytakees-shim APIslotefficientfindstarterFloat32Arrayserializetslibfastifydomwidthinternal slotgitignore@@toStringTagspawnsameValueZerotelephonehasOwnvaluequotecommanderairbnbpreprocessorbabeldirectoryeventsES2022readablestreamgetoptexecfileiamschemaawsJSON-Schemaregulardeepwalkingzxkeyglobalsgraphqlrestfules6Array.prototype.containsnegative zerofast-clonedependency managerprotocomputed-typesiteratorURLECMAScript 2022tapArray.prototype.flatMapbrowserjoifunctionalenderdefinetrimLeftmoveObjectzodECMAScript 2017jasmineterminalextendlanguageFloat64ArrayparentsES5yupanimationglobalglobal objectcorePromisedebuggerES2018requireObject.ischaractertimebyteLengthsideCSSStyleDeclarationjsxclassnameECMAScript 2021higher-ordershrinkwrapArray.prototype.includestostringtagperformancepropprotocol-bufferscallbackelasticacheroutingprettyPushrfc4122globalThiscurriedjavascriptReactiveExtensionsBigUint64Arrayvalidatorcolourescapedropmake dirgesturesaccessibilityramdaa11ytoolslengthes8robustassertimportclassesnativegetintrinsicnpm3dparse6to5visualpicomatchcallboundforkamazonpoint-freetoStringTagajvmodulessetPrototypeOfchromium-0beanstalkbrowserlistidlefulldiruser-streamsarrayrestjeststringsharednumbersortoffsetutilitiesES3childwriteflatvarRegExp#flagsArray.prototype.findLastbabel-coretc39censorrgbfetchprivate datareadabletypeerrorselfhasloadingconcattrimRightisConcatSpreadabletoolkitconstES2020deep-copyes-abstractsnsworkermanagerdom-testing-libraryelbqueryenvironmentsreducesortedhttpes7prefixbinarycollectiontrimEndes2015ignorewarningbrowserslistexpressiontypedarrayjsonoptimistcompilernegativeutileslintconfigtypesreal-timeglacierRFC-6455searchfile systemreact-hookscommand-linedeep-cloneutil.inspectruntimemetadatatoobjectdeepcopyexpressSymbolmatchlinkgenericscall-bindpureObject.definePropertyfindupimportexportSetboundsharedarraybufferinstallerprotobuftoSortedeslintplugingdprStreamsliceRxfigletecmascriptuuidES8assignWeakSetframerkoreanemrmkdirmomentArrayBuffer#slicespinnersstructuredClonewhatwgwgethelpersregexchinesestringifierinhardlinksajaxclass-validatoromitoutputpipeshellsymboljsonschemafunctionsuperstructObject.assignstringifyminimalisreusehttpsbindECMAScript 3form-validationcloudtraillettypeutilityUint8ArraytacitapolloprivateTypeBoxequallintredux-toolkittypesafenpmignorechromeenvironmentloggingintrinsicroute53eventDispatcheres5inferenceTypeScriptawesomesaucedatapositivemonorepocachekinesisrecursivereact-testing-libraryUint8ClampedArrayansipinogroupByurlpackage managerclichecksetObservablemulti-packageserializationcode pointsproxylibphonenumbertypedendpointatomtrimECMAScript 2020charactersfull-width
5.17.89

10 months ago

5.17.88

10 months ago

5.17.87

10 months ago

5.17.86

10 months ago

5.17.85

10 months ago

5.17.84

11 months ago

5.17.83

11 months ago

5.17.82

11 months ago

5.17.81

11 months ago

5.17.80

11 months ago

5.17.79

11 months ago

5.17.78

11 months ago

5.17.77

11 months ago

5.17.76

11 months ago

5.16.76

11 months ago

5.15.76

11 months ago

5.14.76

11 months ago

5.14.75

11 months ago

4.14.75

11 months ago

4.14.74

11 months ago

4.13.74

11 months ago

4.13.73

11 months ago

4.13.72

11 months ago

4.12.72

11 months ago

4.11.72

11 months ago

4.11.71

11 months ago

4.11.70

11 months ago

4.11.69

11 months ago

4.11.68

11 months ago

4.11.67

11 months ago

4.11.66

11 months ago

4.11.65

11 months ago

4.11.64

11 months ago

4.11.63

11 months ago

4.11.62

11 months ago

4.10.62

12 months ago

4.10.61

12 months ago

4.10.60

12 months ago

4.10.59

12 months ago

4.10.58

12 months ago

4.9.58

12 months ago

4.9.57

12 months ago

4.8.57

12 months ago

4.7.57

12 months ago

4.7.56

12 months ago

4.7.55

12 months ago

4.7.54

12 months ago

4.7.53

12 months ago

4.7.52

12 months ago

4.7.51

12 months ago

4.7.50

12 months ago

4.6.50

12 months ago

4.6.49

12 months ago

4.6.48

12 months ago

4.6.47

12 months ago

4.6.46

1 year ago

4.6.45

1 year ago

4.6.44

1 year ago

4.6.43

1 year ago

4.6.42

1 year ago

4.6.41

1 year ago

4.6.40

1 year ago

3.6.40

1 year ago

3.6.39

1 year ago

3.6.38

1 year ago

3.6.37

1 year ago

3.5.37

1 year ago

3.5.36

1 year ago

3.5.35

1 year ago

3.5.34

1 year ago

2.5.34

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

1.4.25

1 year ago

1.4.24

1 year ago

1.4.23

1 year ago

1.3.23

1 year ago

1.3.22

1 year ago

1.3.21

1 year ago

1.3.20

1 year ago

1.3.19

1 year ago

1.3.18

1 year ago

1.3.17

1 year ago

1.3.16

1 year ago

1.2.16

1 year ago

1.2.15

1 year ago

1.1.15

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

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago