export function extractJSON(str: string) {
  const jsonRegex = /(\{.*\}|\[.*\])/s
  const match = str.match(jsonRegex)
  if (!match) return null

  try {
    return JSON.parse(match[0])
  } catch (e) {
    return null
  }
}
