Skip to content

Commit

Permalink
Fix type error and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmud committed Jul 26, 2023
1 parent 57474b5 commit 44b6498
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/utils/misc/isElementType.ts
Expand Up @@ -2,7 +2,7 @@ type tag = keyof HTMLElementTagNameMap

export function isElementType<
T extends tag,
P extends {[k: string]: unknown} | undefined = undefined
P extends {[k: string]: unknown} | undefined = undefined,
>(
element: Element,
tag: T | T[],
Expand Down
4 changes: 2 additions & 2 deletions tests/_helpers/listeners.ts
Expand Up @@ -139,10 +139,10 @@ export function addListeners(
}
}

function hasProperty<T extends {}, K extends PropertyKey>(
function hasProperty<T extends {}, K extends PropertyKey, V = string>(
obj: T,
prop: K,
): obj is T & {[k in K]: unknown} {
): obj is T & {[k in K]: V} {
return prop in obj
}

Expand Down

0 comments on commit 44b6498

Please sign in to comment.