MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / transformBots

Function transformBots

apps/api/scripts/get-bots.ts:47–60  ·  view source on GitHub ↗
(bots: any[])

Source from the content-addressed store, hash-verified

45}
46
47function transformBots(bots: any[]): any[] {
48 return bots.map((bot) => {
49 const { regex: rawRegex, ...rest } = bot;
50 const regex = stripAllowlistedTokens(rawRegex);
51 const hasRegexChars = regexSpecialChars.test(regex);
52
53 if (hasRegexChars) {
54 // Keep as regex
55 return { regex, ...rest };
56 }
57 // Convert to includes
58 return { includes: regex, ...rest };
59 });
60}
61
62async function main() {
63 // Get document, or throw exception on error

Callers 1

mainFunction · 0.85

Calls 2

stripAllowlistedTokensFunction · 0.85
mapMethod · 0.45

Tested by

no test coverage detected