📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP

clean-object

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clean-object

Recursively delete properties from an object that have values of {} or undefined

1.0.2
latest
Version published
Weekly downloads
174
-70%
Maintainers
1
Weekly downloads
 
Created

clean-object

Recursively delete properties from an object that have values of {}, or undefined

Usage

var cleanObject = require('clean-object');

var object = {
    a: 1,
    b: {
        c: {
            d: {
                e: {},
                f: undefined
            }
        },
        g: 2
    }
}

cleanObject(object);

will result in


{
    a: 1,
    b: {
        g: 2
    }
}

FAQs

Package last updated on 24 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts