export function match(search: string, target: string): boolean { return search.split(/\s+/).every(s => format(target).includes(format(s))) } export function format(str: string): string { return unaccent(str.toLowerCase()) } function unaccent(str: string): string { return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "") }