12345678910111213141516171819202122232425262728293031323334 |
- function isObject(o) {
- return Object.prototype.toString.call(o) === '[object Object]';
- }
- function isPlainObject(o) {
- var ctor,prot;
- if (isObject(o) === false) return false;
-
- ctor = o.constructor;
- if (ctor === undefined) return true;
-
- prot = ctor.prototype;
- if (isObject(prot) === false) return false;
-
- if (prot.hasOwnProperty('isPrototypeOf') === false) {
- return false;
- }
-
- return true;
- }
- export { isPlainObject };
|