x-object-iterable

0.3.0 • Public • Published

x-object-iterable

Requirements

  • Node >= 6.0.0

Examples

Shallow cloning an object

var ObjectIterable = require('x-object-iterable');
var object = {
  data: 12,
  get accessor() {
    return Math.random();
  }
};
var clone = {};
var iterable = new ObjectIterable(object);
for (let element of iterable) {
  Object.defineProperty(clone, element.property, element.descriptor);
}
console.log(clone);

Package Sidebar

Install

npm i x-object-iterable

Weekly Downloads

1

Version

0.3.0

License

MIT

Last publish

Collaborators

  • khai96_