aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed/js/dictionary-data-util.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-11-01 21:24:35 -0500
committerGitHub <noreply@github.com>2020-11-01 21:24:35 -0500
commita8ff38eec31c1055f88f45ea303fe3ae66d43f10 (patch)
treeaa4b905ca588345d719d6c7715a489cb6c64ec3e /ext/mixed/js/dictionary-data-util.js
parent8ffae565c6feac1c898d8f02f47fe0362cc458e8 (diff)
Fix display issues (#984)
* Remove unused function * Update expresionMulti detection * Simplify kanji early escape * Simplify frequency/pitch data creation * Update implementation of _buildTermMeta * Update how pitch accents sources are collected * Remove old _buildTermMeta
Diffstat (limited to 'ext/mixed/js/dictionary-data-util.js')
-rw-r--r--ext/mixed/js/dictionary-data-util.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/ext/mixed/js/dictionary-data-util.js b/ext/mixed/js/dictionary-data-util.js
index 72c28172..709f4ead 100644
--- a/ext/mixed/js/dictionary-data-util.js
+++ b/ext/mixed/js/dictionary-data-util.js
@@ -17,16 +17,13 @@
class DictionaryDataUtil {
static getPitchAccentInfos(definition) {
- if (typeof definition.character === 'string') {
- // Kanji
- return [];
- }
+ const {type} = definition;
+ if (type === 'kanji') { return []; }
const results = new Map();
const allExpressions = new Set();
const allReadings = new Set();
- const expressions = definition.expressions;
- const sources = Array.isArray(expressions) ? expressions : [definition];
+ const sources = [definition];
for (const {pitches: expressionPitches, expression} of sources) {
allExpressions.add(expression);