@ganuz/each-properties
v0.1.1
Published
Each Properties is package from Ganuz library
Downloads
10
Maintainers
Readme
@ganuz/each-properties
Each Properties is package from Ganuz library
Install
$ yarn add @ganuz/each-properties
Or
$ npm install --save @ganuz/each-properties
Use
Module
import {
default as eachProperties
} from '@ganuz/each-properties';
Browser
<script src="https://unpkg.com/@ganuz/each-properties/bundle.umd.min.js"></script>
let {
eachProperties
} = G;
Examples
let target = Object.create({foo: 'bar'}, {
[Symbol.toStringTag]: {value: 'Some'},
fn: {value: String, writable: true},
prop: {get(){}},
});
eachProperties(target, (descriptor, property) => console.log(`${property}: ${isDataDescriptor(descriptor)}`) === target;
// => 'Symbol(Symbol.toStringTag): true'
// => 'fn: true'
// => 'prop: false'
// => true
let object = {a: 1, b: 2, c:3};
eachProperties({a: 1, b: 2, c:3}, ({value}) => value !== 2 && console.log(value)) === object;
// => 1
// => true
License
Copyright © Yisrael Eliev, Licensed under the MIT license.