Skip to content

Commit bb878d2

Browse files
authored
Create removeEmptyKeys.js
1 parent 5384212 commit bb878d2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export const removeEmptyKeys = (obj) =>
2+
Object.entries(obj).reduce(
3+
(accumulator, [key, value]) => (value ? ((accumulator[key] = value), accumulator) : accumulator),
4+
{},
5+
);

0 commit comments

Comments
 (0)