14 lines
389 B
TypeScript
14 lines
389 B
TypeScript
/** gerar o texto de busca removendo caracteres especies e caixa alta */
|
|
|
|
export const texto_busca = (...texto: any[]): string =>
|
|
texto
|
|
.map((txt) =>
|
|
txt === null || txt === undefined
|
|
? ""
|
|
: String(txt)
|
|
.normalize("NFD")
|
|
.replace(/[\u0300-\u036f]/g, "")
|
|
.replace(/\s+/g, " ")
|
|
.toLowerCase(),
|
|
)
|
|
.join(" ")
|