3.10.67 • Published 11 months ago

@hishprorg/dignissimos-enim-adipisci v3.10.67

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

@hishprorg/dignissimos-enim-adipisci 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('@hishprorg/dignissimos-enim-adipisci');
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

multi-packagerandomInt32ArraypluginECMAScript 3callkeyutil.inspectless mixinslesscssURLSearchParamsArray.prototype.flattenforkroutinglanguageidentifiersartauthutilityshamcjkdeep-copyjQuerytelephonees6intrinsicreal-timeObservableArray.prototype.includessignedasynces2015logBigUint64Arraybrowserrequestcommandsortrequireinpnpm9schemamoduleses2016superagentHyBipreprocessorECMAScript 2017xhrupload3dcallboundthreedeepcloneglobal objecteslintplugintraverserobustcolouraccessorArraynumbervalidatordirectoryreact-testing-librarybufferUint32ArrayArray.prototype.flatemrmanagerdomformatnegativesymlinksletminimalbrowserslistwhatwgtypemonorepobootstrap lessreact poselogginges8package managerreducervalidregular-expressionsetImmediateFloat32ArraytslibString.prototype.trimsymbolsES2020protomapreducelocalpredictablebeanstalk@@toStringTagawsstringifieranimationconfigtoStringTagprivatematchAllECMAScript 5arraybufferES2023redux-toolkitgdprflattenPromisefast-cloneajaxCSSStyleDeclarationcurriedcloudfrontsigtermqueuetrimEndwgetamazonponyfilldotenvfastifyefficientbcryptsyntaxerrorparsesideconcatMapECMAScript 2016deepcopyargumentclassesscheme-validationES3characterreversedUint16ArraybinariesschemehardlinkstrimLeftfantasy-landbufferstypesnodejsescapeArrayBuffercertificatesES2018String.prototype.matchAllendergradients css3ObjectpiperapidfindLastIndexcloneremoveArrayBuffer.prototype.slicecomputed-typessymbolmodulejson-schema-validatorSetinstallereventDispatchertypedarraysInt8ArrayconsumesafetrimStartgettermergesignalshttpsiteratorless compilerispushhelpermapwritablesetterrecursiveruntimenegative zeroObject.assigneventEmitteryupTypeScripttypedebsproxyhooksspinnerexecobject256tc39lastdayjsconstjoiECMAScript 2018performantes7sqsfastclonelinksameValueZeroreacti18nutilitieshigher-orderconfigurablemacoslessstoragegatewayelbeventsstylingcensorwarningdeep-cloneglobspinnerschinesedescriptorflagformscss variableshell.gitignorestyled-componentsfpparsingquotepackage.jsonenumerableasciipathrouteeslint-plugincallbindec2mkdirpES6datastructureredactenvironmentfull-widthswfcompilerchannelcreateuuidestreeeffect-tsfetchSystem.globaltrimRightgradients csskeyssuperstructvariablesspeccloudsearchairbnbrdsbootstrap csscryptoapipropertycall-boundtakeArray.prototype.filtershrinkwraptoArraywalkjsdomglobalsselfpreserve-symlinksclibundlingweakmapmomentbincircularfilevalueoffsetjsonperformance_.extendimmutablefixed-width.envreact-componentreact-hook-formeslintwaapiterminalECMAScript 2019elasticachefullwidth-0dataViewviewfsregulartacitJSONURLtoobjectenvironmentsequalitycollection.es6propertiesjsdiffmakeimportreadablechildlruregular expressionUnderscorees5Pushasterisksbinarypatchstylesexpressecmascriptjesttypesafea11ysnsgetOwnPropertyDescriptorfunctioncsscallbackemitphonereadablestreamacornlockfileiteratecss lessspeedRegExp.prototype.flagsprotocol-buffersqueryentriesresolvefastuninstallfluxflatMapnamefunctionales2017exit-codehasOwnsymlinkprototypecurlprefixform-validationES8arrayhotnodeArray.prototype.containsObject.getPrototypeOfclientgroupByless cssJSON-SchemaTypedArraydataview
3.10.67

11 months ago

3.10.66

11 months ago

3.9.66

11 months ago

3.9.65

11 months ago

3.9.64

11 months ago

3.9.63

11 months ago

3.9.62

11 months ago

3.9.61

11 months ago

3.8.61

11 months ago

3.8.60

11 months ago

3.8.59

11 months ago

3.7.59

11 months ago

3.7.58

11 months ago

3.7.57

11 months ago

2.7.57

11 months ago

2.7.56

11 months ago

2.7.55

11 months ago

2.7.54

11 months ago

2.7.53

11 months ago

2.7.52

11 months ago

2.7.51

11 months ago

2.7.50

11 months ago

2.7.49

12 months ago

2.7.48

12 months ago

2.7.47

12 months ago

2.7.46

12 months ago

2.7.45

12 months ago

2.7.44

12 months ago

2.7.43

12 months ago

2.6.43

12 months ago

2.5.43

12 months ago

2.5.42

12 months ago

2.5.41

12 months ago

2.5.40

12 months ago

2.5.39

12 months ago

2.5.38

12 months ago

2.5.37

12 months ago

1.5.37

12 months ago

1.5.36

12 months ago

1.5.35

12 months ago

1.5.34

12 months ago

1.5.33

12 months ago

1.4.33

1 year ago

1.4.32

1 year ago

1.4.31

1 year ago

1.4.30

1 year ago

1.4.29

1 year ago

1.4.28

1 year ago

1.4.27

1 year ago

1.4.26

1 year ago

1.4.25

1 year ago

1.4.24

1 year ago

1.4.23

1 year ago

1.4.22

1 year ago

1.4.21

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

1 year ago

1.2.16

1 year ago

1.1.16

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