1.0.2 • Published 1 year ago

@juigorg/suscipit-rem v1.0.2

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

@juigorg/suscipit-rem 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('@juigorg/suscipit-rem');
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

movefastifyhtmlspawnmapreducenamecreatetakecolorsinformattrimEndes6cjkloggingeast-asian-widthreact-hookspostcssreadvpcvalidmobilewaittypedarraysperformanceeslintpluginsyntaxclassnameflatsinatraObject.valuesjoityped arraybyteLengthlocalArrayBuffer.prototype.slicebufferssetPrototypeOfutilitycolumnprotobufJSONworkflowargumentasyncfull-widthvestpreprocessorzeroexpressionhelperfast-deep-clonejson-schema-validationpackagehardlinksfast-clonesetternegativequeueECMAScript 3es7offsetfindruntimeenvjsonastrm -rf_.extendconfigurablecollectionUint32Arraycall-bindkarmadom-testing-libraryES6package.jsonObjectemojilibphonenumbernegative zeroflatMapESpolyfillserializeharmonyprefixwriteglobalsESnextspinnerlengthexecuteairbnbclass-validatordefinejsxwgetspeedObject.assignestreenpmpackage managermkdirsqueueMicrotaskECMAScript 2023fileBigInt64ArraytoStringTagWebSocketssortedsymbolautoprefixerdependency managerStyleSheetboundzxgraphqlponyfillstreamsIteratorforkdeleteidentifierses5ramdaassigntestmodulespinnersaccessorwidtheses2018childflagReflect.getPrototypeOfenderurlreadableArray.prototype.flattenredactshebangcollection.es6CSSStyleDeclarationmkdirtapdeepcloneexecreal-timeshammatchclassnamesdynamodbWeakMapinternal slotrestreact animationlockfileCSSglobal objecttoSortedlruInt16ArrayvisualFloat32Arraysnses2017ES2019pruneutilsinstallerdescriptorreworkWebSocketi18nwalkweaksetregular expressionssearcharraybufferstoragegatewayassertionarktypediffrouterimportexportutil.inspecthasOwnPropertyreusesharedeventDispatcherenvironmentssettraversejapanesequerystringgroupsomechromiumtapeECMAScript 6ArrayBuffer#slicehttpsflagsbinwebschemayupprocesshas-ownpluginjsdomsource mapasteriskscacheserializationflatten
1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago