From d21a934b2c2ad28626f4e59820c53e08ed50f18f Mon Sep 17 00:00:00 2001 From: meteorlxy Date: Mon, 30 Sep 2024 23:23:17 +0800 Subject: [PATCH] fix(shared): revert unexpected type changes (close #1610) --- packages/shared/src/utils/typeGuards.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/shared/src/utils/typeGuards.ts b/packages/shared/src/utils/typeGuards.ts index 44f08427be..ad3f4bcd4e 100644 --- a/packages/shared/src/utils/typeGuards.ts +++ b/packages/shared/src/utils/typeGuards.ts @@ -8,10 +8,8 @@ export const isFunction = (val: unknown): val is Function => /** * Check if a value is plain object, with generic type support */ -export const isPlainObject = < - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters - T extends Record = Record, ->( +// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unnecessary-type-parameters +export const isPlainObject = = Record>( val: unknown, ): val is T => Object.prototype.toString.call(val) === '[object Object]'