When trying to flatten an object with an empty array, the key is omitted entirely if the array is empty. Since empty objects are retained, it would be great if arrays have the same behaviour.
const test = { prop: [], objectProp: {} };
flattenObject(test);
// current result: { objectProp: {} }
// expected result: { prop: [], objectProp: {} }