function cellMethodLookupFactory(methodName, allowUndefined) {
  var isUndefinedAllowed = typeof allowUndefined === 'undefined' ? true : allowUndefined;
  return function cellMethodLookup(row, col) {
    return function getMethodFromProperties(properties) {
      if (!properties) {
        return; // method not found
      } else if ((0, _object.hasOwnProperty)(properties, methodName) && properties[methodName] !== void 0) {
        // check if it is own and is not empty
        return properties[methodName]; // method defined directly
      } else if ((0, _object.hasOwnProperty)(properties, 'type') && properties.type) {
        // check if it is own and is not empty
        if (typeof properties.type !== 'string') {
          throw new Error('Cell type must be a string ');
        }

        var type = (0, _cellTypes.getCellType)(properties.type);

        if ((0, _object.hasOwnProperty)(type, methodName)) {
          return type[methodName]; // method defined in type.
        } else if (isUndefinedAllowed) {
          return; // method does not defined in type (eg. validator), returns undefined
        }
      }

      return getMethodFromProperties(Object.getPrototypeOf(properties));
    }(typeof row === 'number' ? this.getCellMeta(row, col) : row);
  };
}
Factory that produces a function for searching methods (or any properties) which could be defined directly in
table configuration or implicitly, within cell type definition.

For example: renderer can be defined explicitly using "renderer" property in column configuration or it can be
defined implicitly using "type" property.

Methods/properties defined explicitly always takes precedence over those defined through "type".

If the method/property is not found in an object, searching is continued recursively through prototype chain, until
it reaches the Object.prototype.


@param methodName {String} name of the method/property to search (i.e. 'renderer', 'validator', 'copyable')
@param allowUndefined {Boolean} [optional] if false, the search is continued if methodName has not been found in cell "type"
@returns {Function}