(val)
| 1 | const isEmpty = (val) => { |
| 2 | // check for empty object {}, array [] |
| 3 | if (val !== null && typeof val === 'object') { |
| 4 | if (Object.keys(val).length === 0) { |
| 5 | return true; |
| 6 | } |
| 7 | } else if (val === null || val === undefined || val === '') { |
| 8 | // check for undefined, null and "" |
| 9 | return true; |
| 10 | } |
| 11 | return false; |
| 12 | }; |
| 13 | |
| 14 | export default isEmpty; |
no outgoing calls
no test coverage detected