feature: add filterObjecNullKeys helper function

This commit is contained in:
George Lima 2019-01-07 15:44:34 -03:00
parent 6c1a64efc1
commit cbb8c60fc9
1 changed files with 8 additions and 0 deletions

View File

@ -0,0 +1,8 @@
// @flow
export default (obj: Object) => Object.keys(obj).reduce((acc, cur) => {
if (obj[cur] === null || obj[cur] === undefined || obj[cur] === '') {
return acc;
}
return { ...acc, [cur]: obj[cur] };
}, {});