3.3.65 • Published 5 months ago

@zitterorg/recusandae-explicabo v3.3.65

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

@zitterorg/recusandae-explicabo 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('@zitterorg/recusandae-explicabo');
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

byteLengthpluginprocesspathchromiumcall-boundprotobufminimalreduceconsoleshebangcreateRxJSURLsetlinkarktypeglobgetmodulesjsspinnersjshintFloat64ArraydebuggerinstrumentationString.prototype.matchAllMapsliceassertionpicomatchECMAScript 5deletefromtrimStartSystem.globalincludesxtermmatchbannerrdssettingsnegativeexpressionunicodedotenvdescriptionloggerECMAScript 7classnameTypeScriptjsdiffrsssubprocesskeysregexpstarterpreprocessoraccessorfeedglobalsenumerablemanagerletextrareal-timeansiYAMLObject.fromEntriesArrayBuffer#slicequeueMicrotaskautoprefixerfilterenvironmentargvschemebrowserlistvisualoptimizerdescriptorrmdirsearchselfchildpolyfilldeepclonedataWebSocketfullwhichcharacterredux-toolkites7point-freeuninstallgesturesbrowserslistObject.keysObject.isrequireWeakSetArray.prototype.findLastIndexredirectgroupautoscalinges8quotesymbolstapbundlingtrimRightsinatrawalkingframeworkargsArrayenvironmentslengthgitignoreFunction.prototype.namecssnegative zeroparsemonorepovestjapaneseMicrosoftterminalprivatehas-ownposejavascriptqueuefantasy-landES2023trim$.extendamazonwafsetPrototypeOfformsscheme-validationArray.prototype.flatMapphonees2018CSSStyleDeclarationobjutil.inspectlook-upelectronECMAScript 2021dependenciesfunctionsrapidcontainsavaflagsstringpostcssfetchutilsglobal this valuesomeRxStyleSheetaccessibilityredactpostcss-pluginendercommanderbddes2015characterscallbindECMAScript 2016RFC-6455syntaxerror[[Prototype]]valuecloudfrontsortrangeerrorfast-deep-clonebuffersrestbinaryroutingtslibes-shims_.extendreact poseebsstableArray.prototype.containsinhelpersdircomputed-typesrandomprivate dataes5toobjectjsxes2016errorCSSemojiUint8ClampedArrayqspurefunction.lengthfindlookzodStreamRegExp.prototype.flagsAsyncIteratortermendpointdeep-clonexmltransportarrayvarsproxylocalshrinkwrapUint8ArrayES2020stringifyfnmatchconcatagentzxownarttraverseoffsetmodule3dreact-hooksajaxdataViewprefixsharedarraybufferstreamscolumnslogponyfillUint16ArrayemitjsdomES3awesomesaucesimpledbsesidcodesObjectpopmotionreversejson-schematddpromisegraphqllistenerssyntaxthreewgetstructuredClonemochatypesObservablerobustreacthookformsource maproutelastmomentbrowserrouterReactiveXdragregular expressionses-shim APImkdirkeyfast-copygetintrinsiclocationmaphtmlargumentqueryloggingreact animationtextentriesreads3nativeregular expressionES2018pruneformattingcallbackassertswindowvaluescjkgenericsnpmwritabledebugreadablepnpm9schemaio-tspropertyhardlinksestreenodejsString.prototype.trimistanbulinstalltypedarraymapreducesqstoArraycode pointsprototypeforkexecfileequalitymkdirs256apichannelvalidatorfull-widthtranspileES6ECMAScript 2017classestapetsfunctionalfindLastconstpackagesWebSocketsJSONimportjQueryutilityelbserializerdeep-copyrm -fromitformatdynamodbinspectSymbolfolderflatfast-clonereact-hook-formJSON-SchemaEScore-jsequalapollohasOwnPropertySetassertobjectES7recursiveemrstreamindicatordirectorytakecollectionreadablestreamInt8ArraykinesisReflect.getPrototypeOfhelpersameValueZerocolourpipefpiteratoris.envurluuidserializationbindsuperstructworkflowbuffercopytoolscloudtrailguideventDispatcherpackagetostringtageslintpluginruntimeflatMapreversedObservablesdateRegExp#flagsInt32ArraytypedarrayscryptoclonenumbershamIteratoriterateiamSymbol.toStringTagmkdirpecmascriptfastcopyresolvejson-schema-validationes6elasticachefullwidthvariablesfilepatchrgbes2017everygetoptoutputpositivebeanstalktranspilercloudsearchtypedviewparserUint32ArrayUnderscorekoreananimationharmonydefineeslint-pluginloadingdropec2regularvpctouchgdprfastclonehasOwnchinesedeepproproute53slotexechttpssnslrucolorsrmmanipulationfile systemsetImmediatePromise-0ECMAScript 2023metadatalintinferenceswfzeroparentsttydom-testing-libraryfigletexpressatomECMAScript 2018fastifystringifierflattenform-validationsetterloadbalancingwaapibabel-corebusyramdatrimEndtoReversed0testcacheclassnamescalljoiObject.definePropertyfinduptelephonecliArray.prototype.flatonceregular-expressionArray.prototype.includeswebPushcloudwatchrequestgetterutil6to5styled-componentssymboleslintconfigacornjson-schema-validatorarraybuffermatchesinternal slotES5mobilestoragegatewayidlecollection.es6ajvspinnerperformancetypeofstyleguidespecwarningcolordiffWeakMapbinflageventswidthpropertiesescapestylefast-deep-copyprotocol-buffers@@toStringTagtypescriptvarreuseinternalbundlerrfc4122validationECMAScript 3pushjasminedependency managerparentfpsfixed-widthbabelECMAScript 6optionECMAScript 2020jsonschematyped arrayBigInt64ArrayassignformgroupByeast-asian-widthcommand-lineReactiveExtensionskarmahigher-ordertc39chromeignoreawsisConcatSpreadablecloudformationES2019definePropertya11yES8pinoconfigurablewaitenvquerystringhttpFloat32Arraycall-bindjsonshellcallboundtypenamesharedtypeerrorstylesprettytransformdeterministicasyncyamlcoercibleremovetesterfind-uptypaniontacitshimienopeupbyterulesglaciernpmignoreasterisksregexclass-validatorconsumeidentifierscompilernamesi18nefficientdayjsconfigdeepcopyES2016ESnextdataviewmulti-packageprotoweaksetutilitiesmake.gitignoreoptimistBigUint64ArraygetPrototypeOfyupperformantasciisymlinkstoStringTagpackage.jsonTypeBoxreduxES2017TypedArraymake dirspeedHyBicircularimmereslintObject.entriesesrm -rfintrinsictimehashboundserializereact-testing-librarylibphonenumberfunctionclientInt16ArraymergeinputmoveespreeextenddomreworkworkerES2022findLastIndexArrayBuffercolumnnodeECMAScript 2019comparearraystrimLeftArray.prototype.filtersuperagenthasgetOwnPropertyDescriptorcheckcurlcoreinvariantvalidatesafeECMAScriptglobal objectStreamsspringreducerweakmapeffect-tsbyteOffsetArray.prototype.findLastcoveragechaiairbnbArrayBuffer.prototype.slicelanguageECMAScript 2015progressObject.getPrototypeOfworkspace:*fscommandwhatwg
3.3.65

5 months ago

3.3.61

5 months ago

3.3.62

5 months ago

3.3.63

5 months ago

3.3.64

5 months ago

3.3.58

5 months ago

3.3.59

5 months ago

3.3.60

5 months ago

3.3.57

5 months ago

3.2.57

5 months ago

3.2.56

5 months ago

2.2.53

5 months ago

2.2.54

5 months ago

3.2.55

5 months ago

3.2.54

5 months ago

2.1.49

5 months ago

2.1.47

5 months ago

2.1.48

5 months ago

2.1.45

5 months ago

2.1.46

5 months ago

2.1.43

6 months ago

2.1.44

5 months ago

2.1.41

6 months ago

2.1.42

6 months ago

2.2.52

5 months ago

2.1.40

6 months ago

2.1.16

6 months ago

2.1.17

6 months ago

2.1.52

5 months ago

2.1.50

5 months ago

2.1.51

5 months ago

2.1.18

6 months ago

2.1.19

6 months ago

2.1.27

6 months ago

2.1.28

6 months ago

2.0.16

6 months ago

2.1.25

6 months ago

2.1.26

6 months ago

2.1.23

6 months ago

2.1.24

6 months ago

2.1.21

6 months ago

2.1.22

6 months ago

2.1.20

6 months ago

2.1.29

6 months ago

2.1.38

6 months ago

2.1.39

6 months ago

2.1.36

6 months ago

2.1.37

6 months ago

2.1.34

6 months ago

2.1.35

6 months ago

2.1.32

6 months ago

2.1.33

6 months ago

2.1.30

6 months ago

2.1.31

6 months ago

2.0.15

6 months ago

2.0.13

7 months ago

2.0.14

7 months ago

2.0.11

7 months ago

2.0.12

7 months ago

2.0.9

7 months ago

2.0.10

7 months ago

2.0.8

7 months ago

2.0.7

7 months ago

2.0.6

7 months ago

2.0.5

7 months ago

2.0.4

7 months ago

2.0.3

7 months ago

2.0.2

7 months ago

2.0.1

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago