(bots: any[])
| 45 | } |
| 46 | |
| 47 | function 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 | |
| 62 | async function main() { |
| 63 | // Get document, or throw exception on error |
no test coverage detected