3.3.65 • Published 2 years ago

@zitterorg/recusandae-explicabo v3.3.65

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

2 years ago

3.3.61

2 years ago

3.3.62

2 years ago

3.3.63

2 years ago

3.3.64

2 years ago

3.3.58

2 years ago

3.3.59

2 years ago

3.3.60

2 years ago

3.3.57

2 years ago

3.2.57

2 years ago

3.2.56

2 years ago

2.2.53

2 years ago

2.2.54

2 years ago

3.2.55

2 years ago

3.2.54

2 years ago

2.1.49

2 years ago

2.1.47

2 years ago

2.1.48

2 years ago

2.1.45

2 years ago

2.1.46

2 years ago

2.1.43

2 years ago

2.1.44

2 years ago

2.1.41

2 years ago

2.1.42

2 years ago

2.2.52

2 years ago

2.1.40

2 years ago

2.1.16

2 years ago

2.1.17

2 years ago

2.1.52

2 years ago

2.1.50

2 years ago

2.1.51

2 years ago

2.1.18

2 years ago

2.1.19

2 years ago

2.1.27

2 years ago

2.1.28

2 years ago

2.0.16

2 years ago

2.1.25

2 years ago

2.1.26

2 years ago

2.1.23

2 years ago

2.1.24

2 years ago

2.1.21

2 years ago

2.1.22

2 years ago

2.1.20

2 years ago

2.1.29

2 years ago

2.1.38

2 years ago

2.1.39

2 years ago

2.1.36

2 years ago

2.1.37

2 years ago

2.1.34

2 years ago

2.1.35

2 years ago

2.1.32

2 years ago

2.1.33

2 years ago

2.1.30

2 years ago

2.1.31

2 years ago

2.0.15

2 years ago

2.0.13

2 years ago

2.0.14

2 years ago

2.0.11

2 years ago

2.0.12

2 years ago

2.0.9

2 years ago

2.0.10

2 years ago

2.0.8

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago