Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(azure-storage-blob): add raw support #442

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/drivers/azure-storage-blob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,21 @@
return null;
}
},
async getItemRaw(key) {
try {
const blob = await getContainerClient()
.getBlockBlobClient(key)
.download();
if (isBrowser) {
return blob.blobBody ? await blobToString(await blob.blobBody) : null;
}
return blob.readableStreamBody
? await streamToBuffer(blob.readableStreamBody)
: null;
} catch {
return null;
}
},

Check warning on line 116 in src/drivers/azure-storage-blob.ts

View check run for this annotation

Codecov / codecov/patch

src/drivers/azure-storage-blob.ts#L103-L116

Added lines #L103 - L116 were not covered by tests
async setItem(key, value) {
await getContainerClient()
.getBlockBlobClient(key)
Expand Down
Loading