From c8206f3413b0390693e56180ed19ebabc2b701bf Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Thu, 6 Aug 2020 17:17:26 -0400 Subject: [PATCH] Create utilities file for common JS tools --- src/utilities.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/utilities.js diff --git a/src/utilities.js b/src/utilities.js new file mode 100644 index 0000000..550f6ff --- /dev/null +++ b/src/utilities.js @@ -0,0 +1,10 @@ +/** + * Returns true if object has no entries, otherwise false. + * @param {Object} objectToCheck The object to check. + * @returns true if object has no entries, otherwise false. + */ +function objectIsEmpty(objectToCheck) { + return Object.entries(objectToCheck).length === 0; +} + +export { objectIsEmpty }; \ No newline at end of file