src/utils/getTruncatedOptions.js
function getTruncatedOptions(options, maxResults) {
  if (!maxResults || maxResults >= options.length) {
    return options;
  }

  return options.slice(0, maxResults);
}
function getTruncatedOptions(options, maxResults) {
  if (!maxResults || maxResults >= options.length) {
    return options;
  }

  return options.slice(0, maxResults);
}
function getTruncatedOptions ( options , maxResults ) { if ( ! maxResults || maxResults >= options . length ) { return options ; } return options . slice ( 0 , maxResults ) ; }
Truncates the result set based on `maxResults` and returns the new set.
Truncates the result set based on maxResults and returns the new set .