From 0e37cd2bc696cec4ca62f0c2678a575e9117b7f3 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Fri, 6 Sep 2024 17:17:56 +0900 Subject: [PATCH] use node util isDeepStrictEqual --- packages/backend/src/server/api/endpoints/i/update.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/i/update.ts b/packages/backend/src/server/api/endpoints/i/update.ts index b03528289d..05d5956465 100644 --- a/packages/backend/src/server/api/endpoints/i/update.ts +++ b/packages/backend/src/server/api/endpoints/i/update.ts @@ -3,6 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import { isDeepStrictEqual } from 'node:util'; import RE2 from 're2'; import * as mfm from 'mfm-js'; import { Inject, Injectable } from '@nestjs/common'; @@ -479,14 +480,14 @@ export default class extends Endpoint { // eslint- //#region 変更されていないプロパティを削除 const _updates = getObjKeys(updates).reduce>((acc, key) => { - if (updates[key] !== undefined && updates[key] !== user[key]) { + if (updates[key] !== undefined && !isDeepStrictEqual(updates[key], user[key])) { (acc[key] as MiUser[typeof key]) = updates[key]; } return acc; }, {}); const _profileUpdates = getObjKeys(profileUpdates).reduce>((acc, key) => { - if (profileUpdates[key] !== undefined && profileUpdates[key] !== profile[key]) { + if (profileUpdates[key] !== undefined && !isDeepStrictEqual(profileUpdates[key], profile[key])) { (acc[key] as MiUserProfile[typeof key]) = profileUpdates[key]; } return acc;