export const blobToJson = (blob) => {
  return new Promise((resolve, reject) => {
    const reader = new FileReader()

    reader.onload = function (event) {
      const jsonString = event.target.result
      const jsonObject = JSON.parse(jsonString)
      resolve(jsonObject)
    }

    reader.onerror = function (error) {
      reject(error)
    }

    reader.readAsText(blob)
  })
}