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

Function getBot

apps/web/utilities/getBot.ts:67–70  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

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

Callers 2

getUserAgentInfoFunction · 0.90
isBotFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected