@capacitor/android 5.0.5-nightly-20230607T150532.0 → 5.0.5

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.
@@ -136,7 +136,8 @@ var nativeBridge = (function (exports) {
136
136
  if (nav) {
137
137
  nav.app = nav.app || {};
138
138
  nav.app.exitApp = () => {
139
- if (!cap.Plugins || !cap.Plugins.App) {
139
+ var _a;
140
+ if (!((_a = cap.Plugins) === null || _a === void 0 ? void 0 : _a.App)) {
140
141
  win.console.warn('App plugin not installed');
141
142
  }
142
143
  else {
@@ -147,6 +148,7 @@ var nativeBridge = (function (exports) {
147
148
  if (doc) {
148
149
  const docAddEventListener = doc.addEventListener;
149
150
  doc.addEventListener = (...args) => {
151
+ var _a;
150
152
  const eventName = args[0];
151
153
  const handler = args[1];
152
154
  if (eventName === 'deviceready' && handler) {
@@ -155,7 +157,7 @@ var nativeBridge = (function (exports) {
155
157
  else if (eventName === 'backbutton' && cap.Plugins.App) {
156
158
  // Add a dummy listener so Capacitor doesn't do the default
157
159
  // back button action
158
- if (!cap.Plugins || !cap.Plugins.App) {
160
+ if (!((_a = cap.Plugins) === null || _a === void 0 ? void 0 : _a.App)) {
159
161
  win.console.warn('App plugin not installed');
160
162
  }
161
163
  else {
@@ -366,6 +368,7 @@ var nativeBridge = (function (exports) {
366
368
  if (doPatchHttp) {
367
369
  // fetch patch
368
370
  window.fetch = async (resource, options) => {
371
+ var _a;
369
372
  if (!(resource.toString().startsWith('http:') ||
370
373
  resource.toString().startsWith('https:'))) {
371
374
  return win.CapacitorWebFetch(resource, options);
@@ -384,9 +387,8 @@ var nativeBridge = (function (exports) {
384
387
  data: (options === null || options === void 0 ? void 0 : options.body) ? options.body : undefined,
385
388
  headers: headers,
386
389
  });
387
- let data = !nativeResponse.headers['Content-Type'].startsWith('application/json')
388
- ? nativeResponse.data
389
- : JSON.stringify(nativeResponse.data);
390
+ let data = ((_a = nativeResponse.headers['Content-Type']) === null || _a === void 0 ? void 0 : _a.startsWith('application/json'))
391
+ ? JSON.stringify(nativeResponse.data) : nativeResponse.data;
390
392
  // use null data for 204 No Content HTTP response
391
393
  if (nativeResponse.status === 204) {
392
394
  data = null;
@@ -527,15 +529,15 @@ var nativeBridge = (function (exports) {
527
529
  : undefined,
528
530
  })
529
531
  .then((nativeResponse) => {
532
+ var _a;
530
533
  // intercept & parse response before returning
531
534
  if (this.readyState == 2) {
532
535
  this.dispatchEvent(new Event('loadstart'));
533
536
  this._headers = nativeResponse.headers;
534
537
  this.status = nativeResponse.status;
535
538
  this.response = nativeResponse.data;
536
- this.responseText = !nativeResponse.headers['Content-Type'].startsWith('application/json')
537
- ? nativeResponse.data
538
- : JSON.stringify(nativeResponse.data);
539
+ this.responseText = ((_a = nativeResponse.headers['Content-Type']) === null || _a === void 0 ? void 0 : _a.startsWith('application/json'))
540
+ ? JSON.stringify(nativeResponse.data) : nativeResponse.data;
539
541
  this.responseURL = nativeResponse.url;
540
542
  this.readyState = 4;
541
543
  this.dispatchEvent(new Event('load'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/android",
3
- "version": "5.0.5-nightly-20230607T150532.0",
3
+ "version": "5.0.5",
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)",
@@ -23,7 +23,7 @@
23
23
  "verify": "./gradlew clean lint build test -b capacitor/build.gradle"
24
24
  },
25
25
  "peerDependencies": {
26
- "@capacitor/core": "^5.0.0-nightly-20230607T150532.0"
26
+ "@capacitor/core": "^5.0.0"
27
27
  },
28
28
  "publishConfig": {
29
29
  "access": "public"