source: trip-planner-front/node_modules/is-accessor-descriptor/README.md@ 1ad8e64

Last change on this file since 1ad8e64 was e29cc2e, checked in by Ema <ema_spirova@…>, 3 years ago

primeNG components

  • Property mode set to 100644
File size: 3.5 KB
RevLine 
[e29cc2e]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)
[6a3a178]2
3> Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.
4
[e29cc2e]5- [Install](#install)
6- [Usage](#usage)
7- [Examples](#examples)
8- [API](#api)
9- [Related projects](#related-projects)
10- [Running tests](#running-tests)
11- [Contributing](#contributing)
12- [Author](#author)
13- [License](#license)
14
15_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_
[6a3a178]16
17## Install
18
19Install with [npm](https://www.npmjs.com/):
20
21```sh
[e29cc2e]22$ npm i is-accessor-descriptor --save
[6a3a178]23```
24
25## Usage
26
27```js
28var isAccessor = require('is-accessor-descriptor');
29
30isAccessor({get: function() {}});
31//=> true
32```
33
34You may also pass an object and property name to check if the property is an accessor:
35
36```js
37isAccessor(foo, 'bar');
38```
39
40## Examples
41
42`false` when not an object
43
44```js
45isAccessor('a')
46isAccessor(null)
47isAccessor([])
48//=> false
49```
50
51`true` when the object has valid properties
52
53and the properties all have the correct JavaScript types:
54
55```js
56isAccessor({get: noop, set: noop})
57isAccessor({get: noop})
58isAccessor({set: noop})
59//=> true
60```
61
62`false` when the object has invalid properties
63
64```js
65isAccessor({get: noop, set: noop, bar: 'baz'})
66isAccessor({get: noop, writable: true})
67isAccessor({get: noop, value: true})
68//=> false
69```
70
71`false` when an accessor is not a function
72
73```js
74isAccessor({get: noop, set: 'baz'})
75isAccessor({get: 'foo', set: noop})
76isAccessor({get: 'foo', bar: 'baz'})
77isAccessor({get: 'foo', set: 'baz'})
78//=> false
79```
80
81`false` when a value is not the correct type
82
83```js
84isAccessor({get: noop, set: noop, enumerable: 'foo'})
85isAccessor({set: noop, configurable: 'foo'})
86isAccessor({get: noop, configurable: 'foo'})
87//=> false
88```
89
[e29cc2e]90## Related projects
[6a3a178]91
[e29cc2e]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)
[6a3a178]96
[e29cc2e]97## Running tests
[6a3a178]98
[e29cc2e]99Install dev dependencies:
[6a3a178]100
101```sh
[e29cc2e]102$ npm i -d && npm test
[6a3a178]103```
104
[e29cc2e]105## Contributing
[6a3a178]106
[e29cc2e]107Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-accessor-descriptor/issues/new).
[6a3a178]108
[e29cc2e]109## Author
[6a3a178]110
111**Jon Schlinkert**
112
113* [github/jonschlinkert](https://github.com/jonschlinkert)
[e29cc2e]114* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
[6a3a178]115
[e29cc2e]116## License
[6a3a178]117
[e29cc2e]118Copyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert)
119Released under the MIT license.
[6a3a178]120
121***
122
[e29cc2e]123_This file was generated by [verb](https://github.com/verbose/verb) on December 28, 2015._
Note: See TracBrowser for help on using the repository browser.