(userAgent: string | null)
| 76 | const regexBadBots = new RegExp([...botList].join('|'), 'i'); |
| 77 | |
| 78 | export function isBadBot(userAgent: string | null) { |
| 79 | if (!userAgent || userAgent === '') { |
| 80 | return true; |
| 81 | } |
| 82 | const result = regexBadBots.exec(userAgent); |
| 83 | return !!(result?.length ? result.at(0) : undefined); |
| 84 | } |