10.13.145 • Published 9 months ago

@firanorg/temporibus-quibusdam-non v10.13.145

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

9 months ago

10.13.144

9 months ago

10.13.143

9 months ago

9.13.135

10 months ago

9.13.136

10 months ago

9.13.131

10 months ago

9.13.132

10 months ago

9.13.133

10 months ago

9.13.134

10 months ago

9.13.130

10 months ago

9.13.128

10 months ago

9.13.129

10 months ago

9.13.126

10 months ago

9.13.127

10 months ago

10.13.141

9 months ago

10.13.140

9 months ago

10.13.142

9 months ago

10.13.138

9 months ago

10.13.137

9 months ago

10.13.139

9 months ago

10.13.136

9 months ago

9.13.124

10 months ago

9.13.125

10 months ago

8.13.123

10 months ago

9.13.123

10 months ago

8.13.122

10 months ago

8.13.120

10 months ago

8.13.121

10 months ago

8.13.117

10 months ago

8.13.116

10 months ago

8.13.119

10 months ago

8.13.118

10 months ago

8.13.115

10 months ago

8.13.114

10 months ago

8.13.113

10 months ago

8.13.112

10 months ago

8.13.111

10 months ago

8.12.111

10 months ago

8.12.110

10 months ago

7.12.110

10 months ago

7.12.109

11 months ago

7.12.108

11 months ago

7.12.107

11 months ago

7.12.106

11 months ago

7.12.105

11 months ago

7.12.104

11 months ago

7.12.103

11 months ago

7.12.102

11 months ago

7.12.101

11 months ago

7.12.100

11 months ago

7.12.99

11 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

12 months ago

4.6.44

1 year ago

4.8.66

1 year ago

4.8.68

12 months ago

4.6.43

1 year ago

5.10.74

12 months ago

5.9.74

12 months 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

11 months ago

7.11.92

11 months ago

7.11.93

11 months ago

7.11.94

11 months ago

6.10.75

12 months ago

7.11.95

11 months ago

6.10.74

12 months ago

5.8.74

12 months ago

5.8.70

12 months ago

5.8.71

12 months ago

5.8.72

12 months ago

5.8.73

12 months ago

4.7.52

1 year ago

4.7.53

1 year ago

7.10.90

11 months ago

4.7.50

1 year ago

4.7.51

1 year ago

7.10.91

11 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

12 months ago

5.8.69

12 months 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

11 months ago

7.12.96

11 months ago

7.12.97

11 months ago

7.12.98

11 months ago

7.10.76

12 months ago

7.10.75

12 months ago

7.10.78

12 months ago

7.10.77

12 months ago

7.10.79

12 months 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

12 months ago

4.5.43

1 year ago

7.10.80

12 months ago

7.10.83

11 months ago

7.10.82

11 months ago

7.10.85

11 months ago

7.10.84

11 months ago

7.10.87

11 months ago

7.10.86

11 months ago

7.10.89

11 months ago

7.10.88

11 months 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