1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00

More fixes for socket issue (#2710)

* more typing fixes

* try to redo typing a bit and genericize to make better

* use genericized cluster options for cluster as well
This commit is contained in:
Shaya Potter
2024-02-21 10:29:24 +02:00
committed by GitHub
parent 7e27f72f72
commit 3e167912fb
6 changed files with 48 additions and 32 deletions

View File

@@ -1,5 +1,5 @@
import { Command, RedisFunction, RedisScript, RespVersions } from '../RESP/types';
import { RedisSocketOptions } from '../client/socket';
import { RedisSocketOptions, RedisTcpSocketOptions } from '../client/socket';
import { functionArgumentsPrefix, getTransformReply, scriptArgumentsPrefix } from '../commander';
import { NamespaceProxySentinel, NamespaceProxySentinelClient, NodeInfo, ProxySentinel, ProxySentinelClient, RedisNode } from './types';
@@ -27,9 +27,11 @@ export function createNodeList(nodes: Array<NodeInfo>) {
}
export function clientSocketToNode(socket: RedisSocketOptions): RedisNode {
const s = socket as RedisTcpSocketOptions;
return {
host: socket.host!,
port: socket.port!
host: s.host!,
port: s.port!
}
}