1 | import * as diacritics from "diacritics";
|
2 | import _ from "./lodash";
|
3 |
|
4 | export function replaceApostrophes(str: string) {
|
5 | return str.replace(/[ʻʼ’‘`´]/g, "'");
|
6 | }
|
7 |
|
8 | const removeDiacritics = diacritics.remove;
|
9 | const cleanQuery = _.flow([
|
10 | replaceApostrophes,
|
11 | removeDiacritics,
|
12 | encodeURIComponent,
|
13 | ]);
|
14 |
|
15 | export default cleanQuery;
|