Skip to content

Commit e7a90e9

Browse files
committed
clean up
1 parent 597cc66 commit e7a90e9

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

packages/nextjs-cache-handler/src/helpers/ioredisAdapter.ts

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,19 @@ export function ioredisAdapter(client: Redis): RedisClientType {
4545
if (prop === "hDel") {
4646
return async (key: string, fields: string | string[]) => {
4747
const args = Array.isArray(fields) ? fields : [fields];
48-
if (args.length === 0) return 0;
48+
if (args.length === 0) {
49+
return 0;
50+
}
4951
return target.hdel(key, ...args);
5052
};
5153
}
5254

5355
if (prop === "unlink") {
5456
return async (keys: string | string[]) => {
5557
const args = Array.isArray(keys) ? keys : [keys];
56-
if (args.length === 0) return 0;
58+
if (args.length === 0) {
59+
return 0;
60+
}
5761
return target.unlink(...args);
5862
};
5963
}
@@ -93,21 +97,29 @@ export function ioredisAdapter(client: Redis): RedisClientType {
9397
if (prop === "hmGet") {
9498
return async (key: string, fields: string | string[]) => {
9599
const args = Array.isArray(fields) ? fields : [fields];
96-
if (args.length === 0) return [];
100+
if (args.length === 0) {
101+
return [];
102+
}
97103
return target.hmget(key, ...args);
98104
};
99105
}
100106

101107
// Handle camelCase to lowercase mapping for other methods
102108
if (typeof prop === "string") {
103109
// Special case for expireAt -> expireat
104-
if (prop === "expireAt") return target.expireat.bind(target);
110+
if (prop === "expireAt") {
111+
return target.expireat.bind(target);
112+
}
105113

106114
// hSet -> hset
107-
if (prop === "hSet") return target.hset.bind(target);
115+
if (prop === "hSet") {
116+
return target.hset.bind(target);
117+
}
108118

109119
// hExists -> hexists
110-
if (prop === "hExists") return target.hexists.bind(target);
120+
if (prop === "hExists") {
121+
return target.hexists.bind(target);
122+
}
111123

112124
// Default fallback to lowercase if exists
113125
const lowerProp = prop.toLowerCase();

0 commit comments

Comments
 (0)