()
| 51 | } |
| 52 | |
| 53 | public get(): number { |
| 54 | // oxlint-disable-next-line typescript/no-non-null-assertion |
| 55 | let result = this.#timeouts[this.#count]!; |
| 56 | const { jitter = 0, random = DEFAULT_RANDOM } = this.#options; |
| 57 | |
| 58 | // Do not apply jitter larger than the timeout value. It is supposed to be |
| 59 | // activated for longer timeouts. |
| 60 | if (jitter < result) { |
| 61 | result += random() * jitter; |
| 62 | } |
| 63 | return result; |
| 64 | } |
| 65 | |
| 66 | public getAndIncrement(): number { |
| 67 | const result = this.get(); |
no outgoing calls
no test coverage detected