Skip to content

Commit

Permalink
fix: ignore ts compilation error on production build (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xtsukino authored Dec 22, 2023
1 parent 821f273 commit 72efee6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/RequestDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ function WebResponse(props: Props): ReactElement {
const options = {
method: data.method,
headers: data.requestHeaders.reduce(
// @ts-ignore
(acc: { [key: string]: string }, h: chrome.webRequest.HttpHeader) => {
if (typeof h.name !== 'undefined' && typeof h.value !== 'undefined') {
acc[h.name] = h.value;
Expand All @@ -264,6 +265,7 @@ function WebResponse(props: Props): ReactElement {
options.body = formData.toString();
}

// @ts-ignore
const resp = await fetch(data.url, options);
setResponse(resp);

Expand Down
1 change: 1 addition & 0 deletions src/pages/Notarize/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ function HideResponseStep(props: {
const options = {
method: req.method,
headers: req.requestHeaders.reduce(
// @ts-ignore
(acc: { [key: string]: string }, h: chrome.webRequest.HttpHeader) => {
if (typeof h.name !== 'undefined' && typeof h.value !== 'undefined') {
acc[h.name] = h.value;
Expand Down
2 changes: 2 additions & 0 deletions src/utils/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export async function replayRequest(req: RequestLog): Promise<string> {
const options = {
method: req.method,
headers: req.requestHeaders.reduce(
// @ts-ignore
(acc: { [key: string]: string }, h: chrome.webRequest.HttpHeader) => {
if (typeof h.name !== 'undefined' && typeof h.value !== 'undefined') {
acc[h.name] = h.value;
Expand All @@ -64,6 +65,7 @@ export async function replayRequest(req: RequestLog): Promise<string> {
options.body = formData.toString();
}

// @ts-ignore
const resp = await fetch(req.url, options);
const contentType =
resp?.headers.get('content-type') || resp?.headers.get('Content-Type');
Expand Down

0 comments on commit 72efee6

Please sign in to comment.