* A fallback implementation of `isPlainObject` which checks if a given value * is an object created by the `Object` constructor, assuming objects created * by the `Object` constructor have no inherited enumerable properties and that * there are no `Object.prototype` extensions. *
(value)
| 36641 | * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. |
| 36642 | */ |
| 36643 | function shimIsPlainObject(value) { |
| 36644 | var ctor, |
| 36645 | result; |
| 36646 | |
| 36647 | // avoid non Object objects, `arguments` objects, and DOM elements |
| 36648 | if (!(value && toString.call(value) == objectClass) || |
| 36649 | (ctor = value.constructor, isFunction(ctor) && !(ctor instanceof ctor))) { |
| 36650 | return false; |
| 36651 | } |
| 36652 | // In most environments an object's own properties are iterated before |
| 36653 | // its inherited properties. If the last iterated property is an object's |
| 36654 | // own property then there are no inherited enumerable properties. |
| 36655 | forIn(value, function(value, key) { |
| 36656 | result = key; |
| 36657 | }); |
| 36658 | return typeof result == 'undefined' || hasOwnProperty.call(value, result); |
| 36659 | } |
| 36660 | |
| 36661 | /** |
| 36662 | * Used by `unescape` to convert HTML entities to characters. |
no test coverage detected