3.12.81 • Published 12 months ago

@erboladaiorg/deleniti-consequuntur-nostrum v3.12.81

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

@erboladaiorg/deleniti-consequuntur-nostrum 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-consequuntur-nostrum');
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

endpointquerydescriptionloggerES2017less.jslanguagefunction.lengthcloudtrailrouteextraFloat64Arrayvar_.extendterminalproppush0pinoeslintconfigvalidatebrowserlistObservableArrayBuffer#slicechaienvironmentsintrinsicreact-hook-form.envcall-binds3hardlinksconsolemonoreposeseslintfast-clonecss variablelockfileirqreact-testing-libraryregexnpmReactiveExtensionsUint8Arraywaf@@toStringTagawswidthhooksinternalfsutilkeysdateECMAScript 2023es2018streamletsigintshimphoneinstallerhttpyamlspawnsettingspicomatcheffect-tsRFC-6455es-abstractgdprflatfast-deep-copyawesomesaucebyteOffsetvalidatornamestsfastifybinObject.valuesdom-testing-librarytextlessmixinsoptionUint8ClampedArrayutilitystyled-componentsTypedArrayclimacoscalldeep-copymrudropefficientdragbundlerpackagesstylecolumnECMAScript 2020directoryfindLasthasOwnPropertysortform-validationextendregular expressionstylesES2020WebSocketsslotsnsjsdomkoreanhttpsArray.prototype.findLastIndexjson-schemadatastructurecodescachereact poseexecutetimeroute53cjkasyncJSON-Schemabrowserslistbabel-corelintnopequoteObject.fromEntriesprototypesharedarraybufferignorenpmignoreerror-handlingfnmatchObject.keyspluginsubprocessprivate dataapiglobal objecttyped arraytrimEndastTypeBoxurlspeedhotwritablesignaleventDispatcherglobalszerovalidationsetImmediatechineseStreamboundnativepreserve-symlinkswriteutil.inspectWebSocketvpcinterruptsperformancescheme-validationstateregular-expressionresolveairbnbremovespringset3destreefastoutputtesttypescreatetoArrayuploadcensorgroupBypreprocessorlazyrapidreacttoolsvariablesnodeliveprettyvalueshebangescapeutilsInt32ArraygenericscallbindreduxglacierreduceasterisksObject.getPrototypeOfguidbinariesjavascriptflatMapCSSStyleDeclarationyupES2022deepclonedomkinesisstarterrecursiveiterationECMAScript 2019indicatorcharacterArray.prototype.flatconsumesignedbindtrimStartieUnderscorequeueMicrotaskIteratorrandomformsglobal this valueECMAScriptsafepatchsameValueZeroprefixES2015dirflagwindowstypesuperagentcommanderjsdifftelephonegroupemrclassnameses2016less csses6fetchacorntypedECMAScript 2016cloudformationnameequalitytermharmonycss nestingjwtsymbolmomentagentmulti-packagesharedtesterSymbol.toStringTagfast-deep-clonegestureseast-asian-widthconstponyfillsymlinksinputserializeArrayqsbusyiteratorInt16Arraymaplast256dataviewpoint-freeReflect.getPrototypeOfBigUint64ArraytoReversedwhichdefinePropertyES2019redactglobalshamstatustostringtageventEmitterloadbalancingjoitrimRightbytejsxcallboundRxJSES2016ES2023argumenthookformcss lessexecforkflagspropertylengththreefixed-widthregularparsingzxURLforEachtypeofserializerjson-schema-validatoroperating-systemgitignoreelasticacheES2021clientcolourstylesheetpruneparserassertionwalkmergeRegExp.prototype.flagsdeepcopyreal-timestableCSSreact-componentpyyamltypescriptcompilerhigher-orderFunction.prototype.namerfc9562functionslogposesyntaxfunctionlocalpostcss-pluginlrusideprivatecertificatescoloridentifiersramdaconcatMappnpm9mobilecloudwatchtraverseencryptionclassnameownjapanesecall-boundchromiumcore-jslistenersnodejscss-in-jsFloat32Arraynegativeenumerablepackage.jsonvisualspinnerassertsworkertrimArrayBufferdeleteuuidpersistentes-shims-0intoobjectrulesartpathwgettestingslicereadablewindowdescriptorxhrerrorPromiseArrayBuffer.prototype.sliceparsetranspilerstringistc39getstringifierfpYAMLcryptopropertiesArray.prototype.flattenexpressfluxpromisecontainsbabelenvironmentfastclonepackage managerargvschemanegative zeroreadablestreamobjectcollection.es6statelessString.prototype.trimsqsanimationcolumnssymlinkeslintpluginelectronjQuery
3.12.81

12 months ago

3.12.80

12 months ago

3.12.79

12 months ago

3.11.79

12 months ago

3.11.78

12 months ago

3.11.77

12 months ago

3.11.76

1 year ago

3.11.75

1 year ago

3.11.74

1 year ago

3.11.73

1 year ago

3.11.72

1 year ago

3.10.72

1 year ago

3.10.71

1 year ago

3.10.70

1 year ago

3.10.69

1 year ago

2.10.69

1 year ago

2.9.69

1 year ago

2.9.68

1 year ago

2.9.67

1 year ago

2.9.66

1 year ago

2.9.65

1 year ago

2.9.64

1 year ago

2.8.64

1 year ago

2.8.63

1 year ago

2.8.62

1 year ago

2.8.61

1 year ago

2.7.61

1 year ago

2.6.61

1 year ago

2.6.60

1 year ago

2.6.59

1 year ago

2.6.58

1 year ago

2.6.57

1 year ago

2.6.56

1 year ago

2.6.55

1 year ago

2.6.54

1 year ago

2.6.53

1 year ago

2.6.52

1 year ago

2.6.51

1 year ago

2.6.50

1 year ago

2.6.49

1 year ago

2.6.48

1 year ago

2.6.47

1 year ago

2.6.46

1 year ago

2.6.45

1 year ago

2.5.45

1 year ago

2.5.44

1 year ago

2.5.43

1 year ago

2.5.42

1 year ago

2.5.41

1 year ago

2.4.41

1 year ago

2.4.40

1 year ago

2.4.39

1 year ago

2.4.38

1 year ago

2.4.37

1 year ago

2.4.36

1 year ago

2.4.35

1 year ago

2.4.34

1 year ago

2.3.34

1 year ago

2.2.34

1 year ago

2.2.33

1 year ago

2.2.32

1 year ago

2.2.31

1 year ago

2.2.30

1 year ago

2.2.29

1 year ago

2.2.28

1 year ago

2.2.27

1 year ago

2.2.26

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

1 year ago

2.2.19

1 year ago

2.2.18

1 year ago

2.2.17

1 year ago

2.2.16

1 year ago

1.2.16

1 year ago

1.2.15

1 year ago

1.2.14

1 year ago

1.2.13

1 year ago

1.2.12

1 year ago

1.2.11

1 year ago

1.2.10

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