* Run the provided function exclusively on the lock
(cb: () => T)
| 223 | * Run the provided function exclusively on the lock |
| 224 | */ |
| 225 | async withLocked<T>(cb: () => T): Promise<Awaited<T>> { |
| 226 | await this.lock() |
| 227 | |
| 228 | try { |
| 229 | return await cb() |
| 230 | } finally { |
| 231 | this.unlock() |
| 232 | } |
| 233 | } |
| 234 | } |
| 235 | |
| 236 | export function base64Encode(data: Uint8Array): string { |
no test coverage detected