Skip to content

Commit

Permalink
fix ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
bmartel committed Sep 14, 2022
1 parent 51c6bd2 commit e4b2dc7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dist-worker

/src/**/*.js
/src/**/*.d.ts
!/src/vite-env.d.ts
/types

# Editor directories and files
Expand Down
22 changes: 18 additions & 4 deletions src/ripple/worker.js → src/ripple/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,16 @@ setInterval(() => {
for (const [key, value] of res.headers) {
headers[key] = value
}
const isJson = headers["content-type"]?.startsWith("application/json")
const isJson = headers['content-type']?.startsWith('application/json')
const body = isJson ? await res.json() : await res.text()
return f.onFetch({ headers, ok: res.ok, redirected: res.redirected, status: res.status, statusText: res.statusText, body })
return f.onFetch({
headers,
ok: res.ok,
redirected: res.redirected,
status: res.status,
statusText: res.statusText,
body,
})
})
}
}
Expand All @@ -54,9 +61,16 @@ const background = {
for (const [key, value] of res.headers) {
headers[key] = value
}
const isJson = headers["content-type"]?.startsWith("application/json")
const isJson = headers['content-type']?.startsWith('application/json')
const body = isJson ? await res.json() : await res.text()
return onFetch({ headers, ok: res.ok, redirected: res.redirected, status: res.status, statusText: res.statusText, body })
return onFetch({
headers,
ok: res.ok,
redirected: res.redirected,
status: res.status,
statusText: res.statusText,
body,
})
})
}
},
Expand Down

0 comments on commit e4b2dc7

Please sign in to comment.