Skip to content

Move check to the top #101

Closed
Closed
@jimmywarting

Description

@jimmywarting

fetch-blob/index.js

Lines 178 to 181 in 5ba554e

// don't add the overflow to new blobParts
if (added >= span) {
break;
}

I think there might be some error about slicing blob (or BlobDataItem, aka fileFromPath) that would normally end with a zero size.
have not yet tested it out. I used the same related slice logic elsewhere that resulted in a error

A simple test could be to do:

const blob = fileFromPathSync('./package.json') // or
const blob = new Blob(['hello'])
await blob.slice(0, 0).text()

whether or not it's working as intended i think it would be best if this check was moved to the beginning of the loop

for (const part of parts) { 
  // don't add the overflow to new blobParts 
  if (added >= span) { 
    break; 
  } 
  ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions