summaryrefslogtreecommitdiff
path: root/ext/js/display/display-generator.js
diff options
context:
space:
mode:
authorCashew <52880648+Scrub1492@users.noreply.github.com>2023-12-27 13:41:35 +0700
committerGitHub <noreply@github.com>2023-12-27 06:41:35 +0000
commit860374fdab25fce3161ee835be0e141a341b9b9b (patch)
tree9a2612f719a46f7af29899da916b62c7724fea7e /ext/js/display/display-generator.js
parent0094ff7babab6839ccef4c82fa46b8aa4f14198f (diff)
switch updates (#459)
* switch updates * revert to if-else * revert to if-else * remove empty default
Diffstat (limited to 'ext/js/display/display-generator.js')
-rw-r--r--ext/js/display/display-generator.js21
1 files changed, 13 insertions, 8 deletions
diff --git a/ext/js/display/display-generator.js b/ext/js/display/display-generator.js
index 920d2c94..b91d0ce9 100644
--- a/ext/js/display/display-generator.js
+++ b/ext/js/display/display-generator.js
@@ -401,14 +401,19 @@ export class DisplayGenerator {
* @returns {?HTMLElement}
*/
_createTermDefinitionEntry(entry, dictionary) {
- if (typeof entry === 'string') {
- return this._createTermDefinitionEntryText(entry);
- } else if (typeof entry === 'object' && entry !== null) {
- switch (entry.type) {
- case 'image':
- return this._createTermDefinitionEntryImage(entry, dictionary);
- case 'structured-content':
- return this._createTermDefinitionEntryStructuredContent(entry.content, dictionary);
+ switch (typeof entry) {
+ case 'string':
+ return this._createTermDefinitionEntryText(entry);
+ case 'object': {
+ switch (entry.type) {
+ case 'image':
+ return this._createTermDefinitionEntryImage(entry, dictionary);
+ case 'structured-content':
+ return this._createTermDefinitionEntryStructuredContent(entry.content, dictionary);
+ case 'text':
+ break;
+ }
+ break;
}
}