Skip to content

Instantly share code, notes, and snippets.

@bhaireshm
Last active June 16, 2021 06:35
Show Gist options
  • Save bhaireshm/a3cfec5faa02df724b3ca1f9d33f1eac to your computer and use it in GitHub Desktop.
Save bhaireshm/a3cfec5faa02df724b3ca1f9d33f1eac to your computer and use it in GitHub Desktop.
Checks the object, if any one key's value is empty it returns false.
checkObject(data, columns) {
let obj = {};
Object.entries(data).forEach((ele, i) => {
columns.forEach(col => {
if (ele[0] == col.field || ele[0] == 'id') {
obj[ele[0]] = ele[1];
}
});
});
for (var key in obj) {
if (isEmpty(obj[key])) { // check this method
return false;
}
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment