Skip to content

Commit

Permalink
fix: use buffer.slice to create ArrayBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
YujohnNattrass authored and serhalp committed Dec 10, 2024
1 parent c39cb02 commit 065e8f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/build/src/plugins_core/blobs_upload/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ const coreStep: CoreStepFunction = async function ({
systemLog(`Uploading blob ${key}`)

const { data, metadata } = await getFileWithMetadata(key, contentPath, metadataPath)
const buffer = new Uint8Array(data.buffer, data.byteOffset, data.length)
await blobStore.set(key, buffer.buffer, { metadata })
const arrayBuffer = data.buffer.slice(data.byteOffset, data.byteOffset + data.length)
await blobStore.set(key, arrayBuffer, { metadata })
},
{ concurrency: 10 },
)
Expand Down
4 changes: 2 additions & 2 deletions packages/build/src/plugins_core/dev_blobs_upload/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ const coreStep: CoreStepFunction = async function ({
log(logs, `- Uploading blob ${key}`, { indent: true })
}
const { data, metadata } = await getFileWithMetadata(key, contentPath, metadataPath)
const buffer = new Uint8Array(data.buffer, data.byteOffset, data.length)
await blobStore.set(key, buffer.buffer, { metadata })
const arrayBuffer = data.buffer.slice(data.byteOffset, data.byteOffset + data.length)
await blobStore.set(key, arrayBuffer, { metadata })
},
{ concurrency: 10 },
)
Expand Down

0 comments on commit 065e8f9

Please sign in to comment.