mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: search min and max lengths
This commit is contained in:
1 parent
3b429a6c05
commit
73cb3873d9
6 files changed
+64
-7
No files matched your search
@@ -11,10 +11,11 @@ export type AccountListWithServer = (AccountListItem & {
|
||||
})[];
|
||||
|
||||
export async function searchPlayersAcrossRegions(search: string, limit = 25) {
|
||||
const trimmedSearch = search.trim();
|
||||
const trimmed = search.trim();
|
||||
if (trimmed.length < 3 && trimmed.length > 100) return [];
|
||||
const normalizedLimit = Math.floor(limit / 3);
|
||||
|
||||
if (usernamePattern.test(trimmedSearch)) {
|
||||
if (usernamePattern.test(trimmed)) {
|
||||
return (
|
||||
await Promise.all([
|
||||
fetchBlitz<AccountList>('com', 'account/list', {
|
||||
|
||||
Reference in new issue
Block a user