@stacksjs/bun-router 0.1.8 → 0.1.9

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.
@@ -32,9 +32,10 @@ export interface RateLimitOptions {
32
32
  };
33
33
  }
34
34
  export default class RateLimit implements Middleware {
35
- private limiter;
35
+ private limiterPromise?;
36
36
  private options;
37
37
  constructor(options?: RateLimitOptions);
38
+ private getLimiter;
38
39
  private initLimiter;
39
40
  private defaultHandler;
40
41
  handle(req: EnhancedRequest, next: NextFunction): Promise<Response>;
@@ -84,6 +84,12 @@ export declare function shouldCompress(response: Response, encoding: string | nu
84
84
  * Returns the response it was given when it is not, so a caller can apply this
85
85
  * unconditionally at the end of the pipeline.
86
86
  */
87
+ export declare function applyResponseCompression(response: Response, request: Request, options?: CompressionOptions): Response | Promise<Response>;
88
+ /**
89
+ * Preserve the original Promise-only public contract for direct callers.
90
+ * The server uses `applyResponseCompression` so the usual uncompressed and
91
+ * known-length paths do not create a second promise per request.
92
+ */
87
93
  export declare function compressResponse(response: Response, request: Request, options?: CompressionOptions): Promise<Response>;
88
94
  /**
89
95
  * Read up to `limit` bytes, and hand back a stream that still has them.
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@stacksjs/bun-router",
3
3
  "type": "module",
4
- "version": "0.1.8",
4
+ "version": "0.1.9",
5
5
  "description": "A fast, type-safe router for Bun.",
6
- "author": "Chris Breuer <chris@stacksjs.org>",
6
+ "author": "Chris Breuer <chris@stacksjs.com>",
7
7
  "license": "MIT",
8
8
  "homepage": "https://github.com/stacksjs/bun-router#readme",
9
9
  "repository": {