code: function flattenObject(ob) {
    return Object.entries(ob).reduce((accum, el) => {
      const [key, entry] = el;
  
      if (typeof entry === 'object' && entry !== null) {
        const flatObject = Object.entries(flattenObject(entry));
  
        flatObject.forEach((flattenedEntry) => {
          const [fkey, fentry] = flattenedEntry;
          // eslint-disable-next-line no-param-reassign
          accum[`${key}.${fkey}`] = fentry;
        });
      } else {
        // eslint-disable-next-line no-param-reassign
        accum[key] = entry;
      }
  
      return accum;
    }, {});
  }
docs: TODO: look to see if there"s some exising library that can already do this, similar to flatten() in scala. Or even better something that flattens and filters , sort of like flatten().filter(x => ..)