diff --git a/src/streaming.ts b/src/streaming.ts index 341bfe4ab..0f41bddd4 100644 --- a/src/streaming.ts +++ b/src/streaming.ts @@ -3,13 +3,13 @@ import { EventEmitter } from 'eventemitter3'; import ReconnectingWebsocket from 'reconnecting-websocket'; import { BroadcastEvents, Channels } from './streaming.types'; -export function urlQuery(obj: Record): string { +export function urlQuery(obj: Record): string { const params = Object.entries(obj) .filter(([, v]) => Array.isArray(v) ? v.length : v !== undefined) - .reduce((a, [k, v]) => (a[k] = v, a), {} as Record); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + .reduce((a, [k, v]) => (a[k] = v!, a), {} as Record); return Object.entries(params) - .map((e) => `${e[0]}=${e[1]}`) .map((e) => `${e[0]}=${encodeURIComponent(e[1])}`) .join('&'); }