function getAttrGetter(attribute) {
  const parts = _prepareAttributeParts(attribute);

  return function attrGetter(item) {
    let _item = item;

    for (let i = 0; i < parts.length; i++) {
      const part = parts[i];

      // If item is not an object, and we still got parts to handle, it means
      // that something goes wrong. Just roll out to undefined in that case.
      if (hasOwnProp(_item, part)) {
        _item = _item[part];
      } else {
        return undefined;
      }
    }

    return _item;
  };
}
@param {string}   attribute      Attribute value. Dots allowed.
@returns {function(Object): *}