1.0.0 • Published 14 days ago

@ptkhanh94npm/quasi-minus-veniam v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
14 days ago

@ptkhanh94npm/quasi-minus-veniam Version Badge

github actions coverage License Downloads

npm badge

Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.

Examples

const isAccessorDescriptor = require('@ptkhanh94npm/quasi-minus-veniam');
const assert = require('assert');

const obj = {
	get foo() {},
	bar: { get: function() {} }
};

assert.equal(true, isAccessorDescriptor(obj, 'foo'));
assert.equal(false, isAccessorDescriptor(obj, 'bar'));

// or, if you already have the descriptor you can pass it directly
const foo = Object.getOwnPropertyDescriptor(obj, 'foo');
assert.equal(true, isAccessorDescriptor(foo));

const bar = Object.getOwnPropertyDescriptor(obj, 'bar');
assert.equal(false, isAccessorDescriptor(bar));

Related projects

You might also be interested in these projects:

  • is-data-descriptor: Returns true if a value has the characteristics of a valid JavaScript data descriptor.
  • is-descriptor: Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… more
  • is-object: Returns true if the value is an object and not an array or null.

Tests

Simply clone the repo, npm install, and run npm test

react animationnopeObject.entriesdeepclonexdg-openpluginmoduletranspiletoSortedhardlinksbrowserslistbytemimetypesmobilejsonhashstringifybddcompile lessprotocol-buffersMicrosoftrmqueueMicrotaskemitinspectmkdirsbluebird6to5css variablecolumnformattingdirweakmapencryptionpathtypedarraysdatevalides6flagrm -rfUnderscoreArrayBuffer.prototype.sliceInt32ArrayrgbinputArray.prototype.findLastframeworkcommanderes8internalfolderglobgenericses5rmdirfigletsymbolwarningserializergetintrinsiclimiteddescriptorgroupByspawnStreamreadableredux-toolkitnodejsnativerateSymbol.toStringTagairbnbpropertieslengthArray.prototype.flattencmdpopmotionsettingschromiumpreprocessorcallavaES7jQueryPushargsfunctioniterationshebangmkdirploggeriterateopensfullextracloneObjectoptimizerkeysharmonynested cssonceconsolesameValueZerooutputformatArrayBufferfantasy-landquerystringjoiRegExp.prototype.flagsawaitwritesideprivatees-shim APIexpressioneditorerrorArray.prototype.flatreducedefinePropertygradients css3dependenciesshamcoreconcatMapjasminetypedarray3di18nsigtermFloat64Arraycoerciblefast-deep-copyopenerparentsprefixxssexecdeep-copywordwraptraverseRxwhatwgmime-dbthroatposeuser-streamsfindLastIndexrecursiveasyncfunctionsdeterministicform-validationchinesespeedfseventsextendtestingxdgReflect.getPrototypeOfcryptoObservableinvariantlistenersreal-timejestvalidateBigUint64Arraystartersyntaxlaunchworkspace:*fastclonecollection.es6styleObject.getPrototypeOfjsonpathweaksetpositivecreateESnextquotequeryemojiio-tsmiddleware@@toStringTagcollectionString.prototype.matchAllObject.definePropertywhichtypeofshellArrayBuffer#slicekeytimecurlregular expressioncomputed-typesletclassnamextermobjectdebugstartes7containsconstgdprcurriediteratorWeakSetlruES2023yamlpushdefaultjsECMAScript 2016spec$.extendhttpsprototypetermgetPrototypeOfsortless compilermkdirnumberdataviewformswindowsjavascriptflatstatelessdomES2015structuredCloneES2018ecmascriptFloat32Arraywordbreaklogbuffers_.extendwrapInt16ArrayclassnamesmatcheselectronES2020
1.0.0

14 days ago