diff options
author | Alex Yatskov <alex@foosoft.net> | 2019-09-05 20:21:07 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2019-09-05 20:21:07 -0700 |
commit | cfc6363a01ee00e89866c54709006d6f55d093de (patch) | |
tree | a03b1f79ba220e93c248ad8284fb01dc95b676a9 /ext/bg/js/dictionary.js | |
parent | 5347da528bd07166b4686f45440d80a77f4888a3 (diff) | |
parent | c53263158b22f4be8e54696c4675f360f1813de8 (diff) |
Merge branch 'master' into testing
Diffstat (limited to 'ext/bg/js/dictionary.js')
-rw-r--r-- | ext/bg/js/dictionary.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/ext/bg/js/dictionary.js b/ext/bg/js/dictionary.js index 49afc368..498eafcd 100644 --- a/ext/bg/js/dictionary.js +++ b/ext/bg/js/dictionary.js @@ -140,16 +140,17 @@ function dictTermsCompressTags(definitions) { function dictTermsGroup(definitions, dictionaries) { const groups = {}; for (const definition of definitions) { - const key = [definition.source, definition.expression].concat(definition.reasons); + const key = [definition.source, definition.expression]; + key.push(...definition.reasons); if (definition.reading) { key.push(definition.reading); } - const group = groups[key]; - if (group) { - group.push(definition); + const keyString = key.toString(); + if (groups.hasOwnProperty(keyString)) { + groups[keyString].push(definition); } else { - groups[key] = [definition]; + groups[keyString] = [definition]; } } |