* Encode a UTF-8 string to base64 safely (supports non-ASCII characters).
(str: string)
| 150 | * Encode a UTF-8 string to base64 safely (supports non-ASCII characters). |
| 151 | */ |
| 152 | function utf8ToBase64(str: string): string { |
| 153 | const bytes = new TextEncoder().encode(str); |
| 154 | let binary = ''; |
| 155 | for (let i = 0; i < bytes.length; i++) { |
| 156 | binary += String.fromCharCode(bytes[i]); |
| 157 | } |
| 158 | return btoa(binary); |
| 159 | } |
| 160 | |
| 161 | /** Standard error handler for git operations */ |
| 162 | async function handleGitError(res: Response, step: string) { |
no outgoing calls
no test coverage detected