5.17.89 • Published 2 years ago

@erboladaiorg/deleniti-et v5.17.89

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

2 years ago

5.17.88

2 years ago

5.17.87

2 years ago

5.17.86

2 years ago

5.17.85

2 years ago

5.17.84

2 years ago

5.17.83

2 years ago

5.17.82

2 years ago

5.17.81

2 years ago

5.17.80

2 years ago

5.17.79

2 years ago

5.17.78

2 years ago

5.17.77

2 years ago

5.17.76

2 years ago

5.16.76

2 years ago

5.15.76

2 years ago

5.14.76

2 years ago

5.14.75

2 years ago

4.14.75

2 years ago

4.14.74

2 years ago

4.13.74

2 years ago

4.13.73

2 years ago

4.13.72

2 years ago

4.12.72

2 years ago

4.11.72

2 years ago

4.11.71

2 years ago

4.11.70

2 years ago

4.11.69

2 years ago

4.11.68

2 years ago

4.11.67

2 years ago

4.11.66

2 years ago

4.11.65

2 years ago

4.11.64

2 years ago

4.11.63

2 years ago

4.11.62

2 years ago

4.10.62

2 years ago

4.10.61

2 years ago

4.10.60

2 years ago

4.10.59

2 years ago

4.10.58

2 years ago

4.9.58

2 years ago

4.9.57

2 years ago

4.8.57

2 years ago

4.7.57

2 years ago

4.7.56

2 years ago

4.7.55

2 years ago

4.7.54

2 years ago

4.7.53

2 years ago

4.7.52

2 years ago

4.7.51

2 years ago

4.7.50

2 years ago

4.6.50

2 years ago

4.6.49

2 years ago

4.6.48

2 years ago

4.6.47

2 years ago

4.6.46

2 years ago

4.6.45

2 years ago

4.6.44

2 years ago

4.6.43

2 years ago

4.6.42

2 years ago

4.6.41

2 years ago

4.6.40

2 years ago

3.6.40

2 years ago

3.6.39

2 years ago

3.6.38

2 years ago

3.6.37

2 years ago

3.5.37

2 years ago

3.5.36

2 years ago

3.5.35

2 years ago

3.5.34

2 years ago

2.5.34

2 years ago

2.4.34

2 years ago

2.4.33

2 years ago

2.4.32

2 years ago

2.4.31

2 years ago

2.4.30

2 years ago

2.4.29

2 years ago

2.4.28

2 years ago

2.4.27

2 years ago

2.4.26

2 years ago

2.4.25

2 years ago

1.4.25

2 years ago

1.4.24

2 years ago

1.4.23

2 years ago

1.3.23

2 years ago

1.3.22

2 years ago

1.3.21

2 years ago

1.3.20

2 years ago

1.3.19

2 years ago

1.3.18

2 years ago

1.3.17

2 years ago

1.3.16

2 years ago

1.2.16

2 years ago

1.2.15

2 years ago

1.1.15

2 years ago

1.1.14

2 years ago

1.1.13

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago