(str: string)
| 19 | // ============================================================================ |
| 20 | |
| 21 | function base64UrlDecode(str: string): string { |
| 22 | let base64 = str.replace(/-/g, '+').replace(/_/g, '/') |
| 23 | const pad = base64.length % 4 |
| 24 | if (pad === 2) base64 += '==' |
| 25 | else if (pad === 3) base64 += '=' |
| 26 | return Buffer.from(base64, 'base64').toString('utf-8') |
| 27 | } |
| 28 | |
| 29 | export function extractChatGptAccountId(accessToken: string): string | null { |
| 30 | try { |
no test coverage detected