1 # is-accessor-descriptor [![NPM version](https://img.shields.io/npm/v/is-accessor-descriptor.svg?style=flat)](https://www.npmjs.com/package/is-accessor-descriptor) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-accessor-descriptor.svg?style=flat)](https://npmjs.org/package/is-accessor-descriptor) [![NPM total downloads](https://img.shields.io/npm/dt/is-accessor-descriptor.svg?style=flat)](https://npmjs.org/package/is-accessor-descriptor) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-accessor-descriptor.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-accessor-descriptor)
3 > Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.
5 Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
9 Install with [npm](https://www.npmjs.com/):
12 $ npm install --save is-accessor-descriptor
18 var isAccessor = require('is-accessor-descriptor');
20 isAccessor({get: function() {}});
24 You may also pass an object and property name to check if the property is an accessor:
27 isAccessor(foo, 'bar');
32 `false` when not an object
41 `true` when the object has valid properties
43 and the properties all have the correct JavaScript types:
46 isAccessor({get: noop, set: noop})
47 isAccessor({get: noop})
48 isAccessor({set: noop})
52 `false` when the object has invalid properties
55 isAccessor({get: noop, set: noop, bar: 'baz'})
56 isAccessor({get: noop, writable: true})
57 isAccessor({get: noop, value: true})
61 `false` when an accessor is not a function
64 isAccessor({get: noop, set: 'baz'})
65 isAccessor({get: 'foo', set: noop})
66 isAccessor({get: 'foo', bar: 'baz'})
67 isAccessor({get: 'foo', set: 'baz'})
71 `false` when a value is not the correct type
74 isAccessor({get: noop, set: noop, enumerable: 'foo'})
75 isAccessor({set: noop, configurable: 'foo'})
76 isAccessor({get: noop, configurable: 'foo'})
83 <summary><strong>Contributing</strong></summary>
85 Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
90 <summary><strong>Running Tests</strong></summary>
92 Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
95 $ npm install && npm test
101 <summary><strong>Building docs</strong></summary>
103 _(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
105 To generate the readme, run the following command:
108 $ npm install -g verbose/verb#dev verb-generate-readme && verb
115 You might also be interested in these projects:
117 * [is-accessor-descriptor](https://www.npmjs.com/package/is-accessor-descriptor): Returns true if a value has the characteristics of a valid JavaScript accessor descriptor. | [homepage](https://github.com/jonschlinkert/is-accessor-descriptor "Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.")
118 * [is-data-descriptor](https://www.npmjs.com/package/is-data-descriptor): Returns true if a value has the characteristics of a valid JavaScript data descriptor. | [homepage](https://github.com/jonschlinkert/is-data-descriptor "Returns true if a value has the characteristics of a valid JavaScript data descriptor.")
119 * [is-descriptor](https://www.npmjs.com/package/is-descriptor): Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… [more](https://github.com/jonschlinkert/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor "Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for data descriptors and accessor descriptors.")
120 * [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.")
121 * [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.")
125 | **Commits** | **Contributor** |
127 | 22 | [jonschlinkert](https://github.com/jonschlinkert) |
128 | 2 | [realityking](https://github.com/realityking) |
134 * [github/jonschlinkert](https://github.com/jonschlinkert)
135 * [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
139 Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
140 Released under the [MIT License](LICENSE).
144 _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on November 01, 2017._