UNPKG

kitejs

Version:

the rpc framework Kite for Node.js

12 lines (9 loc) 251 B
/** * @author xiangshouding */ import {Map} from '../types/lang'; import {Address} from '../protocol/protocol'; export function random(hosts: Array<Address>) { let len = hosts.length; return hosts[Math.floor(Math.random() * len)]; }