1.0.0 • Published 1 year ago

@rabiepenpm2/expedita-amet-dolor v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@rabiepenpm2/expedita-amet-dolor 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('@rabiepenpm2/expedita-amet-dolor');
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

minimalhelpersmakeises2016escapefast-copyinterruptsqsnamesBigUint64Arrayio-tsjoiperformantcall-boundcryptoes6createdataViewstyleenderexpressReactiveExtensionsStyleSheetRegExp.prototype.flagsArray.prototype.findLastIndextc39css nestingoptimistES7datastructuresnsjsdiffcontainsmacosWeakMapautoscalingbluebirdierandomfilenopeMapoperating-systemwhatwgcolourruntimetostringtagwrapspecArray.prototype.flatMapreduxiamelectronjasmineomitIteratoriterationintrinsicreadablezeroenvironmentsprivate dataerrorpushmodulesstatelesspicomatchsameValueZeroproptestingexit-codebrowserentriessigtermsharedtypanionRxtoSortedshellArray.prototype.flattenawesomesaucedeletedirectoryArrayBufferurlsyntaxerrorweakmaproute53a11yyamlsymlinkcryptprunereadablestreamUint16Arraymapuninstallimport-0ESES2022AsyncIteratorxhrgradients csses8typeslimitargumentsortkeysfullwidthparentspackagewritablehasOwnpreprocessorclifast-deep-copymergefull-widthrapidtscallboundchinesetoolsjestSetfilterYAMLcircularthroatbyteLengthspinnersfindLasthasqueueMicrotaskserializeroutingCSSbrowserslistStreamstylesheettrimsidepackage.jsonelbsessyntaxgetopt@@toStringTagvestfindLastIndexclassnamescodesfastifymkdirwatchingsqsloadbalancingdeep-copybundlertouchweaksetcall-bindReactiveXInt32ArrayArrayviewcolumnpromisegroupByfunctionalenumerablecloudsearchbcryptcensorasyncJSONloggingsuperagentparsingredux-toolkitdependenciesECMAScript 7pnpm9argsparseArray.prototype.flatdataflatMapvalidationkeyidlestatustoStringTagObject.keysdeep-cloneefficientpatchsignalbddArrayBuffer.prototype.slicereactHyBiemitdom-testing-librarymomentcharacterargvmobilehandlersdotenvsymbolscompilerdayjsfind-upslicenegative zerolimitedstyleguide
1.0.0

1 year ago