22 lines
397 B
JavaScript
22 lines
397 B
JavaScript
'use strict';
|
|
|
|
//====================================================================
|
|
|
|
var has = require('has');
|
|
|
|
//====================================================================
|
|
|
|
module.exports = function isEmpty(obj) {
|
|
if (has(obj, 'length')) {
|
|
return obj.length === 0;
|
|
}
|
|
|
|
var prop;
|
|
for (prop in obj) {
|
|
if (has(obj, prop)) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
};
|