mirror of
https://github.com/oceanprotocol/market.git
synced 2024-06-30 22:01:44 +02:00
parent
b881fdd88f
commit
9a47d065b4
|
@ -47,6 +47,10 @@ function getSortType(sortParam: string): string {
|
||||||
return sortTerm
|
return sortTerm
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function escapeESReservedChars(text: string): string {
|
||||||
|
return text.replace(/([!*+\-=<>&|()\\[\]{}^~?:\\/"])/g, '\\$1')
|
||||||
|
}
|
||||||
|
|
||||||
export function getSearchQuery(
|
export function getSearchQuery(
|
||||||
chainIds: number[],
|
chainIds: number[],
|
||||||
text?: string,
|
text?: string,
|
||||||
|
@ -61,6 +65,7 @@ export function getSearchQuery(
|
||||||
accessType?: string
|
accessType?: string
|
||||||
): any {
|
): any {
|
||||||
const emptySearchTerm = text === undefined || text === ''
|
const emptySearchTerm = text === undefined || text === ''
|
||||||
|
text = escapeESReservedChars(text)
|
||||||
let searchTerm = owner
|
let searchTerm = owner
|
||||||
? `(publicKey.owner:${owner})`
|
? `(publicKey.owner:${owner})`
|
||||||
: tags
|
: tags
|
||||||
|
|
Loading…
Reference in New Issue
Block a user