From 76181385d2a8397c7df68c93f6ce9e5c293fc6b3 Mon Sep 17 00:00:00 2001 From: Kisaragi <48310258+KisaragiEffective@users.noreply.github.com> Date: Sun, 14 Jul 2024 15:52:43 +0900 Subject: [PATCH] refactor(misskey-js): enable exactOptionalPropertyTypes (#14203) * refactor(misskey-js): enable exactOptionalPropertyTypes * refactor(misskey-js): fix error where is appeared by enabling --- packages/misskey-js/src/streaming.ts | 4 +++- packages/misskey-js/tsconfig.json | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/misskey-js/src/streaming.ts b/packages/misskey-js/src/streaming.ts index 0f26857782..83930e621c 100644 --- a/packages/misskey-js/src/streaming.ts +++ b/packages/misskey-js/src/streaming.ts @@ -291,7 +291,9 @@ export abstract class Connection = any> extends this.stream = stream; this.channel = channel; - this.name = name; + if (name !== undefined) { + this.name = name; + } } public send(type: T, body: Channel['receives'][T]): void { diff --git a/packages/misskey-js/tsconfig.json b/packages/misskey-js/tsconfig.json index 6e34e332e0..f7bbc47304 100644 --- a/packages/misskey-js/tsconfig.json +++ b/packages/misskey-js/tsconfig.json @@ -15,6 +15,7 @@ "experimentalDecorators": true, "noImplicitReturns": true, "esModuleInterop": true, + "exactOptionalPropertyTypes": true, "typeRoots": [ "./node_modules/@types" ],