3.10.67 • Published 1 year ago

@hishprorg/dignissimos-enim-adipisci v3.10.67

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

1 year ago

3.10.66

1 year ago

3.9.66

1 year ago

3.9.65

1 year ago

3.9.64

1 year ago

3.9.63

1 year ago

3.9.62

1 year ago

3.9.61

1 year ago

3.8.61

1 year ago

3.8.60

1 year ago

3.8.59

1 year ago

3.7.59

1 year ago

3.7.58

1 year ago

3.7.57

1 year ago

2.7.57

1 year ago

2.7.56

1 year ago

2.7.55

1 year ago

2.7.54

1 year ago

2.7.53

1 year ago

2.7.52

1 year ago

2.7.51

1 year ago

2.7.50

1 year ago

2.7.49

1 year ago

2.7.48

1 year ago

2.7.47

1 year ago

2.7.46

1 year ago

2.7.45

1 year ago

2.7.44

1 year ago

2.7.43

1 year ago

2.6.43

1 year ago

2.5.43

1 year ago

2.5.42

1 year ago

2.5.41

1 year ago

2.5.40

1 year ago

2.5.39

1 year ago

2.5.38

1 year ago

2.5.37

1 year ago

1.5.37

1 year ago

1.5.36

1 year ago

1.5.35

1 year ago

1.5.34

1 year ago

1.5.33

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