(buffer: string)
| 28 | * Returns the trimmed content between tags, or null if not found. |
| 29 | */ |
| 30 | export const extractPlanFromBuffer = (buffer: string): string | null => { |
| 31 | const openIdx = buffer.indexOf('<PLAN>') |
| 32 | const closeIdx = buffer.indexOf('</PLAN>') |
| 33 | if (openIdx !== -1 && closeIdx !== -1 && closeIdx > openIdx) { |
| 34 | return buffer.slice(openIdx + '<PLAN>'.length, closeIdx).trim() |
| 35 | } |
| 36 | return null |
| 37 | } |
| 38 | |
| 39 | export const scrubPlanTags = (s: string): string => { |
| 40 | // Support both the canonical </PLAN> tag and the legacy </cb_plan> tag. |
no outgoing calls
no test coverage detected