function flattenObject (ob) {
  const result = {}
  for (const i in ob) {
    if (typeof ob[i] === 'object' && !Array.isArray(ob[i])) {
      const temp = flattenObject(ob[i])
      for (const j in temp) {
        result[i + '.' + j] = temp[j]
      }
    } else {
      result[i] = ob[i]
    }
  }
  return result
}
Flatten a deep-nested object to a single level depth one
i.e from
{
 name: 'test',
 a: {
   b: {
     c: 'foobar'
   }
 }
}
to:
{
   name: 'test',
   'a.b.c': 'foobar'
}
@param {Object} ob
@returns Object