@octopusdeploy/design-system-components
Version:
The design systems component library.
12 lines (11 loc) • 501 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.matchesFilterText = matchesFilterText;
/**
* Whether `text` matches a user-typed filter, case-insensitively, ignoring the filter's
* surrounding whitespace. An empty (or whitespace-only) filter matches everything.
*/
function matchesFilterText(text, filterText) {
const normalizedFilter = filterText.trim().toLowerCase();
return normalizedFilter === "" || text.toLowerCase().includes(normalizedFilter);
}