(body)
| 1762 | } |
| 1763 | __name(hasSafeIterator, "hasSafeIterator"); |
| 1764 | function bodyLength(body) { |
| 1765 | if (body == null) { |
| 1766 | return 0; |
| 1767 | } else if (isStream(body)) { |
| 1768 | const state = body._readableState; |
| 1769 | return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length) ? state.length : null; |
| 1770 | } else if (isBlobLike(body)) { |
| 1771 | return body.size != null ? body.size : null; |
| 1772 | } else if (isBuffer(body)) { |
| 1773 | return body.byteLength; |
| 1774 | } |
| 1775 | return null; |
| 1776 | } |
| 1777 | __name(bodyLength, "bodyLength"); |
| 1778 | function isDestroyed(body) { |
| 1779 | return body && !!(body.destroyed || body[kDestroyed] || stream.isDestroyed?.(body)); |
no test coverage detected