Skip to content

Commit

Permalink
fix: issues for Typescript version 5.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahtylerb committed Dec 31, 2024
1 parent 97c4e90 commit 29ff77c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/utils/delay.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function delay<T = undefined>(ms: number, value?: T): Promise<T> {
export function delay(ms: number, value?: undefined): Promise<undefined> {
return new Promise((resolve) => {
setTimeout(() => { resolve(value); }, ms);
});
Expand Down
2 changes: 1 addition & 1 deletion src/utils/is-enum-value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Type guard to check to see if the given value is a valid value for the enum.
*/
export function isEnumValue<T>(enumType: T, value: unknown): value is T[keyof T] {
return (Object.keys(enumType) as Array<keyof T>)
return (Object.keys(enumType as {}) as Array<keyof T>)
.map((key) => {
return enumType[key];
})
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/delay.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { delay, isPromiseLike } from '../../src';
describe('delay', () => {

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

promise.then((v) => { after = v; });
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/is-empty.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('isEmpty', () => {
expect(t.isEmpty(() => {})).to.strictlyEqual(true);

// deleting all the keys from on object empties it
o = { a: true };
o = { a: true } as { a?: boolean };
expect(t.isEmpty(o)).to.strictlyEqual(false);
delete o.a;
expect(t.isEmpty(o)).to.strictlyEqual(true);
Expand Down

0 comments on commit 29ff77c

Please sign in to comment.