MonkeyDefinition = function MonkeyDefinition(definition) {
  var _this = this;

  var monkeyType = _type["default"].monkeyDefinition(definition);

  if (!monkeyType) throw (0, _helpers.makeError)('Baobab.monkey: invalid definition.', {
    definition: definition
  });
  this.type = monkeyType;

  if (this.type === 'object') {
    this.getter = definition.get;
    this.projection = definition.cursors || {};
    this.paths = Object.keys(this.projection).map(function (k) {
      return _this.projection[k];
    });
    this.options = definition.options || {};
  } else {
    var offset = 1,
        options = {};

    if (_type["default"].object(definition[definition.length - 1])) {
      offset++;
      options = definition[definition.length - 1];
    }

    this.getter = definition[definition.length - offset];
    this.projection = definition.slice(0, -offset);
    this.paths = this.projection;
    this.options = options;
  } // Coercing paths for convenience


  this.paths = this.paths.map(function (p) {
    return [].concat(p);
  }); // Does the definition contain dynamic paths

  this.hasDynamicPaths = this.paths.some(_type["default"].dynamicPath);
}
Monkey Definition class
Note: The only reason why this is a class is to be able to spot it within
otherwise ordinary data.

@constructor
@param {array|object} definition - The formal definition of the monkey.