How to convert object keys to an array in javascript?

How can I convert object keys to an array with different data types? Javascript map function does not cover the object data type values.

Example:

let obj = {
  data1: 'test',
  data2: boolean,
  data3: {
    test1: 'test',
    test2: 'test'
  }
}

Expected output:

let arr = [
  'data1',
  'data2',
  'data3.test1',
  'data3.test2'
]