Skip to content
git-on-cloudflare
Git hosting on Cloudflare
Sign in
rachel
/
git-on-cloudflare
main
Loading...
Browse
Commits
Admin
File
Blob: src/client/json.ts
..
/
main
/
src
/
client
/
json.ts
typescript
10 lines
Copy
View
Raw
Download
Copy raw
View raw
Download
1
import
type
{
JsonValue
}
from
"@/shared/web"
;
2
3
export
async
function
safeReadJson
(
response
:
Response
):
Promise
<
JsonValue
|
null
> {
4
try
{
5
return
(
await
response.
json
())
as
JsonValue
;
6
}
catch
{
7
return
null
;
8
}
9
}