weifuwu 0.2.0 → 0.2.1

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.
package/compress.ts CHANGED
@@ -60,7 +60,7 @@ export function compress(options?: CompressOptions): Middleware {
60
60
  headers.delete('Content-Range')
61
61
  headers.set('Vary', 'Accept-Encoding')
62
62
 
63
- return new Response(compressed, {
63
+ return new Response(compressed as BodyInit, {
64
64
  status: res.status,
65
65
  statusText: res.statusText,
66
66
  headers,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weifuwu",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Web-standard HTTP framework for Node.js — (req, ctx) => Response",
5
5
  "main": "index.ts",
6
6
  "scripts": {
package/serve.ts CHANGED
@@ -39,7 +39,7 @@ export function createRequest(req: IncomingMessage, body: Buffer): [Request, Rec
39
39
  method: req.method?.toUpperCase() ?? 'GET',
40
40
  headers,
41
41
  body: (req.method !== 'GET' && req.method !== 'HEAD' && body.length > 0)
42
- ? body
42
+ ? body as BodyInit
43
43
  : null,
44
44
  })
45
45
 
package/static.ts CHANGED
@@ -73,7 +73,7 @@ export function serveStatic(root: string, options?: ServeStaticOptions): Handler
73
73
  }
74
74
 
75
75
  const stream = fileHandle.readableWebStream()
76
- return new Response(stream, { headers })
76
+ return new Response(stream as unknown as BodyInit, { headers })
77
77
  } catch (err) {
78
78
  if (fileHandle) await fileHandle.close().catch(() => {})
79
79
  if ((err as NodeJS.ErrnoException)?.code === 'ENOENT') {