Validates whether a value is a valid APIResponse.
The value to check
True if the value matches the APIResponse structure
const response = await fetch('/api/data');const data = await response.json();if (isAPIResponse(data)) { if (data.success) { console.log('Data:', data.data); } else { console.error('Error:', data.error); }} Copy
const response = await fetch('/api/data');const data = await response.json();if (isAPIResponse(data)) { if (data.success) { console.log('Data:', data.data); } else { console.error('Error:', data.error); }}
Validates whether a value is a valid APIResponse.