findHeader = (data) => {
  const headStart = '{"type":"home-gallery/database'
  const dataProp = ',"data":['
  if (data.length < 82) {
    return [null, -1]
  } else if (!data.startsWith(headStart)) {
    return [new Error(`Unknown file start`)]
  }

  const pos = data.indexOf(dataProp)
  if (pos < 0) {
    return [null, -1]
  }
  try {
    const end = pos + dataProp.length
    const json = data.substring(0, end) + ']}'
    const header = JSON.parse(json)
    return [null, end, header]
  } catch (e) {
    return [e, 0, end]
  }
}
@param {string} data
@returns {[Error, number, DatabaseHeader]}