code: function match(str, arr, options) {
      arr = arr || [];
      options = options || {};
      arr.sort();
      var arrX = _.clone(arr);
      var strX = String(str);
  
      var prefix = '';
  
      if (options.ignoreSlashes !== true) {
        var parts = strX.split('/');
        strX = parts.pop();
        prefix = parts.join('/');
        prefix = parts.length > 0 ? prefix + '/' : prefix;
      }
  
      var matches = [];
      for (var i = 0; i < arrX.length; i++) {
        if (strip(arrX[i]).slice(0, strX.length) === strX) {
          matches.push(arrX[i]);
        }
      }
      if (matches.length === 1) {
        // If we have a slash, don't add a space after match.
        var space = String(strip(matches[0])).slice(strip(matches[0]).length - 1) === '/' ? '' : ' ';
        return prefix + matches[0] + space;
      } else if (matches.length === 0) {
        return undefined;
      } else if (strX.length === 0) {
        return matches;
      }
  
      var longestMatchLength = matches.reduce(function (previous, current) {
        for (var i = 0; i < current.length; i++) {
          if (previous[i] && current[i] !== previous[i]) {
            return current.substr(0, i);
          }
        }
        return previous;
      }).length;
  
      // couldn't resolve any further, return all matches
      if (longestMatchLength === strX.length) {
        return matches;
      }
  
      // return the longest matching portion along with the prefix
      return prefix + matches[0].substr(0, longestMatchLength);
    }
docs: Independent / stateless auto-complete function.
  Parses an array of strings for the best match.
  
  @param {String} str
  @param {Array} arr
  @return {String}
  @api private