Skip to content

Commit

Permalink
fix: typescript complaining about unassignable types #3
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael committed Oct 17, 2022
1 parent 8331bb2 commit e3b88ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function isArray<T>(value: unknown): value is T[] {
return Array.isArray(value);
}

export function isObject(value: unknown): value is Record<string, unknown> {
export function isObject(value: unknown): value is object {
return typeof value === "object" && value !== null && !isArray(value);
}

Expand Down Expand Up @@ -118,6 +118,7 @@ export function values<T extends IObject>(obj: T): T[keyof T][] {
/**
* Iterate over an object or array.
*/

export function forEach<T extends IObject>(
obj: T,
fn: (key: keyof T, value: T[keyof T], obj: T) => void
Expand Down

0 comments on commit e3b88ac

Please sign in to comment.