🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

clean-object

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

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
Source
npm
Version published
Weekly downloads
347
-48.05%
Maintainers
1
Weekly downloads
 
Created
Source

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
    }
}

Keywords

clean

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