(str: string)
| 708 | } |
| 709 | |
| 710 | b64UTFEncode(str: string): string { |
| 711 | return Buffer.from( |
| 712 | encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, (match, v) => { |
| 713 | return String.fromCharCode(Number.parseInt(v, 16)); |
| 714 | }), |
| 715 | ).toString('base64'); |
| 716 | } |
| 717 | |
| 718 | asciiEncodeJsonText(json: string): string { |
| 719 | return json.replace(/[\u007F-\uFFFF]/g, chr => { |
no test coverage detected