Skip to content

Commit

Permalink
Refactor patch-request constructor types and update `CapacitorWebFe…
Browse files Browse the repository at this point in the history
…tch` initialization

- Updated `patch-request.ts` constructor to use more specific types (`RequestInfo | URL` and `RequestInit`).
- Simplified `CapacitorWebFetch` initialization in `patch-request.ts`.
- Updated `.gitignore` to include new paths for Capacitor Android build files.
- Removed unnecessary build and settings files from the repository.
  • Loading branch information
tachibana-shin committed Aug 4, 2024
1 parent 3c83a4f commit 9e38650
Show file tree
Hide file tree
Showing 18 changed files with 6 additions and 19 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,7 @@ build

.env

/src-capacitor/android/app/google-services.json
/src-capacitor/android/app/google-services.json

/@capacitor/android/capacitor/.gradle
/@capacitor/android/capacitor/.settings
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Empty file.

This file was deleted.

3 changes: 1 addition & 2 deletions src/boot/patch-request.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import "src/logic/patch-request"

if (!("CapacitorWebFetch" in self))
self.CapacitorWebFetch = fetch
if (!("CapacitorWebFetch" in self)) window.CapacitorWebFetch = fetch
2 changes: 1 addition & 1 deletion src/logic/patch-request.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
window.Request = class extends Request {
readonly headers: Headers
constructor(url, initParams) {
constructor(url: RequestInfo | URL, initParams?: RequestInit) {
super(url, initParams)
this.headers = new Headers(initParams?.headers)
}
Expand Down

0 comments on commit 9e38650

Please sign in to comment.