function filterObject(target) {
return Object.keys(target).reduce((result, key) => {
const value = target[key];
if (!value && typeof value !== "boolean") {
return result;
}
if (typeof value === "object" && Object.keys(value).length === 0) {
return result;
}
return {
...result,
[key]: value
};
}, {});
}