Como encontrar objeto vazio em JS
const emptyObject = {}
Object.entries(objectToCheck)
If it returns an empty array, it means the object does not have any enumerable property,
which in turn means it is empty.
Object.entries(objectToCheck).length === 0
Lodash, a popular library, makes it simpler by providing the isEmpty() function:
_.isEmpty(objectToCheck)
shafeeque