(query: string)
| 11 | const FILTERED_WORDS = ['the', 'me', 'I', 'a', 'an', 'is', 'how', 'what']; |
| 12 | |
| 13 | export function toKeywords(query: string) { |
| 14 | return query |
| 15 | .replace(/!|\?/g, '') |
| 16 | .split(/\s+/g) |
| 17 | .filter((word) => !FILTERED_WORDS.includes(word)) |
| 18 | .map((word) => word.toLocaleLowerCase()) |
| 19 | .join(' '); |
| 20 | } |
| 21 | |
| 22 | export default class Typesense { |
| 23 | @measure |
no test coverage detected