Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export function isDeepEmpty(input) {
- // catch null or undefined object
- if (!input) return true
- if (typeof(input) === 'object') {
- for (const entry of Object.values(input)) {
- if (!isDeepEmpty(entry)) {
- return false
- }
- }
- return true
- }
- // if input is not an object return false
- return false
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement