We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e0e5f82 commit 28a83baCopy full SHA for 28a83ba
packages/shared/src/utils.ts
@@ -141,11 +141,8 @@ export const objectToString = Object.prototype.toString
141
export const toTypeString = (value: unknown): string =>
142
objectToString.call(value)
143
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
-}
+export const isPlainObject = (val: unknown): val is object =>
+ toTypeString(val) === '[object Object]'
149
150
// for converting list and named values to displayed strings.
151
export const toDisplayString = (val: unknown): string => {
0 commit comments