« get me outta code hell

language: unflattenLanguageSpec: simplify {_: ...} tidying - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-12-01 20:01:00 -0400
committer(quasar) nebula <qznebula@protonmail.com>2024-12-01 20:01:00 -0400
commit6c6c084b84ea22a5528b3ee4a7242e5a18c5863a (patch)
treeb6a854706db3407f9901e27fcd2e15ac1cdb07b7 /src/data
parent001fbe0975bf5fcce47372cba72b489178fd34e7 (diff)
language: unflattenLanguageSpec: simplify {_: ...} tidying
cleaner solution than "no lonely '_' keys"
Diffstat (limited to 'src/data')
-rw-r--r--src/data/language.js8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/data/language.js b/src/data/language.js
index 99b60d83..47caa1ed 100644
--- a/src/data/language.js
+++ b/src/data/language.js
@@ -114,12 +114,6 @@ export function unflattenLanguageSpec(flat, reference) {
         return {[firstKey]: result};
       }
 
-      const resultKeys = Object.keys(result);
-      if (resultKeys.length === 1 && resultKeys[0] === '_') {
-        delete ownNode[firstKey];
-        return {[firstKey]: result._};
-      }
-
       if (refKeys.length > 1) {
         return withEntries(result, entries =>
           entries.map(([key, value]) => [`${firstKey}.${key}`, value]));
@@ -153,7 +147,7 @@ export function unflattenLanguageSpec(flat, reference) {
       typeof refNode === 'object' &&
       typeof refNode._ === 'string'
     ) {
-      return {_: ownNode};
+      return ownNode;
     }
 
     if (