Skip to content

Commit 6bf6aa0

Browse files
authored
fix(types): remove VoidFunction (#2276)
Co-authored-by: Andrei Alecu <[email protected]>
1 parent d4dde13 commit 6bf6aa0

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.changeset/old-flowers-care.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@whatwg-node/promise-helpers': patch
3+
---
4+
5+
Fix types by replacing `VoidFunction` type to `() => void`

packages/promise-helpers/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export function iterateAsync<TInput, TOutput>(
126126
iterable: Iterable<TInput>,
127127
callback: (
128128
input: TInput,
129-
endEarly: VoidFunction,
129+
endEarly: () => void,
130130
index: number,
131131
) => MaybePromise<TOutput | undefined | null | void>,
132132
results?: TOutput[],

packages/promise-helpers/tests/handleMaybePromise.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ describe('promise-helpers', () => {
161161
});
162162

163163
describe('with sync function', () => {
164-
let onFinally: jest.Mock<VoidFunction>;
164+
let onFinally: jest.Mock<() => void>;
165165
let onError: jest.Mock;
166166
let onSuccess: jest.Mock;
167167

@@ -228,7 +228,7 @@ describe('promise-helpers', () => {
228228
});
229229

230230
describe('with fake promises', () => {
231-
let onFinally: jest.Mock<VoidFunction>;
231+
let onFinally: jest.Mock<() => void>;
232232
let onError: jest.Mock;
233233
let onSuccess: jest.Mock;
234234

0 commit comments

Comments
 (0)