* @see https://fetch.spec.whatwg.org/#build-a-content-range * @param {number} rangeStart * @param {number} rangeEnd * @param {number} fullLength
(rangeStart, rangeEnd, fullLength)
| 1210 | * @param {number} fullLength |
| 1211 | */ |
| 1212 | function buildContentRange (rangeStart, rangeEnd, fullLength) { |
| 1213 | // 1. Let contentRange be `bytes `. |
| 1214 | let contentRange = 'bytes ' |
| 1215 | |
| 1216 | // 2. Append rangeStart, serialized and isomorphic encoded, to contentRange. |
| 1217 | contentRange += isomorphicEncode(`${rangeStart}`) |
| 1218 | |
| 1219 | // 3. Append 0x2D (-) to contentRange. |
| 1220 | contentRange += '-' |
| 1221 | |
| 1222 | // 4. Append rangeEnd, serialized and isomorphic encoded to contentRange. |
| 1223 | contentRange += isomorphicEncode(`${rangeEnd}`) |
| 1224 | |
| 1225 | // 5. Append 0x2F (/) to contentRange. |
| 1226 | contentRange += '/' |
| 1227 | |
| 1228 | // 6. Append fullLength, serialized and isomorphic encoded to contentRange. |
| 1229 | contentRange += isomorphicEncode(`${fullLength}`) |
| 1230 | |
| 1231 | // 7. Return contentRange. |
| 1232 | return contentRange |
| 1233 | } |
| 1234 | |
| 1235 | // A Stream, which pipes the response to zlib.createInflate() or |
| 1236 | // zlib.createInflateRaw() depending on the first byte of the Buffer. |
no test coverage detected
searching dependent graphs…