@capacitor/ios 5.7.6 → 5.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -65,22 +65,29 @@ var nativeBridge = (function (exports) {
65
65
  return newFormData;
66
66
  };
67
67
  const convertBody = async (body, contentType) => {
68
- if (body instanceof ReadableStream) {
69
- const reader = body.getReader();
70
- const chunks = [];
71
- while (true) {
72
- const { done, value } = await reader.read();
73
- if (done)
74
- break;
75
- chunks.push(value);
68
+ if (body instanceof ReadableStream || body instanceof Uint8Array) {
69
+ let encodedData;
70
+ if (body instanceof ReadableStream) {
71
+ const reader = body.getReader();
72
+ const chunks = [];
73
+ while (true) {
74
+ const { done, value } = await reader.read();
75
+ if (done)
76
+ break;
77
+ chunks.push(value);
78
+ }
79
+ const concatenated = new Uint8Array(chunks.reduce((acc, chunk) => acc + chunk.length, 0));
80
+ let position = 0;
81
+ for (const chunk of chunks) {
82
+ concatenated.set(chunk, position);
83
+ position += chunk.length;
84
+ }
85
+ encodedData = concatenated;
76
86
  }
77
- const concatenated = new Uint8Array(chunks.reduce((acc, chunk) => acc + chunk.length, 0));
78
- let position = 0;
79
- for (const chunk of chunks) {
80
- concatenated.set(chunk, position);
81
- position += chunk.length;
87
+ else {
88
+ encodedData = body;
82
89
  }
83
- let data = new TextDecoder().decode(concatenated);
90
+ let data = new TextDecoder().decode(encodedData);
84
91
  let type;
85
92
  if (contentType === 'application/json') {
86
93
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/ios",
3
- "version": "5.7.6",
3
+ "version": "5.7.7",
4
4
  "description": "Capacitor: Cross-platform apps with JavaScript and the web",
5
5
  "homepage": "https://capacitorjs.com",
6
6
  "author": "Ionic Team <hi@ionic.io> (https://ionic.io)",