react-bootstrap-typeahead
Version:
React typeahead with Bootstrap styling
20 lines (16 loc) • 431 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
/**
* Truncates the result set based on `maxResults` and returns the new set.
*/
function getTruncatedOptions(options, maxResults) {
if (!maxResults || maxResults >= options.length) {
return options;
}
return options.slice(0, maxResults);
}
var _default = getTruncatedOptions;
exports["default"] = _default;