export default function clearEmpties(o: any) {
  for (var k in o) {
    if (!o[k] || typeof o[k] !== 'object') {
      continue;
    }

    clearEmpties(o[k]);
    if (Object.keys(o[k]).length === 0) {
      delete o[k];
    }
  }
  return o;
}
