Last active
June 16, 2021 06:35
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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