Skip to content

kba/object-prune

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

object-prune

Prune objects from non-values

Install

npm install --save object-prune

Usage

const prune = require('object-prune')

prune(obj)

Walk an object recursively and remove

prune({one: "", two: [], three: {}, four: 4}) // # {four: 4}

prune.emptyStrings(obj)

prune({one: "", two: [], three: {}, four: 4}) // # {two: [], three: {}, four: 4}

prune.emptyArrays(obj)

prune({one: "", two: [], three: {}, four: 4}) // # {one: "", three: {}, four: 4}

prune.emptyObjects(obj)

prune({one: "", two: [], three: {}, four: 4}) // # {one: "", two: [], four: 4}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published