Skip to content

Commit

Permalink
use nullish coalescing
Browse files Browse the repository at this point in the history
Co-authored-by: Kuuuube <61125188+Kuuuube@users.noreply.github.com>
Signed-off-by: Cashew <52880648+Casheeew@users.noreply.github.com>
  • Loading branch information
Casheeew and Kuuuube authored Sep 18, 2024
1 parent 23e58cc commit e60e8eb
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ext/js/language/ja/shinjitai-converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,6 @@ const regex = new RegExp('[' + regexString + ']', 'g');
*/
export function convertShinjitai(str) {
return str.replace(regex, (c) => {
const shinji = shinjitaiMap.get(c);
if (typeof shinji !== 'undefined') { return shinji; }
return c;
return shinjitaiMap.get(c) ?? c;
});
}

0 comments on commit e60e8eb

Please sign in to comment.