// Generated by CoffeeScript 2.3.2
(function() {
  var ConfigNode, DomainObject, extend;

  extend = require("deep-extend");

  ({ConfigNode} = require("@l.degener/irma-config"));

  module.exports = DomainObject = class DomainObject extends ConfigNode {
    augmentHit(src, dst) {
      var augmentation, f;
      f = this._options.augmentHit;
      if (f != null) {
        augmentation = f.call(this, src, dst);
        if (f.length < 2) { // the callback did not explicitly deal with dst
          switch (typeof augmentation) {
            case 'function':
              return augmentation(dst);
            case 'object':
              return extend(dst, augmentation);
            default:
              throw new Error('duh?!');
          }
        }
      }
    }

  };

}).call(this);
