@naman_deep_singh/cache 1.3.1 → 1.3.2

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @naman_deep_singh/cache
2
2
 
3
- **Version:** 1.3.1 (with Redis Clustering support)
3
+ **Version:** 1.3.2 (with Redis Clustering support)
4
4
 
5
5
  A flexible, extensible caching layer with support for Redis, Memcache, and in-memory caches. Includes session management, health checks, and Express middleware.
6
6
 
@@ -7,7 +7,7 @@ import type { SessionStore } from '../../session/SessionStore';
7
7
  export declare function cacheSessionMiddleware(sessionStore: SessionStore, options?: {
8
8
  sessionIdHeader?: string;
9
9
  sessionDataKey?: string;
10
- }): (req: Request, res: Response, next: NextFunction) => Promise<void>;
10
+ }): (req: Request, _res: Response, next: NextFunction) => Promise<void>;
11
11
  /**
12
12
  * Express middleware for cache health check
13
13
  */
@@ -9,7 +9,7 @@ exports.cacheResponseMiddleware = cacheResponseMiddleware;
9
9
  function cacheSessionMiddleware(sessionStore, options) {
10
10
  const sessionIdHeader = options?.sessionIdHeader ?? 'x-session-id';
11
11
  const sessionDataKey = options?.sessionDataKey ?? 'session';
12
- return async (req, res, next) => {
12
+ return async (req, _res, next) => {
13
13
  try {
14
14
  // Get session ID from header or cookie
15
15
  const sessionId = req.get(sessionIdHeader) || req.cookies?.[sessionIdHeader];
@@ -93,7 +93,7 @@ function cacheResponseMiddleware(cache, options) {
93
93
  try {
94
94
  responseData = JSON.stringify(data);
95
95
  }
96
- catch (e) {
96
+ catch (_e) {
97
97
  responseData = null;
98
98
  }
99
99
  }
@@ -7,7 +7,7 @@ import type { SessionStore } from '../../session/SessionStore';
7
7
  export declare function cacheSessionMiddleware(sessionStore: SessionStore, options?: {
8
8
  sessionIdHeader?: string;
9
9
  sessionDataKey?: string;
10
- }): (req: Request, res: Response, next: NextFunction) => Promise<void>;
10
+ }): (req: Request, _res: Response, next: NextFunction) => Promise<void>;
11
11
  /**
12
12
  * Express middleware for cache health check
13
13
  */
@@ -4,7 +4,7 @@
4
4
  export function cacheSessionMiddleware(sessionStore, options) {
5
5
  const sessionIdHeader = options?.sessionIdHeader ?? 'x-session-id';
6
6
  const sessionDataKey = options?.sessionDataKey ?? 'session';
7
- return async (req, res, next) => {
7
+ return async (req, _res, next) => {
8
8
  try {
9
9
  // Get session ID from header or cookie
10
10
  const sessionId = req.get(sessionIdHeader) || req.cookies?.[sessionIdHeader];
@@ -88,7 +88,7 @@ export function cacheResponseMiddleware(cache, options) {
88
88
  try {
89
89
  responseData = JSON.stringify(data);
90
90
  }
91
- catch (e) {
91
+ catch (_e) {
92
92
  responseData = null;
93
93
  }
94
94
  }
@@ -7,7 +7,7 @@ import type { SessionStore } from '../../session/SessionStore';
7
7
  export declare function cacheSessionMiddleware(sessionStore: SessionStore, options?: {
8
8
  sessionIdHeader?: string;
9
9
  sessionDataKey?: string;
10
- }): (req: Request, res: Response, next: NextFunction) => Promise<void>;
10
+ }): (req: Request, _res: Response, next: NextFunction) => Promise<void>;
11
11
  /**
12
12
  * Express middleware for cache health check
13
13
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naman_deep_singh/cache",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "Extensible caching layer supporting Redis, Memcache, and in-memory caches with automatic fallback, namespacing, session management, and Express middleware.",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",