| 1955 | return line ? line.split(":").slice(1).join(":").trim() : ""; |
| 1956 | } |
| 1957 | function objectProps(o) { |
| 1958 | if (!o || typeof o !== "object") return "not an object"; |
| 1959 | let z, oD, zD; |
| 1960 | try { |
| 1961 | z = Object.assign({}, o); |
| 1962 | } catch { |
| 1963 | return "Object.assign failed"; |
| 1964 | } |
| 1965 | // accept null / "" / undefined for normal/failed/fetch_normal/fetch_failed XHR |
| 1966 | // non-empty text (still primitive) can be also accepted. (common in xhr error case) |
| 1967 | if (typeof (z.response ?? "") !== "string") return "non-primitive response value exposed"; |
| 1968 | if (typeof (z.responseText ?? "") !== "string") return "non-primitive responseText value exposed"; |
| 1969 | if (typeof (z.responseXML ?? "") !== "string") return "non-primitive responseXML value exposed"; |
| 1970 | try { |
| 1971 | oD = JSON.stringify(o); |
| 1972 | } catch { |
| 1973 | return "JSON.stringify failed"; |
| 1974 | } |
| 1975 | try { |
| 1976 | zD = JSON.stringify(z); |
| 1977 | } catch { |
| 1978 | return "JSON.stringify failed"; |
| 1979 | } |
| 1980 | if (oD !== zD) return "Object Props Failed"; |
| 1981 | return "ok"; |
| 1982 | } |
| 1983 | |
| 1984 | // ---------- Runner ---------- |
| 1985 | async function runAll() { |