Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
sanitizeQuery(query) {
if (this.suggestionType === HASHTAG) {
// remove all non unicode letters and non digits
const regexMatchAllNonUnicodeLettersOrDigits = build('[^\\pL0-9]')
query = replace(query, regexMatchAllNonUnicodeLettersOrDigits, '', 'all')
// if the query is only made of digits, make it empty
return query.replace(/[0-9]/gm, '') === '' ? '' : query
}
return query
},
// we have to replace our suggestion text with a mention