Skip to content

[Feature Request]: Encode as blobParts (may include blobs) #70

@jimmywarting

Description

@jimmywarting

I just came up with a grate idea that i posted in cbor-x about supporting blobs and having them be kind of exactly the same things as an ArrayBuffer.

just fyi, it's not about supporting encoding/decoding them as a Blob or a File with a custom tags that may include a filename, mimetype and lastModified date. it's just about having blobs be the same equivalent representation as byte arrays

it was a long post so I'm just going to link to kriszyp/cbor-x#57 (comment)


now if i would like to support things such as File tags then i could just as equally just encode it as:

encode({
  name: file.name,
  lastModified: file.lastModified,
  type: file.type,
  content: file // or await file.arrayBuffer()
})

And decode/map it to a file when i later decode it... or write a tag plugin to support this transformation automatically.

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