MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / isBadBot

Function isBadBot

apps/web/utilities/getBot.ts:78–84  ·  view source on GitHub ↗
(userAgent: string | null)

Source from the content-addressed store, hash-verified

76const regexBadBots = new RegExp([...botList].join('|'), 'i');
77
78export 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}

Callers 1

middlewareFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected