3.0.5 • Published 1 year ago

is-accessor-descriptor v3.0.5

Weekly downloads
36,782,458
License
MIT
Repository
github
Last release
1 year ago

is-accessor-descriptor 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('is-accessor-descriptor');
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

is-descriptorarchetype-librarycomponennenttvuedragdropuploadimagespopsmart-common-authreact-native-bluetooth2killi8n-react-native-fast-imagern-send-smsspecify-importsbabel-specify-imports@icanpm/api-mastergew-nodejs-api-client@arisageha/react-lazyload@arisageha/react-lazyload-fix@cashremit/cr-streamline-iconsreact-native-template-rfbasecloud-archive-s3airscanairscan-examplebb-chatreact-native-esc-pos-sahaab@borisovart/atol-kkt-module@frxf/frxf@phil8795/pecuniarius-apideneme323112@texttree/demo-bsa-reference-rcl@fundefund/funde_ck@ntt_app/react-native-custom-notificationreact-native-custom-text-hwjamesreact-native-covid-sdkgql_din_modreact-native-thanh-toast-library@thanhnguyen14797/react-native-thanh-toast-library@l1nyanm1ng/react-picture-viewercthpb-plugin-socialreact-native-printer-brothersrn-pdf-reader-offlinereact-native-shekhar-bridge-testwilscanner@commutatus/cm-page-builder-test@oiti/documentoscopy-react-nativejs4cytoscape@mink-opn/build-tokensquoc-testreact-native-slider-kf@infinitebrahmanuniverse/nolb-is-a@saaspe/componentsplginexpand-react-bridge@everything-registry/sub-chunk-1932ondgriffin-ui-librarytailwind-vector-effectsyncbackbasestest-carosello-campustest-library-123test-haptik-libteadanteatest-npm-jjmessivue-button-test1webchewescheme-jswoven-challenge-deployxdms3wifi_configuration_packagesuperset-plugin-chart-hello-world2supercluster-googlemaps-adapter-clonestechfox-icontechfox-react-featherspotify-ds-sesticky-scroll-catchstp-cdktestapateste_cegidtestnpm_lmnsvelte-component-libtextfield-samplevue-compmentvision-camera-plugin-scan-facesvision-camera-base64-resizedvcloudcam-playkit-js-hlsvideo-multi-uploadervue-dev-clone@donapot/mylibtest@cryptocode99/token-lists@ctfdio/picocss-themes@ct-note/table@ct-note/warning@cs6/react-native-test-native-view-library@ct-note/image@ct-note/inline-code@ct-note/list@ct-note/marker@ct-note/paragraph@ct-note/quote@ct-note/simple-image@ct-note/checklist@ct-note/code@ct-note/delimiter@ct-note/embed
3.0.5

1 year ago

3.0.4

1 year ago

1.0.1

1 year ago

3.0.3

1 year ago

0.1.7

1 year ago

3.0.2

2 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.0.0

7 years ago

1.0.0

7 years ago

0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.0

10 years ago