Type guard to validate if a Response object contains HTML content. Checks both the Content-Type header and ensures it's a valid Response object.
The Response object to validate
Type predicate indicating if the response contains HTML content
// Valid HTML responseconst htmlResponse = new Response('<html><body>Hello</body></html>', { headers: { 'Content-Type': 'text/html' }});assertHtmlResponse(htmlResponse); Copy
// Valid HTML responseconst htmlResponse = new Response('<html><body>Hello</body></html>', { headers: { 'Content-Type': 'text/html' }});assertHtmlResponse(htmlResponse);
Type guard to validate if a Response object contains HTML content. Checks both the Content-Type header and ensures it's a valid Response object.