3.0.5 • Published 5 months ago

is-accessor-descriptor v3.0.5

Weekly downloads
36,782,458
License
MIT
Repository
github
Last release
5 months 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_modbitgetreact-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-1932ondka-flow.jsl2forlernalib-errorlitepie-datepicker-gabehot-zone-vuekhaled-salem-custom-componentsiex-sdkjamuskalimjesusdemojeuxuimoonwalkerswap-default-token-listsng-search-dropdownmncssmggauharmiracle-webpack-tree-shakingmpesa-cookiempesa-cookie-jarjrennsoh88-react-native-scroll-indicatorjs-utils-jll2install-isnative-date-picker-modulenative-modal-damage-vehiclenative-kakao-loginnative-google-loginnative-apple-loginnew-awesome-4321ly-vuem2m-chartjs-plugin-crosshairmiguelcostero-ng2-toastymama-exporterlq-server-clinois-react-toastnove-repositorynpm_qwertynpmtest-05041npm_one_12_34_1_npm_one_1_2_3npm_one_2_2npm-package-mentorcheckn8n-nodes-caldavlylb-climd-vditor@valifysolutions/react-native-vidvliveness@trackier/react-native-trackier@traitsniper/web3-react-connector@traitsniper/web3-react-v6-connector@refactorpro/pixi-virtual-joystick@southcn/ckeditor5-build-inline
3.0.5

5 months ago

3.0.4

5 months ago

1.0.1

5 months ago

3.0.3

5 months ago

0.1.7

5 months ago

3.0.2

11 months ago

3.0.1

5 years ago

3.0.0

5 years ago

2.0.0

6 years ago

1.0.0

6 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.0

9 years ago