(input: string)
| 65 | const regex = new RegExp([...knownBot, ...botList].join('|'), 'i'); |
| 66 | |
| 67 | export function getBot(input: string): string | undefined { |
| 68 | const result = regex.exec(input); |
| 69 | return result?.length ? result.at(0) : undefined; |
| 70 | } |
| 71 | |
| 72 | export function isBot(userAgent: string) { |
| 73 | return !!getBot(userAgent); |
no outgoing calls
no test coverage detected