Skip to content

Commit 4ac97ee

Browse files
soccermaxMax Gruenfelderleibale
authored
fix createCluster - copy options.defaults.socket before modifying it (#2783)
* shallow copy of this.#options.defaults.socket * shallow copy of this.#options.defaults.socket * nit --------- Co-authored-by: Max Gruenfelder <[email protected]> Co-authored-by: Leibale Eidelman <[email protected]>
1 parent d5355d4 commit 4ac97ee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/client/lib/cluster/cluster-slots.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,10 @@ export default class RedisClusterSlots<
269269
if (this.#options.defaults) {
270270
let socket;
271271
if (this.#options.defaults.socket) {
272-
socket = options?.socket ? {
272+
socket = {
273273
...this.#options.defaults.socket,
274-
...options.socket
275-
} : this.#options.defaults.socket;
274+
...options?.socket
275+
};
276276
} else {
277277
socket = options?.socket;
278278
}

0 commit comments

Comments
 (0)