@serwist/range-requests 9.0.0-preview.13 → 9.0.0-preview.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -14,6 +14,5 @@
|
|
|
14
14
|
* `Range:` header, or a `416 Range Not Satisfiable` response if the
|
|
15
15
|
* conditions of the `Range:` header can't be met.
|
|
16
16
|
*/
|
|
17
|
-
declare
|
|
18
|
-
export { createPartialResponse };
|
|
17
|
+
export declare const createPartialResponse: (request: Request, originalResponse: Response) => Promise<Response>;
|
|
19
18
|
//# sourceMappingURL=createPartialResponse.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPartialResponse.d.ts","sourceRoot":"","sources":["../src/createPartialResponse.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;GAeG;AACH,
|
|
1
|
+
{"version":3,"file":"createPartialResponse.d.ts","sourceRoot":"","sources":["../src/createPartialResponse.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,qBAAqB,YAAmB,OAAO,oBAAoB,QAAQ,KAAG,QAAQ,QAAQ,CA8D1G,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -65,7 +65,7 @@ function parseRangeHeader(rangeHeader) {
|
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
async
|
|
68
|
+
const createPartialResponse = async (request, originalResponse)=>{
|
|
69
69
|
try {
|
|
70
70
|
if (process.env.NODE_ENV !== "production") {
|
|
71
71
|
assert.isInstance(request, Request, {
|
|
@@ -113,7 +113,7 @@ async function createPartialResponse(request, originalResponse) {
|
|
|
113
113
|
statusText: "Range Not Satisfiable"
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
-
}
|
|
116
|
+
};
|
|
117
117
|
|
|
118
118
|
class RangeRequestsPlugin {
|
|
119
119
|
cachedResponseWillBeUsed = async ({ request, cachedResponse })=>{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serwist/range-requests",
|
|
3
|
-
"version": "9.0.0-preview.
|
|
3
|
+
"version": "9.0.0-preview.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "This library creates a new Response, given a source Response and a Range header value.",
|
|
6
6
|
"files": [
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"./package.json": "./package.json"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@serwist/core": "9.0.0-preview.
|
|
36
|
+
"@serwist/core": "9.0.0-preview.15"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"rollup": "4.
|
|
40
|
-
"typescript": "5.5.0-dev.
|
|
41
|
-
"@serwist/constants": "9.0.0-preview.
|
|
39
|
+
"rollup": "4.13.0",
|
|
40
|
+
"typescript": "5.5.0-dev.20240323",
|
|
41
|
+
"@serwist/constants": "9.0.0-preview.15"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"typescript": ">=5.0.0"
|
|
@@ -27,7 +27,7 @@ import { parseRangeHeader } from "./utils/parseRangeHeader.js";
|
|
|
27
27
|
* `Range:` header, or a `416 Range Not Satisfiable` response if the
|
|
28
28
|
* conditions of the `Range:` header can't be met.
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
export const createPartialResponse = async (request: Request, originalResponse: Response): Promise<Response> => {
|
|
31
31
|
try {
|
|
32
32
|
if (process.env.NODE_ENV !== "production") {
|
|
33
33
|
assert!.isInstance(request, Request, {
|
|
@@ -89,6 +89,4 @@ async function createPartialResponse(request: Request, originalResponse: Respons
|
|
|
89
89
|
statusText: "Range Not Satisfiable",
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export { createPartialResponse };
|
|
92
|
+
};
|