npm package: @ganuz/is-property-descriptor
Description: Is Property Descriptor is package from Ganuz library
Author: Yisrael Eliev
Latest version: 0.1.1

# @ganuz/is-property-descriptor
[![Source Code](https://img.shields.io/badge/%3C%2F%3E-source_code-blue.svg)](https://github.com/yisraelx/ganuz/blob/master/modules/is-property-descriptor)
[![Version](https://img.shields.io/npm/v/@ganuz/is-property-descriptor.svg)](https://www.npmjs.com/package/@ganuz/is-property-descriptor)
[![MIT License](https://img.shields.io/npm/l/@ganuz/is-property-descriptor.svg?color=yellow)](https://github.com/yisraelx/ganuz/blob/master/LICENSE)
[![Bundle Size](https://img.shields.io/bundlephobia/min/@ganuz/is-property-descriptor.svg?color=green)](https://bundlephobia.com/result?p=@ganuz/is-property-descriptor)
[![TypeScript](https://img.shields.io/badge/100%25-TypeScript-blue.svg)](https://www.typescriptlang.org)

**Is Property Descriptor is package from Ganuz library**

## Install
```sh
$ yarn add @ganuz/is-property-descriptor
```
Or
```sh
$ npm install --save @ganuz/is-property-descriptor
```

## Use
**Module**
```typescript
import {
  default as isPropertyDescriptor
} from '@ganuz/is-property-descriptor';
```

**Browser**
```html
<script src="https://unpkg.com/@ganuz/is-property-descriptor/bundle.umd.min.js"></script>
```
```typescript
let {
  isPropertyDescriptor
} = G;
```

**Examples**
```typescript
 isPropertyDescriptor(); // => false
 isPropertyDescriptor('foo'); // => false
 isPropertyDescriptor({}); // => true
 isPropertyDescriptor({color: 'red'}); // => true
 isPropertyDescriptor(class {}); // => true
 isPropertyDescriptor({value: undefined, foo: 'bar'}); // => true
 isPropertyDescriptor({get: undefined}); // => true
 isPropertyDescriptor({set: Object, enumerable: [0, 1, 2]}); // => true
 isPropertyDescriptor({get(){}, value: 55}); // => false
 isPropertyDescriptor({get: 'foo'}); // => false
 isPropertyDescriptor({get(){}, set: NaN}); // => false
 isPropertyDescriptor({get(){}, writable: undefined}); // => false
 isPropertyDescriptor({set(){}, value: undefined}); // => false
```

*Note: To check the kind of the descriptor use {@link isDataDescriptor} or {@link isAccessorDescriptor}*

### @ganuz/is-property-descriptor/assert
**Module**
```typescript
import {
  default as assertPropertyDescriptor
} from '@ganuz/is-property-descriptor/assert';
```

**Browser**
```html
<script src="https://unpkg.com/@ganuz/is-property-descriptor/assert/bundle.umd.min.js"></script>
```
```typescript
let {
  assertPropertyDescriptor
} = G;
```

**Examples**
```typescript
 assertPropertyDescriptor(null); // throw TypeError
 assertPropertyDescriptor(false); // throw TypeError
 assertPropertyDescriptor({set: []}); // throw TypeError
 assertPropertyDescriptor({get() {}, writable: false}); // throw TypeError
 assertPropertyDescriptor({set: undefined, value: 'foo'}); // throw TypeError
 assertPropertyDescriptor({}); // => {}
 assertPropertyDescriptor({get: undefined}); // => {get: undefined}
 assertPropertyDescriptor({enumerable: true}); // => {enumerable: true}
 assertPropertyDescriptor({value: NaN}); // => {value: NaN}
```


## License
Copyright © [Yisrael Eliev](https://github.com/yisraelx),
Licensed under the [MIT license](https://github.com/yisraelx/ganuz/blob/master/LICENSE).