diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-12-01 20:01:54 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-12-01 20:01:54 -0400 |
commit | d12d22e26992f71e4edb3fdbe4f96d801ec62a24 (patch) | |
tree | 973cd5dd242d59408ed0e6dd0f05fc567a5cd1dc /src/data/language.js | |
parent | 6c6c084b84ea22a5528b3ee4a7242e5a18c5863a (diff) |
language: minor style cleanup
Diffstat (limited to 'src/data/language.js')
-rw-r--r-- | src/data/language.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/data/language.js b/src/data/language.js index 47caa1ed..b8f58efd 100644 --- a/src/data/language.js +++ b/src/data/language.js @@ -11,7 +11,7 @@ import {annotateError, annotateErrorWithFile, showAggregate, withAggregate} from '#aggregate'; import {externalLinkSpec} from '#external-links'; import {colors, logWarn} from '#cli'; -import {splitKeys, withEntries} from '#sugar'; +import {empty, splitKeys, withEntries} from '#sugar'; import T from '#things'; const {Language} = T; @@ -101,7 +101,7 @@ export function unflattenLanguageSpec(flat, reference) { } const result = - (refKeys.length === 1 + (empty(restKeys) ? walkEntry(ownNode[firstKey], refNode) : recursive(restKeys, ownNode[firstKey], refNode)); @@ -125,7 +125,7 @@ export function unflattenLanguageSpec(flat, reference) { let mapped; for (const [key, value] of Object.entries(refNode)) { - const result = recursive(splitKeys(key), ownNode, refNode[key]); + const result = recursive(splitKeys(key), ownNode, value); if (!result) continue; if (!mapped) mapped = {}; Object.assign(mapped, result); @@ -174,7 +174,7 @@ export function unflattenLanguageSpec(flat, reference) { } const entries = Object.entries(node); - if (entries.length === 0) { + if (empty(entries)) { return undefined; } |