HF RL Explorer

Task: Check if a Fetch Response is JSON in JavaScript

Task: Check if a Fetch Response is JSON in JavaScript: a task in Terminal-Lego-15k (Harbor dataset). Create a JavaScript utility module that provides a robust way to determine whether a fetch API response contains JSON data or plain text. The solution should handle the ambiguity of HTTP responses…

The task

Create a JavaScript utility module that provides a robust way to determine whether a `fetch` API response contains JSON data or plain text. The solution should handle the ambiguity of HTTP responses where the content type might not always be reliable, implementing multiple detection strategies.

Part of PrimeIntellect/Terminal-Lego-15k.