Skip to content

Commit 465911e

Browse files
authored
cleanup
1 parent 8e7f11c commit 465911e

File tree

7 files changed

+26
-35
lines changed

7 files changed

+26
-35
lines changed

packages/bloom/lib/commands/bloom/INFO.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ export default {
2323
return ['BF.INFO', key];
2424
},
2525
transformReply: {
26-
2: (reply: UnwrapReply<Resp2Reply<BfInfoReplyMap>>): BfInfoReply => {
26+
2(reply: UnwrapReply<Resp2Reply<BfInfoReplyMap>>): BfInfoReply {
2727
return {
2828
capacity: reply[1],
2929
size: reply[3],
3030
numberOfFilters: reply[5],
3131
numberOfInsertedItems: reply[7],
3232
expansionRate: reply[9]
33-
}
33+
};
3434
},
35-
3: (reply: UnwrapReply<BfInfoReplyMap>): BfInfoReply => {
35+
3(reply: UnwrapReply<BfInfoReplyMap>): BfInfoReply {
3636
if (reply instanceof Map) {
3737
throw new Error("BF.INFO shouldn't be used with type mapping to map or array");
3838
/*
@@ -62,8 +62,8 @@ export default {
6262
numberOfFilters: reply["Number of filters"],
6363
numberOfInsertedItems: reply["Number of items inserted"],
6464
expansionRate: reply["Expansion rate"]
65-
}
65+
};
6666
}
67-
},
68-
},
67+
}
68+
}
6969
} as const satisfies Command;

packages/bloom/lib/commands/count-min-sketch/INFO.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ export default {
1919
return ['CMS.INFO', key];
2020
},
2121
transformReply: {
22-
2: (reply: UnwrapReply<Resp2Reply<CmsInfoReplyMap>>): CmsInfoReply => {
22+
2(reply: UnwrapReply<Resp2Reply<CmsInfoReplyMap>>): CmsInfoReply {
2323
return {
2424
width: reply[1],
2525
depth: reply[3],
2626
count: reply[5]
27-
}
27+
};
2828
},
29-
3: (reply: UnwrapReply<CmsInfoReplyMap>): CmsInfoReply => {
29+
3(reply: UnwrapReply<CmsInfoReplyMap>): CmsInfoReply {
3030
if (reply instanceof Map) {
3131
throw new Error("CMS.INFO shouldn't be used with type mapping to map or array");
3232
/*
@@ -50,8 +50,8 @@ export default {
5050
width: reply['width'],
5151
depth: reply['depth'],
5252
count: reply['count']
53-
}
53+
};
5454
}
5555
}
56-
},
56+
}
5757
} as const satisfies Command;

packages/bloom/lib/commands/cuckoo/INFO.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ export default {
2828
transformArguments(key: RedisArgument) {
2929
return ['CF.INFO', key];
3030
},
31-
3231
transformReply: {
33-
2: (reply: UnwrapReply<Resp2Reply<CfInfoReplyMap>>): CfInfoReply => {
32+
2(reply: UnwrapReply<Resp2Reply<CfInfoReplyMap>>): CfInfoReply {
3433
return {
3534
size: reply[1],
3635
numberOfBuckets: reply[3],
@@ -40,7 +39,7 @@ export default {
4039
bucketSize: reply[11],
4140
expansionRate: reply[13],
4241
maxIteration: reply[15]
43-
}
42+
};
4443
},
4544
3: (reply: UnwrapReply<CfInfoReplyMap>): CfInfoReply => {
4645
if (reply instanceof Map) {
@@ -81,8 +80,8 @@ export default {
8180
bucketSize: reply['Bucket size'],
8281
expansionRate: reply['Expansion rate'],
8382
maxIteration: reply['Max iterations']
84-
}
83+
};
8584
}
8685
}
87-
},
86+
}
8887
} as const satisfies Command;

packages/bloom/lib/commands/t-digest/INFO.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export interface TdInfoReply {
2121
unmergedWeight?: NumberReply;
2222
observations?: NumberReply,
2323
totalCompression?: NumberReply;
24-
memoryUsage?: NumberReply
24+
memoryUsage?: NumberReply;
2525
}
2626

2727
export default {
@@ -31,7 +31,7 @@ export default {
3131
return ['TDIGEST.INFO', key];
3232
},
3333
transformReply: {
34-
2: (reply: UnwrapReply<Resp2Reply<TdInfoReplyMap>>): TdInfoReply => {
34+
2(reply: UnwrapReply<Resp2Reply<TdInfoReplyMap>>): TdInfoReply {
3535
return {
3636
compression: reply[1],
3737
capacity: reply[3],
@@ -44,7 +44,7 @@ export default {
4444
memoryUsage: reply[17]
4545
};
4646
},
47-
3: (reply: UnwrapReply<TdInfoReplyMap>): TdInfoReply => {
47+
3(reply: UnwrapReply<TdInfoReplyMap>): TdInfoReply {
4848
if (reply instanceof Map) {
4949
throw new Error("TDIGEST.INFO shouldn't be used with type mapping to map or array");
5050
/*
@@ -89,5 +89,5 @@ export default {
8989
};
9090
}
9191
}
92-
},
92+
}
9393
} as const satisfies Command;

packages/bloom/lib/commands/top-k/INFO.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ export type TopKInfoReplyMap = TuplesToMapReply<[
88
]>;
99

1010
export type TkInfoReply = {
11-
k: NumberReply,
12-
width: NumberReply,
13-
depth: NumberReply,
14-
decay: number,
11+
k: NumberReply;
12+
width: NumberReply;
13+
depth: NumberReply;
14+
decay: number;
1515
}
1616

1717
export default {
@@ -27,7 +27,7 @@ export default {
2727
width: reply[3],
2828
depth: reply[5],
2929
decay: Number(reply[7])
30-
}
30+
};
3131
},
3232
3: (reply: UnwrapReply<TopKInfoReplyMap>): TkInfoReply => {
3333
if (reply instanceof Map) {

packages/client/lib/client/index.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ export default class RedisClient<
153153
const transformReply = getTransformReply(command, resp);
154154
return async function (this: ProxyClient, ...args: Array<unknown>) {
155155
const redisArgs = command.transformArguments(...args);
156-
157156
const reply = await this.sendCommand(redisArgs, this._commandOptions);
158157
return transformReply ?
159158
transformReply(reply, redisArgs.preserve) :
@@ -165,7 +164,6 @@ export default class RedisClient<
165164
const transformReply = getTransformReply(command, resp);
166165
return async function (this: NamespaceProxyClient, ...args: Array<unknown>) {
167166
const redisArgs = command.transformArguments(...args);
168-
169167
const reply = await this._self.sendCommand(redisArgs, this._self._commandOptions);
170168
return transformReply ?
171169
transformReply(reply, redisArgs.preserve) :
@@ -178,7 +176,6 @@ export default class RedisClient<
178176
transformReply = getTransformReply(fn, resp);
179177
return async function (this: NamespaceProxyClient, ...args: Array<unknown>) {
180178
const fnArgs = fn.transformArguments(...args);
181-
182179
const reply = await this._self.sendCommand(
183180
prefix.concat(fnArgs),
184181
this._self._commandOptions
@@ -194,9 +191,8 @@ export default class RedisClient<
194191
transformReply = getTransformReply(script, resp);
195192
return async function (this: ProxyClient, ...args: Array<unknown>) {
196193
const scriptArgs = script.transformArguments(...args);
197-
const redisArgs = prefix.concat(scriptArgs)
198-
199-
const reply = await this.executeScript(script, redisArgs, this._self._commandOptions);
194+
const redisArgs = prefix.concat(scriptArgs);
195+
const reply = await this.executeScript(script, redisArgs, this._commandOptions);
200196
return transformReply ?
201197
transformReply(reply, scriptArgs.preserve) :
202198
reply;

packages/client/lib/client/pool.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ export class RedisClientPool<
6666
const transformReply = getTransformReply(command, resp);
6767
return async function (this: ProxyPool, ...args: Array<unknown>) {
6868
const redisArgs = command.transformArguments(...args);
69-
7069
const reply = await this.sendCommand(redisArgs, this._commandOptions);
7170
return transformReply ?
7271
transformReply(reply, redisArgs.preserve) :
@@ -78,7 +77,6 @@ export class RedisClientPool<
7877
const transformReply = getTransformReply(command, resp);
7978
return async function (this: NamespaceProxyPool, ...args: Array<unknown>) {
8079
const redisArgs = command.transformArguments(...args);
81-
8280
const reply = await this._self.sendCommand(redisArgs, this._self._commandOptions);
8381
return transformReply ?
8482
transformReply(reply, redisArgs.preserve) :
@@ -91,7 +89,6 @@ export class RedisClientPool<
9189
transformReply = getTransformReply(fn, resp);
9290
return async function (this: NamespaceProxyPool, ...args: Array<unknown>) {
9391
const fnArgs = fn.transformArguments(...args);
94-
9592
const reply = await this._self.sendCommand(
9693
prefix.concat(fnArgs),
9794
this._self._commandOptions
@@ -108,7 +105,6 @@ export class RedisClientPool<
108105
return async function (this: ProxyPool, ...args: Array<unknown>) {
109106
const scriptArgs = script.transformArguments(...args);
110107
const redisArgs = prefix.concat(scriptArgs);
111-
112108
const reply = await this.executeScript(script, redisArgs, this._commandOptions);
113109
return transformReply ?
114110
transformReply(reply, scriptArgs.preserve) :

0 commit comments

Comments
 (0)