(text: string)
| 40 | |
| 41 | /** True if `text` contains an instruction-like injection pattern. */ |
| 42 | export function hasInjection(text: string): boolean { |
| 43 | return INJECTION_PATTERNS.some((p) => p.test(text)); |
| 44 | } |
| 45 | |
| 46 | /** Returns the first injection pattern that matches, or null. For actionable errors. */ |
| 47 | export function firstInjectionMatch(text: string): RegExp | null { |
no outgoing calls
no test coverage detected