(v: string)
| 95 | } |
| 96 | |
| 97 | const asArrayBuffer = (v: string) => |
| 98 | Uint8Array.from( |
| 99 | atob(v.replaceAll('_', '/').replaceAll('-', '+')), |
| 100 | c => c.codePointAt(0) ?? 0 |
| 101 | ) |
| 102 | const asBase64 = (ab: ArrayBuffer | undefined) => |
| 103 | btoa(String.fromCodePoint(...new Uint8Array(ab ?? []))) |
| 104 | .replaceAll('+', '-') |