diff --git a/benchmarks/src/async.ts b/benchmarks/src/async.ts index 7bddd268..9f05cb6f 100644 --- a/benchmarks/src/async.ts +++ b/benchmarks/src/async.ts @@ -1,6 +1,6 @@ import {testIterOps} from './tests/iter-ops'; import {testRXJS} from './tests/rxjs'; -import {toAsync} from '../../'; +import {toAsync} from '../../src'; // tslint:disable:no-console diff --git a/benchmarks/src/tests/iter-ops.ts b/benchmarks/src/tests/iter-ops.ts index 711747d3..81de2e38 100644 --- a/benchmarks/src/tests/iter-ops.ts +++ b/benchmarks/src/tests/iter-ops.ts @@ -1,4 +1,4 @@ -import {type UnknownIterable, filter, map, pipe, toArray} from '../../../'; +import {type UnknownIterable, filter, map, pipe, toArray} from '../../../src'; export async function testIterOps(input: UnknownIterable) { const start = Date.now(); diff --git a/benchmarks/src/tests/rxjs.ts b/benchmarks/src/tests/rxjs.ts index 04526640..ef5e1655 100644 --- a/benchmarks/src/tests/rxjs.ts +++ b/benchmarks/src/tests/rxjs.ts @@ -1,4 +1,4 @@ -import type {UnknownIterable} from '../../../'; +import {UnknownIterable} from '../../../src'; import {filter, firstValueFrom, from, map, toArray} from 'rxjs'; export async function testRXJS( diff --git a/src/ops/retry.ts b/src/ops/retry.ts index 8527786f..5bf63bcb 100644 --- a/src/ops/retry.ts +++ b/src/ops/retry.ts @@ -72,21 +72,24 @@ export function retry(attempts: number): Operation; * @category Sync+Async */ export function retry( - cb: Retry> + retry: (cb: { + attempt: number, + error: any, + index: number, + state: IterationState + }) => boolean | Promise ): Operation; export function retry(...args: unknown[]) { return createOperation(retrySync, retryAsync, args); } -type Retry = - | number - | (({ - attempt: number, - error: any, - index: number, - state: IterationState - }) => T); +type Retry = number | ((cb: { + attempt: number, + error: any, + index: number, + state: IterationState +}) => T); function retrySync( iterable: Iterable, @@ -161,7 +164,7 @@ function retryAsync( f ? this.next() : // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors - Promise.reject(error); + Promise.reject(error); const r = cb({ attempt, index,