commit
This commit is contained in:
commit
b5ca2d50ac
337 changed files with 24672 additions and 0 deletions
15
src/texto_busca.ts
Normal file
15
src/texto_busca.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/** 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")
|
||||
// biome-ignore lint/suspicious/noMisleadingCharacterClass: <explanation>
|
||||
.replace(/[\u0300-\u036f]/g, "")
|
||||
.replace(/\s+/g, " ")
|
||||
.toLowerCase(),
|
||||
)
|
||||
.join(" ");
|
||||
Loading…
Add table
Add a link
Reference in a new issue