diff --git a/lib/utils.js b/lib/utils.js index b062d8fd..a338d6e6 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -131,7 +131,15 @@ function isPlainObject(val) { * @return {boolean} True if value is a empty Object, otherwise false */ function isEmptyObject(val) { - return val && Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype; + if (!isPlainObject(val)) { + return false; + } + for (var key in val) { + if (Object.prototype.hasOwnProperty.call(val, key)) { + return false; + } + } + return true; } /**