From 5f11790f6bd9b624f41be501e56c2afaca2aca0a Mon Sep 17 00:00:00 2001
From: RMidhunSuresh <hi@midhun.dev>
Date: Tue, 1 Feb 2022 17:51:37 +0530
Subject: [PATCH] Object.assign is overkill here

---
 src/matrix/net/HomeServerApi.ts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/matrix/net/HomeServerApi.ts b/src/matrix/net/HomeServerApi.ts
index e5071b87..7f7dd16c 100644
--- a/src/matrix/net/HomeServerApi.ts
+++ b/src/matrix/net/HomeServerApi.ts
@@ -158,7 +158,7 @@ export class HomeServerApi {
 
     register(username: string | null, password: string, initialDeviceDisplayName: string, auth?: Record<string, any>, inhibitLogin: boolean = true , options: IRequestOptions = {}): IHomeServerRequest {
         Object.assign(options, { allowedErrors: [401] });
-        const body = {
+        const body: any = {
             auth,
             password,
             initial_device_displayname: initialDeviceDisplayName,
@@ -166,7 +166,7 @@ export class HomeServerApi {
         };
         if (username) {
             // username is optional for registration
-            Object.assign(body, { username });
+            body.username = username;
         }
         return this._unauthedRequest( "POST", this._url("/register", CS_V3_PREFIX), undefined, body, options);
     }