* Detect whether a string looks like an HTML page rather than a plain error message. * Used to sanitize GitHub's "Unicorn" / gateway error HTML responses so they don't * pollute CI logs with hundreds of lines of markup. * * @param {string} str - The string to inspect * @returns {boolean} True w
(str)
| 9 | * @returns {boolean} True when the string appears to be an HTML document |
| 10 | */ |
| 11 | function isHtmlContent(str) { |
| 12 | return /^\s*<!DOCTYPE\s/i.test(str) || /^\s*<html[\s>]/i.test(str); |
| 13 | } |
| 14 | |
| 15 | /** |
| 16 | * Safely extract an error message from an unknown error value. |
no outgoing calls
no test coverage detected