data-properties.js 283 B

123456789101112
  1. 'use strict';
  2. module.exports = function dataProperties(klass, properties) {
  3. properties.forEach(p => {
  4. Object.defineProperty(klass.prototype, p, {
  5. enumerable: true,
  6. get() {
  7. return this.data[p];
  8. }
  9. });
  10. });
  11. };