(fn: (current: string | undefined) => Promise<LockResult<T>>)
| 415 | const current = this.readAuthJson(); |
| 416 | const { result, next } = fn(current); |
| 417 | if (next !== undefined) { |
| 418 | this.writeAuthJson(next); |
| 419 | } |
| 420 | return result; |
| 421 | } |
| 422 | |
| 423 | async withLockAsync<T>(fn: (current: string | undefined) => Promise<LockResult<T>>): Promise<T> { |
| 424 | const current = this.readAuthJson(); |
| 425 | const { result, next } = await fn(current); |
| 426 | if (next !== undefined) { |
| 427 | this.writeAuthJson(next); |
nothing calls this directly
no test coverage detected