Skip to content

Commit 29ff77c

Browse files
committed
fix: issues for Typescript version 5.7.2
1 parent 97c4e90 commit 29ff77c

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/utils/delay.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export function delay<T = undefined>(ms: number, value?: T): Promise<T> {
1+
export function delay(ms: number, value?: undefined): Promise<undefined> {
22
return new Promise((resolve) => {
33
setTimeout(() => { resolve(value); }, ms);
44
});

src/utils/is-enum-value.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Type guard to check to see if the given value is a valid value for the enum.
33
*/
44
export function isEnumValue<T>(enumType: T, value: unknown): value is T[keyof T] {
5-
return (Object.keys(enumType) as Array<keyof T>)
5+
return (Object.keys(enumType as {}) as Array<keyof T>)
66
.map((key) => {
77
return enumType[key];
88
})

tests/utils/delay.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { delay, isPromiseLike } from '../../src';
44
describe('delay', () => {
55

66
it('delays before returning a value', async () => {
7-
let after: string | null = null,
7+
let after: string | undefined | null = null,
88
promise = delay(10, 'this-is-my-test-value');
99

1010
promise.then((v) => { after = v; });

tests/utils/is-empty.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe('isEmpty', () => {
3131
expect(t.isEmpty(() => {})).to.strictlyEqual(true);
3232

3333
// deleting all the keys from on object empties it
34-
o = { a: true };
34+
o = { a: true } as { a?: boolean };
3535
expect(t.isEmpty(o)).to.strictlyEqual(false);
3636
delete o.a;
3737
expect(t.isEmpty(o)).to.strictlyEqual(true);

0 commit comments

Comments
 (0)