* Restores heredoc placeholders back to their original content in a single string. * Internal helper used by restoreHeredocs.
( text: string, heredocs: Map<string, HeredocInfo>, )
| 691 | * Internal helper used by restoreHeredocs. |
| 692 | */ |
| 693 | function restoreHeredocsInString( |
| 694 | text: string, |
| 695 | heredocs: Map<string, HeredocInfo>, |
| 696 | ): string { |
| 697 | let result = text |
| 698 | for (const [placeholder, info] of heredocs) { |
| 699 | result = result.replaceAll(placeholder, info.fullText) |
| 700 | } |
| 701 | return result |
| 702 | } |
| 703 | |
| 704 | /** |
| 705 | * Restores heredoc placeholders in an array of strings. |