Skip to content

Commit ae820cb

Browse files
committed
fix: allow 0 as attribute value
the `compact` function was a bit too aggressive and removed that value, which meant it was not possible to set the debounce to zero.
1 parent 7299686 commit ae820cb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/compact.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// removes falsy and empty object values from objects
22
export default (obj) => {
33
return Object.fromEntries(Object.entries(obj).filter(([_, v]) => {
4+
if (v === 0) return true
45
if (v && v.constructor === Object && Object.keys(v).length === 0) return false
56
return !!v
67
}))

0 commit comments

Comments
 (0)