Skip to content

Commit

Permalink
fix(isPlainObject): support check Object.create(null)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhe-he authored Dec 5, 2023
1 parent 0e8a7b0 commit 8166351
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/isPlainObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ export default function isPlainObject(obj: any): obj is object {
proto = Object.getPrototypeOf(proto)
}

return Object.getPrototypeOf(obj) === proto
return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null
}

0 comments on commit 8166351

Please sign in to comment.