UNPKG

@octopusdeploy/design-system-components

Version:
12 lines (11 loc) 501 B
"use strict"; 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); }