We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
0
1 parent 7299686 commit ae820cbCopy full SHA for ae820cb
src/compact.js
@@ -1,6 +1,7 @@
1
// removes falsy and empty object values from objects
2
export default (obj) => {
3
return Object.fromEntries(Object.entries(obj).filter(([_, v]) => {
4
+ if (v === 0) return true
5
if (v && v.constructor === Object && Object.keys(v).length === 0) return false
6
return !!v
7
}))
0 commit comments