@ganuz/to-data-descriptor
v0.1.1
Published
To Data Descriptor is package from Ganuz library
Downloads
20
Maintainers
Readme
@ganuz/to-data-descriptor
To Data Descriptor is package from Ganuz library
Install
$ yarn add @ganuz/to-data-descriptor
Or
$ npm install --save @ganuz/to-data-descriptor
Use
Module
import {
default as toDataDescriptor
} from '@ganuz/to-data-descriptor';
Browser
<script src="https://unpkg.com/@ganuz/to-data-descriptor/bundle.umd.min.js"></script>
let {
toDataDescriptor
} = G;
Examples
toDataDescriptor(); // => {configurable: true, enumerable: true, writable: true, value: undefined}
toDataDescriptor(Symbol.for('foo')); // => {configurable: true, enumerable: true, writable: true, value: Symbol.for('foo')}
toDataDescriptor({}, 0); // => {configurable: false, enumerable: false, writable: false, value: {}}
toDataDescriptor(-1, {}); // => {configurable: false, enumerable: false, writable: false, value: -1}
toDataDescriptor('foo', true); // => {configurable: true, enumerable: true, writable: true, value: 'foo'}
toDataDescriptor(45, 'cw'); // => {configurable: true, enumerable: false, writable: true, value: 45}
toDataDescriptor(Object, 74); // => {configurable: true, enumerable: true, writable: true, value: Object}
toDataDescriptor(NaN, {configurable: true, get(){}}); // => {configurable: true, enumerable: false, writable: false, value: NaN}
toDataDescriptor([0, 1, 2], {enumerable: 'foo', writable: 0, value: -1); // => {configurable: false, enumerable: true, writable: false, value: [0, 1, 2]}
License
Copyright © Yisrael Eliev, Licensed under the MIT license.