import { escapeRegExp } from 'lodash'; export function wordStartsWithMatch(q: string) { const r = new RegExp(`(\\s+|^)${escapeRegExp(q)}`, 'i'); return (name: string) => r.test(name); }