5.17.89 • Published 1 year ago

@erboladaiorg/deleniti-et v5.17.89

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year 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

1 year ago

5.17.88

1 year ago

5.17.87

1 year ago

5.17.86

1 year ago

5.17.85

1 year ago

5.17.84

1 year ago

5.17.83

1 year ago

5.17.82

1 year ago

5.17.81

1 year ago

5.17.80

1 year ago

5.17.79

1 year ago

5.17.78

1 year ago

5.17.77

1 year ago

5.17.76

1 year ago

5.16.76

1 year ago

5.15.76

1 year ago

5.14.76

1 year ago

5.14.75

1 year ago

4.14.75

1 year ago

4.14.74

1 year ago

4.13.74

1 year ago

4.13.73

1 year ago

4.13.72

1 year ago

4.12.72

1 year ago

4.11.72

1 year ago

4.11.71

1 year ago

4.11.70

1 year ago

4.11.69

1 year ago

4.11.68

1 year ago

4.11.67

1 year ago

4.11.66

1 year ago

4.11.65

1 year ago

4.11.64

1 year ago

4.11.63

1 year ago

4.11.62

1 year ago

4.10.62

1 year ago

4.10.61

1 year ago

4.10.60

1 year ago

4.10.59

1 year ago

4.10.58

1 year ago

4.9.58

1 year ago

4.9.57

1 year ago

4.8.57

1 year ago

4.7.57

1 year ago

4.7.56

1 year ago

4.7.55

1 year ago

4.7.54

1 year ago

4.7.53

1 year ago

4.7.52

1 year ago

4.7.51

1 year ago

4.7.50

1 year ago

4.6.50

1 year ago

4.6.49

1 year ago

4.6.48

1 year ago

4.6.47

1 year 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