consul/ui/packages/consul-ui/app/utils/remove-null.js

10 lines
224 B
JavaScript
Raw Normal View History

export default function(obj) {
// non-recursive for the moment
return Object.keys(obj).reduce(function(prev, item, i, arr) {
if (obj[item] !== null) {
2018-07-06 12:09:23 +00:00
prev[item] = obj[item];
}
return prev;
}, {});
}