1.0.0 • Published 1 year ago

@micromint1npm/sequi-debitis-sed v1.0.0

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

@micromint1npm/sequi-debitis-sed 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('@micromint1npm/sequi-debitis-sed');
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

uninstallpropertypromisesbootstrap cssbddes2016getoptprotoduplexlinkObject.fromEntriesnodewaitjsonpathfunctionsettingscss variableuuidcontainslengthextendless.jsmkdirqueuextermassertcopyoptionutil.inspectunicodeMapArrayBuffer#sliceparentsnsdatefromjoitypedarraysutilitiesdifffastcoreajvvaluesfast-clonemiddlewareoptimizerbusyajaxdom-testing-librarygenericsspeedstoragegatewaymobileamazontesterSetRegExp.prototype.flagsviewnodejsjQuerymatchescollectionzodstylingcolourxhrstatelessURLSearchParamscolorroutinglistenerssetPrototypeOfpropswfES8form-validationeast-asian-widthyupsharedarraybufferECMAScript 3lintbeanstalkforEachpicomatchcoercibleArray.prototype.flattenArray.prototype.flatMapcloneglacierStreamsECMAScript 2021less compilerReflect.getPrototypeOfawesomesaucequeryArrayprogressasciireplaywebfast-deep-cloneredactpreserve-symlinkspackage managercharactersapihasOwnconfigstylergbsetAsyncIteratorcorsdependency managerconcatMapes6stylesdynamodbstatewritablemodulesmrupersistenttc39negativefetchsymlinkmapreduceObject.issqsoptimistsymlinksfind-upopenwatchingwordwrapexpressprivate dataWeakMapECMAScript 2016cachehaspackagestringifierdefineStyleSheetstartergroupBytypanionnope[[Prototype]]bluebirdcssmimeseslivetypekarmagetPrototypeOfdeep-copyrm -frUint8ClampedArraytrimintrinsicgradients css3includesRFC-6455isConcatSpreadableinternal slotperformantencryptionHyBifastcloneshrinkwrapStreamvalidstablevalidationgetternativeefficientFunction.prototype.nameaccessoridfast-copycloudformationeventswafECMAScript 5eventDispatcheri18ncloudsearchconcurrencynamesymbolsES2018circularjsontestingio-tsomitcharacterprototypesettertapURLObservableECMAScript 6tsTypeScriptresolveassertiontypeofwritekinesissimpledbmimetypesmaphookscloudtrailpositivearraysformatdeterministicjestArray.prototype.findLastIndexrequireFloat64ArrayMicrosoftvpcbuffersawsinferenceprotocol-buffersreact-testing-library@@toStringTagassertsbreakapolloless cssautoscalingmulti-packagerdsUint16Arrayreduxvariables in cssargumentvalueESvariablescollection.es6deep-clonebyteOffsetes2018compile lessmatchstdlibbcryptexecbrowserlistsyntaxpreprocessorbundlingdayjscryptoauthenticationObject.assignemiteslintconfigspinnersargparserandomlimitedisbyteLengthserializationES5ECMAScript 2017vestBigInt64Arraykeyslockfilescheme-validationmakelinewrapcss less0calljsdomlrugrouptypesinfigletartconsumeECMAScript 2019es5es-shim APInumberjavascripthash$.extendtypesafel10nestreeObservablesfseventsgdprRegExp#flagsmonorepowhatwglogecmascriptstring
1.0.0

1 year ago