We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 38a231b commit be77761Copy full SHA for be77761
src/utils/isPlainObject.js
@@ -3,14 +3,12 @@
3
* @returns {boolean} True if the argument appears to be a plain object.
4
*/
5
export default function isPlainObject(obj) {
6
- if (typeof obj !== 'object' || obj === null) return false
7
-
8
- let prototypeOfObj = Object.getPrototypeOf(obj)
9
- let proto = obj
10
- while (Object.getPrototypeOf(proto) !== null) {
11
- proto = Object.getPrototypeOf(proto)
12
13
- }
14
15
- return prototypeOfObj === proto
16
+ if (typeof obj !== 'object' || obj === null) return false
+
+ let proto = obj
+ while (Object.getPrototypeOf(proto) !== null) {
+ proto = Object.getPrototypeOf(proto)
+ }
+ return Object.getPrototypeOf(obj) === proto
+}
0 commit comments