Skip to content

Commit

Permalink
Create utilities file for common JS tools
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Campbell committed Aug 6, 2020
1 parent ecce172 commit c8206f3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/utilities.js
Original file line number Diff line number Diff line change
@@ -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 };

0 comments on commit c8206f3

Please sign in to comment.