'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

var FieldDataNotFoundException = _interopDefault(require('./Exceptions/FieldDataNotFoundException'));

var DataProxy = {
  set: function set(target, prop, value) {
    return Reflect.set(target, prop, value);
  },
  get: function get(target, prop) {
    if (prop in target) {
      return target[prop];
    } else if (prop === 'toJSON' || prop === 'toObject') {
      return undefined;
    } else {
      throw new FieldDataNotFoundException('no data found for the given field: ' + prop);
    }
  }
};

module.exports = DataProxy;
//# sourceMappingURL=DataProxy.js.map
