Skip to content

Commit 28a83ba

Browse files
authored
fix: revert #1379 (#1953)
1 parent e0e5f82 commit 28a83ba

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

packages/shared/src/utils.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,8 @@ export const objectToString = Object.prototype.toString
141141
export const toTypeString = (value: unknown): string =>
142142
objectToString.call(value)
143143

144-
export const isPlainObject = (val: unknown): val is object => {
145-
if (!isObject(val)) return false
146-
const proto = Object.getPrototypeOf(val)
147-
return proto === null || proto.constructor === Object
148-
}
144+
export const isPlainObject = (val: unknown): val is object =>
145+
toTypeString(val) === '[object Object]'
149146

150147
// for converting list and named values to displayed strings.
151148
export const toDisplayString = (val: unknown): string => {

0 commit comments

Comments
 (0)