(input, maxLength = 2000)
| 136 | } |
| 137 | |
| 138 | export function sanitizeInput(input, maxLength = 2000) { |
| 139 | if (typeof input !== 'string') return ''; |
| 140 | |
| 141 | return input |
| 142 | .trim() |
| 143 | .substring(0, maxLength) |
| 144 | .replace(/[\x00-\x1F\x7F]/g, ''); |
| 145 | } |
| 146 | |
| 147 | export function sanitizeMention(mention) { |
| 148 | const validId = mention.replace(/[<@!&#]/g, ''); |
no outgoing calls
no test coverage detected