@directus/storage-driver-cloudinary
Advanced tools
Comparing version 11.0.0 to 11.0.1
@@ -269,10 +269,15 @@ // src/index.ts | ||
const queue = new PQueue({ concurrency: 10 }); | ||
const chunks = []; | ||
const chunkSize = 55e5; | ||
let chunks = Buffer.alloc(0); | ||
for await (const chunk of content) { | ||
chunks.push(chunk); | ||
currentChunkSize += chunk.length; | ||
if (currentChunkSize >= 55e5) { | ||
if (chunks.length + chunk.length <= chunkSize) { | ||
currentChunkSize = chunks.length + chunk.length; | ||
chunks = Buffer.concat([chunks, chunk], currentChunkSize); | ||
} else { | ||
const grab = chunkSize - chunks.length; | ||
currentChunkSize = chunks.length + grab; | ||
chunks = Buffer.concat([chunks, chunk.slice(0, grab)], currentChunkSize); | ||
const uploadChunkParams = { | ||
resourceType, | ||
blob: new Blob(chunks), | ||
blob: new Blob([chunks]), | ||
bytesOffset: uploaded, | ||
@@ -290,3 +295,3 @@ bytesTotal: -1, | ||
currentChunkSize = 0; | ||
chunks.length = 0; | ||
chunks = chunk.slice(grab); | ||
} | ||
@@ -298,3 +303,3 @@ totalSize += chunk.length; | ||
resourceType, | ||
blob: new Blob(chunks), | ||
blob: new Blob([chunks]), | ||
bytesOffset: uploaded, | ||
@@ -301,0 +306,0 @@ bytesTotal: totalSize, |
{ | ||
"name": "@directus/storage-driver-cloudinary", | ||
"version": "11.0.0", | ||
"version": "11.0.1", | ||
"description": "Cloudinary file storage abstraction for `@directus/storage`", | ||
@@ -5,0 +5,0 @@ "homepage": "https://directus.io", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21058
459