source: trip-planner-front/node_modules/is-accessor-descriptor/README.md@ 8d391a1

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

primeNG components

  • Property mode set to 100644
File size: 3.5 KB
Line 
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)
2
3> Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.
4
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))_
16
17## Install
18
19Install with [npm](https://www.npmjs.com/):
20
21```sh
22$ npm i is-accessor-descriptor --save
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
90## Related projects
91
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)
96
97## Running tests
98
99Install dev dependencies:
100
101```sh
102$ npm i -d && npm test
103```
104
105## Contributing
106
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).
108
109## Author
110
111**Jon Schlinkert**
112
113* [github/jonschlinkert](https://github.com/jonschlinkert)
114* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
115
116## License
117
118Copyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert)
119Released under the MIT license.
120
121***
122
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.