-
Notifications
You must be signed in to change notification settings - Fork 0
/
isEmptyObject.js
35 lines (31 loc) · 1.01 KB
/
isEmptyObject.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "./isObject"], factory);
} else if (typeof exports !== "undefined") {
factory(exports, require("./isObject"));
} else {
var mod = {
exports: {}
};
factory(mod.exports, global.isObject);
global.isEmptyObject = mod.exports;
}
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _isObject) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports["default"] = isEmptyObject;
_isObject = _interopRequireDefault(_isObject);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
/**
* Determine whether input is an empty object
*
* @param {*} input
*/
function isEmptyObject(input) {
if (!(0, _isObject["default"])(input)) return false;
return Object.keys(input).length === 0;
}
module.exports = exports.default;
});