code: function makeOptionItemFunction(options, key) {
      if (typeof options[key] !== 'function') {
        var propertyName = options[key];
        options[key] = function(item) { return item[propertyName]; };
      }
    }
docs: Most options support both a string or number as well as a function as
  option value. This function makes sure that the option with the given
  key in the given options is wrapped in a function