Skip to content

Commit 05f9a6b

Browse files
committed
apply type narrowing in isObject
1 parent 18ef667 commit 05f9a6b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

web_src/js/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function extname(path: string): string {
2323
}
2424

2525
/** test whether a variable is an object */
26-
export function isObject(obj: any): boolean {
26+
export function isObject<T = Record<string, any>>(obj: any): obj is T {
2727
return Object.prototype.toString.call(obj) === '[object Object]';
2828
}
2929

0 commit comments

Comments
 (0)