@capacitor/ios
Advanced tools
Comparing version 5.7.6 to 5.7.7
@@ -68,18 +68,25 @@ | ||
const convertBody = async (body, contentType) => { | ||
if (body instanceof ReadableStream) { | ||
const reader = body.getReader(); | ||
const chunks = []; | ||
while (true) { | ||
const { done, value } = await reader.read(); | ||
if (done) | ||
break; | ||
chunks.push(value); | ||
if (body instanceof ReadableStream || body instanceof Uint8Array) { | ||
let encodedData; | ||
if (body instanceof ReadableStream) { | ||
const reader = body.getReader(); | ||
const chunks = []; | ||
while (true) { | ||
const { done, value } = await reader.read(); | ||
if (done) | ||
break; | ||
chunks.push(value); | ||
} | ||
const concatenated = new Uint8Array(chunks.reduce((acc, chunk) => acc + chunk.length, 0)); | ||
let position = 0; | ||
for (const chunk of chunks) { | ||
concatenated.set(chunk, position); | ||
position += chunk.length; | ||
} | ||
encodedData = concatenated; | ||
} | ||
const concatenated = new Uint8Array(chunks.reduce((acc, chunk) => acc + chunk.length, 0)); | ||
let position = 0; | ||
for (const chunk of chunks) { | ||
concatenated.set(chunk, position); | ||
position += chunk.length; | ||
else { | ||
encodedData = body; | ||
} | ||
let data = new TextDecoder().decode(concatenated); | ||
let data = new TextDecoder().decode(encodedData); | ||
let type; | ||
@@ -86,0 +93,0 @@ if (contentType === 'application/json') { |
{ | ||
"name": "@capacitor/ios", | ||
"version": "5.7.6", | ||
"version": "5.7.7", | ||
"description": "Capacitor: Cross-platform apps with JavaScript and the web", | ||
@@ -5,0 +5,0 @@ "homepage": "https://capacitorjs.com", |
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
349009
1039
43