Skip to content
Snippets Groups Projects
Forked from TransFem.org / Sharkey
Source project has a limited visibility.
  • okayurisotto's avatar
    refactor(backend): `ReactionService.prototype.convertLegacyReactions` (#13375) · 750d2626
    okayurisotto authored
    * add unit tests
    
    * cleanup unnecessary type assertions
    
    * `convertedReaction`変数の定義と変換表に対する存在確認処理の整理
    
    * `count`変数の定義とループ処理での`Object.entries()`の活用
    
    * 条件式の整理
    
    * `Array.prototype.reduce`を使うように
    
    * `Array.prototype.reduce`を使うように
    
    * 配列操作を1つのメソッドチェーンに整理
    
    これまでの実装では、`decodeReaction`の返り値が同一になる異なる入力値が同時に複数個存在した場合、後ろのもので上書きされてしまっていたはず。
    これからの実装では、後ろのものは前のものに加算される。
    (実際にこの挙動の変更が問題になるシチュエーションはまずないはず。)
    
    * add unit test
    
    * ドキュメントコメントの追加と型定義の調整
    Unverified
    750d2626
Code owners
Assign users and groups as approvers for specific file changes. Learn more.