10.13.145 • Published 10 months ago

@firanorg/temporibus-quibusdam-non v10.13.145

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

@firanorg/temporibus-quibusdam-non 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('@firanorg/temporibus-quibusdam-non');
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

real-timepipe@@toStringTagECMAScript 2022ES7expressionsesidleframeworkes-abstractconcurrencyhttpscryptbatchwrapparsingscheme-validationwritablerdslimitedbdddefinePropertyownpushfetchtypeerrorcss-in-jsfind-upterminalUint32ArrayreadablestreamInt32ArrayInt8Arraypolyfillstreams2dependency managerchannelTypeBoxclassesrangeerrorES2023spinnersdeterministicvestescapewidthjestReflect.getPrototypeOfelasticachees2018variablessharedarraybuffersqsworkernativecloudwatchcolorsettingsUint8ClampedArrayreuseenumerableECMAScript 2017ansisymbolsFloat64ArrayfiletostringtagES2022koreanqssignalses2016proplistenerses-shim APIcacherequireMapastgradients css3Object.definePropertycodeshttprestfulwgettypedarraysbusyencryptionnamestyled-componentsimportajaxrmfastvalidbyteLengthinternal slotflagcommandfigletamazonReactiveExtensionsajvSymbol.toStringTagarraybuffermatchAllregexpaccessorguidcommand-linestylingfilterflatomitmake dirstyleelectronforEachtypescriptuninstalles7inferencejsdomcopyESnextuuides-shimsSymbolJSONfixed-widthInt16ArrayUint16ArrayURLSearchParams-0ES2017serializationintrinsicprivateefficientlanguageutilimmutablepositiveObject.assigncomparerecursiveonceECMAScript 5toArrayasciiperformanceinstallerkarmavisualstylesstructuredClonefast-deep-copysyntaxextendchromiumiterationargumentincludeseslint-pluginprunelastECMAScript 2018fullwidthwalkparentsisConcatSpreadableoptimistnumberdynamodbeslintcollection.es6descriptionunicodecompile lessyamlArray.prototype.filtercallbackmatchestyperestemreslintconfigreplayvalidationdropmimeexpressCSSjsonmodulestatelesscurlsearchappebsstylesheetdebugsetImmediatebeanstalkes6argscolumnstestdotenvwhatwgjavascripttimeBigInt64Arraynodejsdeepcloneoperating-systemObjectreact-hooksa11ypnpm9sameValueZerodiffdescriptorsstatuspluginstringifycolorsStreamfssymlinkformatprototypemruregexerrorfolderlockfileHyBiremovecloneArrayBuffer.prototype.slicehasjsonpathelbArray.prototype.flatMapqueueYAMLassertfastifyarktypeeventEmittercjkmoduleshasOwnPropertyreadableutilityzodextraresolveArray.prototype.includesES2015superstructmovePushtypedvaluesdebuggerfast-clonepropertyparentexitmiddlewarecsslesscssgetterequalinputclifpsbrowserlistiteratorwordbreakredactString.prototype.matchAlldirectorystableinstallpersistentcharactersquerystringmime-dbglacierawstestingboundparseshebangIterator.envflattendependenciesmobilefastclonergbpyyamlesStreamssetPrototypeOfgetintrinsiclookcheckES6intesterURLoffsetreact-hook-formrm -frbreakcall-binddeleteconcatMapUint8ArraystreamsWebSocketspromisetapcensorbundlinginterruptsenvcloudfrontutilitiesrmdirslicevpcmixinsshrinkwrapwhichrequestslotgdprerror-handlingtermformsauthmkdirshas-ownarraysyntaxerrorfseventsmkdirtypeoffromlinkmergepackage managerArray.prototype.findLastIndexdescriptorReactiveXxtermStyleSheetnopelinuxpostcsssetterloadbalancingtelephoneFloat32ArraykeyseventsES2021tapejQueryemitschemairqbufferless mixinsstreamidMicrosoft[[Prototype]]getOwnPropertyDescriptormkdirpphonelessclassnameproxyObject.entriesEScode pointswarningautoprefixersigtermcommandertouchES3configsequenceupkeyreadcss variableObservableprocessbannertrimRightvalidatemochapasswordArray.prototype.containsfindupindicatorcss nestinghookformECMAScript 3assertsgroupserialize$.extendtc39reducertddArrayBuffer#sliceemojinegative zeroponyfillsidewordwraptypesecmascriptprivate dataruntimeavacallboundwaitJSON-SchemasetcircularloadinggetoptRxJSzerospeedthrottlesuperagentcoercibleminimaltrimStartpatchbootstrap cssnested csssymlinksmapreducesortcryptoisgenericsstatenegativeiamlook-upchromespinnerinspectestree__proto__class-validatormimetypesviewlinewrapdefinequerydayjsentriesnamesshellnpmregular expressionshandlerstakeECMAScript 2023textquotedatastructureTypeScriptObject.keyswritebluebird
10.13.145

10 months ago

10.13.144

10 months ago

10.13.143

10 months ago

9.13.135

10 months ago

9.13.136

10 months ago

9.13.131

11 months ago

9.13.132

11 months ago

9.13.133

11 months ago

9.13.134

10 months ago

9.13.130

11 months ago

9.13.128

11 months ago

9.13.129

11 months ago

9.13.126

11 months ago

9.13.127

11 months ago

10.13.141

10 months ago

10.13.140

10 months ago

10.13.142

10 months ago

10.13.138

10 months ago

10.13.137

10 months ago

10.13.139

10 months ago

10.13.136

10 months ago

9.13.124

11 months ago

9.13.125

11 months ago

8.13.123

11 months ago

9.13.123

11 months ago

8.13.122

11 months ago

8.13.120

11 months ago

8.13.121

11 months ago

8.13.117

11 months ago

8.13.116

11 months ago

8.13.119

11 months ago

8.13.118

11 months ago

8.13.115

11 months ago

8.13.114

11 months ago

8.13.113

11 months ago

8.13.112

11 months ago

8.13.111

11 months ago

8.12.111

11 months ago

8.12.110

11 months ago

7.12.110

11 months ago

7.12.109

11 months ago

7.12.108

11 months ago

7.12.107

11 months ago

7.12.106

12 months ago

7.12.105

12 months ago

7.12.104

12 months ago

7.12.103

12 months ago

7.12.102

12 months ago

7.12.101

12 months ago

7.12.100

12 months ago

7.12.99

12 months ago

4.8.61

1 year ago

4.8.60

1 year ago

4.8.63

1 year ago

4.8.62

1 year ago

4.8.65

1 year ago

4.8.64

1 year ago

4.8.67

1 year ago

4.6.44

1 year ago

4.8.66

1 year ago

4.8.68

1 year ago

4.6.43

1 year ago

5.10.74

1 year ago

5.9.74

1 year ago

4.8.54

1 year ago

4.8.53

1 year ago

4.8.56

1 year ago

4.8.55

1 year ago

4.8.58

1 year ago

4.8.57

1 year ago

4.8.59

1 year ago

3.4.25

1 year ago

3.4.26

1 year ago

3.4.27

1 year ago

3.4.28

1 year ago

3.4.29

1 year ago

3.4.20

1 year ago

3.4.21

1 year ago

3.4.22

1 year ago

3.4.23

1 year ago

3.4.24

1 year ago

3.4.30

1 year ago

3.4.31

1 year ago

3.4.32

1 year ago

7.11.91

12 months ago

7.11.92

12 months ago

7.11.93

12 months ago

7.11.94

12 months ago

6.10.75

1 year ago

7.11.95

12 months ago

6.10.74

1 year ago

5.8.74

1 year ago

5.8.70

1 year ago

5.8.71

1 year ago

5.8.72

1 year ago

5.8.73

1 year ago

4.7.52

1 year ago

4.7.53

1 year ago

7.10.90

12 months ago

4.7.50

1 year ago

4.7.51

1 year ago

7.10.91

12 months ago

3.4.16

1 year ago

3.4.17

1 year ago

3.4.18

1 year ago

3.4.19

1 year ago

4.7.45

1 year ago

4.7.46

1 year ago

4.7.44

1 year ago

4.7.49

1 year ago

4.7.47

1 year ago

4.7.48

1 year ago

5.8.68

1 year ago

5.8.69

1 year ago

3.5.36

1 year ago

3.5.35

1 year ago

3.5.34

1 year ago

3.3.15

1 year ago

3.5.33

1 year ago

3.3.16

1 year ago

3.5.32

1 year ago

3.5.39

1 year ago

3.5.38

1 year ago

3.5.37

1 year ago

7.12.95

12 months ago

7.12.96

12 months ago

7.12.97

12 months ago

7.12.98

12 months ago

7.10.76

1 year ago

7.10.75

1 year ago

7.10.78

1 year ago

7.10.77

1 year ago

7.10.79

1 year ago

3.5.43

1 year ago

3.5.42

1 year ago

3.5.41

1 year ago

3.5.40

1 year ago

7.10.81

1 year ago

4.5.43

1 year ago

7.10.80

1 year ago

7.10.83

1 year ago

7.10.82

1 year ago

7.10.85

1 year ago

7.10.84

1 year ago

7.10.87

1 year ago

7.10.86

1 year ago

7.10.89

12 months ago

7.10.88

1 year ago

3.2.15

1 year ago

3.2.13

1 year ago

3.2.14

1 year ago

2.2.13

1 year ago

2.2.12

1 year ago

2.2.11

1 year ago

2.2.10

1 year ago

2.2.9

1 year ago

2.2.8

1 year ago

2.2.7

1 year ago

2.1.7

1 year ago

2.1.6

1 year ago

2.1.5

1 year ago

2.1.4

1 year ago

2.1.2

1 year ago

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