summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2022-01-02 02:11:35 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2022-01-02 02:11:35 +0900
commitf3640add23986bcb92fd810e55f23da6f4d57150 (patch)
tree4c8beb0dc3f252b47daa9e76eb6a5397f12eebc4 /src
parentimprove test (diff)
downloadmisskey-f3640add23986bcb92fd810e55f23da6f4d57150.tar.gz
misskey-f3640add23986bcb92fd810e55f23da6f4d57150.tar.bz2
misskey-f3640add23986bcb92fd810e55f23da6f4d57150.zip
fix streaming query bug
Diffstat (limited to 'src')
-rw-r--r--src/streaming.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/streaming.ts b/src/streaming.ts
index 341bfe4ab9..0f41bddd40 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, unknown>): string {
+export function urlQuery(obj: Record<string, string | number | boolean | undefined>): 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<string, unknown>);
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+ .reduce((a, [k, v]) => (a[k] = v!, a), {} as Record<string, string | number | boolean>);
return Object.entries(params)
- .map((e) => `${e[0]}=${e[1]}`)
.map((e) => `${e[0]}=${encodeURIComponent(e[1])}`)
.join('&');
}