
This is a collection of functions for working with Blob objects.
The serializeBlob function serializes an AracnaBlob instance into a Blob object.
import { AracnaBlob, serializeBlob } from '@aracna/core';
(async () => {
const aracnaBlob = new AracnaBlob(new Blob(['hello']));
const blob = serializeBlob(aracnaBlob);
// will log "hello"
console.log(await blob.text());
})();The deserializeBlob function deserializes a Blob object into an AracnaBlob instance.
import { deserializeBlob } from '@aracna/core';
(async () => {
const blob = new Blob(['hello']);
const aracnaBlob = await deserializeBlob(blob, { resolveText: true });
// will log "hello"
console.log(aracnaBlob.text);
})();