diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-11-29 13:09:02 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-29 13:09:02 -0500 |
commit | 34451ebf7122a2a5d140696215411abfb0dfe188 (patch) | |
tree | e9eddb52f133269853059372045dea510e8d02dc /ext/bg/js/audio-downloader.js | |
parent | a8cd03cbecf4015483ce3479e589e65ce7eece45 (diff) |
JapaneseUtil normalization (#1076)
* Use JapaneseUtil as a class which is manually instantiated
* Use alias function for toKana
Diffstat (limited to 'ext/bg/js/audio-downloader.js')
-rw-r--r-- | ext/bg/js/audio-downloader.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/bg/js/audio-downloader.js b/ext/bg/js/audio-downloader.js index 8dd5d10f..1a3428e1 100644 --- a/ext/bg/js/audio-downloader.js +++ b/ext/bg/js/audio-downloader.js @@ -17,11 +17,11 @@ /* global * SimpleDOMParser - * jp */ class AudioDownloader { - constructor({requestBuilder}) { + constructor({japaneseUtil, requestBuilder}) { + this._japaneseUtil = japaneseUtil; this._requestBuilder = requestBuilder; this._getInfoHandlers = new Map([ ['jpod101', this._getInfoJpod101.bind(this)], @@ -89,7 +89,7 @@ class AudioDownloader { let kana = reading; let kanji = expression; - if (!kana && jp.isStringEntirelyKana(kanji)) { + if (!kana && this._japaneseUtil.isStringEntirelyKana(kanji)) { kana = kanji; kanji = null; } |