source: node_modules/es-toolkit/dist/predicate/isPlainObject.mjs

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 449 bytes
RevLine 
[a762898]1function isPlainObject(value) {
2 if (!value || typeof value !== 'object') {
3 return false;
4 }
5 const proto = Object.getPrototypeOf(value);
6 const hasObjectPrototype = proto === null ||
7 proto === Object.prototype ||
8 Object.getPrototypeOf(proto) === null;
9 if (!hasObjectPrototype) {
10 return false;
11 }
12 return Object.prototype.toString.call(value) === '[object Object]';
13}
14
15export { isPlainObject };
Note: See TracBrowser for help on using the repository browser.