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

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

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

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

## Use
**Module**
```typescript
import {
  IPropertyDescriptorOptions,
  default as toPropertyDescriptor
} from '@ganuz/to-property-descriptor';
```

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

**Examples**
```typescript
 toPropertyDescriptor(); // => {configurable: false, enumerable: false, writable: false, value: undefined}
 toPropertyDescriptor({}, 1); // => {configurable: true, enumerable: true, writable: true, value: undefined}
 toPropertyDescriptor({}, {}); // => {configurable: false, enumerable: false, writable: false, value: undefined}
 toPropertyDescriptor({set(){}, enumerable: true}, false); // => {configurable: false, enumerable: true, get: undefined, set(){}}
 toPropertyDescriptor({get: undefined}, 'ewc'); // => {configurable: true, enumerable: true, get: undefined, set: undefined}
 toPropertyDescriptor({configurable: true, enumerable: true, writable: true, set(){}}, get: null); // => {configurable: false, enumerable: false, get: undefined, set(){}}
 toPropertyDescriptor({get: undefined, configurable: 0}, {enumerable: true, configurable: true}); // => {configurable: false, enumerable: true, get: undefined, set: undefined}
 toPropertyDescriptor({set: 55, get: Object, writable: true}, 'cw'); // => {configurable: true, enumerable: false, get: Object, set: undefined}
 toPropertyDescriptor({get(){}, set(){}, value: 'foo'}, true); // => {configurable: true, enumerable: true, get(){}, set(){}}
 toPropertyDescriptor({get(){}, value: undefined, writable: true}, 'c'); // => {configurable: true, enumerable: false, get(){}, set: undefined}
 toPropertyDescriptor({enumerable: 0, writable: false}, {configurable: [], writable: true}, true); // => {configurable: true, enumerable: false, writable: true, value: undefined}
 toPropertyDescriptor({configurable: false, enumerable: false, writable: false}, 'ec', true); // => {configurable: true, enumerable: true, writable: false, value: undefined}
```


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