(self: HashRing<A>, input: string)
| 296 | * @since 3.19.0 |
| 297 | */ |
| 298 | export const get = <A extends PrimaryKey.PrimaryKey>(self: HashRing<A>, input: string): A | undefined => { |
| 299 | if (self.ring.length === 0) { |
| 300 | return undefined |
| 301 | } |
| 302 | const index = getIndexForInput(self, Hash.string(input))[0] |
| 303 | const node = self.ring[index][1]! |
| 304 | return self.nodes.get(node)![0] |
| 305 | } |
| 306 | |
| 307 | /** |
| 308 | * Computes a balanced shard distribution across the nodes in the ring. |
nothing calls this directly
no test coverage detected