Skip to content

BufferPart Warning #1

@Iznogood1

Description

@Iznogood1

Hi,

nice job.

I have a warning message in the saving function :
(Impossible to assign a 'Buffer' type to a 'BlobPart" type) for the line const blob = new Blob([data]...

workbook.xlsx.writeBuffer().then((data) => {
  const blob = new Blob([data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
  FileSaver.saveAs(blob, 'CarData.xlsx');
})

To avoid it, I just added a stupid internal function

workbook.xlsx.writeBuffer().then((data) => {
  const bp = (elt): BlobPart => {
    return elt
  }
  const blob = new Blob([data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
  FileSaver.saveAs(blob, 'CarData.xlsx');
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions