// @flow strict export const capitalize = (word: string): string => { if (!word) { return ''; } return word .toLowerCase() .replace(/\w/, (firstLetter) => firstLetter.toUpperCase()); }; export const escapeRegExp = (str: string): string => str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');