forked from shrimpia/misskey
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(backend):
ReactionService.prototype.convertLegacyReactions
(…
…misskey-dev#13375) * add unit tests * cleanup unnecessary type assertions * `convertedReaction`変数の定義と変換表に対する存在確認処理の整理 * `count`変数の定義とループ処理での`Object.entries()`の活用 * 条件式の整理 * `Array.prototype.reduce`を使うように * `Array.prototype.reduce`を使うように * 配列操作を1つのメソッドチェーンに整理 これまでの実装では、`decodeReaction`の返り値が同一になる異なる入力値が同時に複数個存在した場合、後ろのもので上書きされてしまっていたはず。 これからの実装では、後ろのものは前のものに加算される。 (実際にこの挙動の変更が問題になるシチュエーションはまずないはず。) * add unit test * ドキュメントコメントの追加と型定義の調整
- Loading branch information
1 parent
d95f7bc
commit 9221e0d
Showing
2 changed files
with
66 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters