1 # is-accessor-descriptor [![NPM version](https://img.shields.io/npm/v/is-accessor-descriptor.svg)](https://www.npmjs.com/package/is-accessor-descriptor) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-accessor-descriptor.svg)](https://travis-ci.org/jonschlinkert/is-accessor-descriptor)
3 > Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.
7 - [Examples](#examples)
9 - [Related projects](#related-projects)
10 - [Running tests](#running-tests)
11 - [Contributing](#contributing)
15 _(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_
19 Install with [npm](https://www.npmjs.com/):
22 $ npm i is-accessor-descriptor --save
28 var isAccessor = require('is-accessor-descriptor');
30 isAccessor({get: function() {}});
34 You may also pass an object and property name to check if the property is an accessor:
37 isAccessor(foo, 'bar');
42 `false` when not an object
51 `true` when the object has valid properties
53 and the properties all have the correct JavaScript types:
56 isAccessor({get: noop, set: noop})
57 isAccessor({get: noop})
58 isAccessor({set: noop})
62 `false` when the object has invalid properties
65 isAccessor({get: noop, set: noop, bar: 'baz'})
66 isAccessor({get: noop, writable: true})
67 isAccessor({get: noop, value: true})
71 `false` when an accessor is not a function
74 isAccessor({get: noop, set: 'baz'})
75 isAccessor({get: 'foo', set: noop})
76 isAccessor({get: 'foo', bar: 'baz'})
77 isAccessor({get: 'foo', set: 'baz'})
81 `false` when a value is not the correct type
84 isAccessor({get: noop, set: noop, enumerable: 'foo'})
85 isAccessor({set: noop, configurable: 'foo'})
86 isAccessor({get: noop, configurable: 'foo'})
92 * [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)
93 * [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)
94 * [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://www.npmjs.com/package/is-descriptor) | [homepage](https://github.com/jonschlinkert/is-descriptor)
95 * [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)
99 Install dev dependencies:
102 $ npm i -d && npm test
107 Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-accessor-descriptor/issues/new).
113 * [github/jonschlinkert](https://github.com/jonschlinkert)
114 * [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
118 Copyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert)
119 Released under the MIT license.
123 _This file was generated by [verb](https://github.com/verbose/verb) on December 28, 2015._