Socket
Socket
Sign inDemoInstall

@capacitor/ios

Package Overview
Dependencies
Maintainers
7
Versions
756
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@capacitor/ios - npm Package Compare versions

Comparing version 6.0.0-nightly-20231208T150452.0 to 6.0.0-nightly-20231211T150450.0

50

Capacitor/Capacitor/assets/native-bridge.js

@@ -67,4 +67,48 @@

};
const convertBody = async (body) => {
if (body instanceof FormData) {
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);
}
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;
}
let data = new TextDecoder().decode(concatenated);
let type;
if (contentType === 'application/json') {
try {
data = JSON.parse(data);
}
catch (ignored) {
// ignore
}
type = 'json';
}
else if (contentType === 'multipart/form-data') {
type = 'formData';
}
else if (contentType === null || contentType === void 0 ? void 0 : contentType.startsWith('image')) {
type = 'image';
}
else if (contentType === 'application/octet-stream') {
type = 'binary';
}
else {
type = 'text';
}
return {
data,
type,
headers: { 'Content-Type': contentType || 'application/octet-stream' },
};
}
else if (body instanceof FormData) {
const formData = await convertFormData(body);

@@ -436,4 +480,4 @@ const boundary = `${Date.now()}`;

const { body, method } = request;
const { data: requestData, type, headers, } = await convertBody(body || undefined);
const optionHeaders = Object.fromEntries(request.headers.entries());
const { data: requestData, type, headers, } = await convertBody((options === null || options === void 0 ? void 0 : options.body) || body || undefined, optionHeaders['Content-Type'] || optionHeaders['content-type']);
const nativeResponse = await cap.nativePromise('CapacitorHttp', 'request', {

@@ -440,0 +484,0 @@ url: request.url,

4

package.json
{
"name": "@capacitor/ios",
"version": "6.0.0-nightly-20231208T150452.0",
"version": "6.0.0-nightly-20231211T150450.0",
"description": "Capacitor: Cross-platform apps with JavaScript and the web",

@@ -29,3 +29,3 @@ "homepage": "https://capacitorjs.com",

"peerDependencies": {
"@capacitor/core": "^6.0.0-nightly-20231208T150452.0"
"@capacitor/core": "^6.0.0-nightly-20231211T150450.0"
},

@@ -32,0 +32,0 @@ "publishConfig": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc