synapsecns/sanguine

View on GitHub
packages/widget/src/utils/fetchJsonData.ts

Summary

Maintainability
A
0 mins
Test Coverage
export const fetchJSONData = async (url: string): Promise<any> => {
  const response = await fetch(url)
  if (!response.ok) {
    throw new Error(`HTTP error! status: ${response.status}`)
  }
  return response.json()
}