diff --git a/packages/core/js-client/src/network.ts b/packages/core/js-client/src/network.ts index 42c74f73..ff5c8c5e 100644 --- a/packages/core/js-client/src/network.ts +++ b/packages/core/js-client/src/network.ts @@ -165,21 +165,23 @@ export const kras: Relay[] = [ }, ]; -export const randomKras = () => { +export const randomKras = (): Relay => { return randomItem(kras); }; -export const randomTestNet = () => { +export const randomTestNet = (): Relay => { return randomItem(testNet); }; -export const randomStage = () => { +export const randomStage = (): Relay => { return randomItem(stage); }; -function randomItem(arr: Relay[]) { +function randomItem(arr: Relay[]): Relay { const index = randomInt(0, arr.length); - return arr[index]; + // This array access always defined + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions + return arr[index] as Relay; } function randomInt(min: number, max: number) {