diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2022-11-21 21:48:31 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2022-11-21 21:48:31 -0400 |
commit | ba2751eae00c4bcf10403edbd549ca70dc316cab (patch) | |
tree | 492537e39b268dd1991bc85ffb2e4c666ff03536 /src/data | |
parent | 860b9fbf12315362d2c33864521c3f081fd66545 (diff) |
new "empty" sugar.js util
Diffstat (limited to 'src/data')
-rw-r--r-- | src/data/yaml.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/data/yaml.js b/src/data/yaml.js index 2c3c988d..e18b7334 100644 --- a/src/data/yaml.js +++ b/src/data/yaml.js @@ -31,6 +31,7 @@ import {color, ENABLE_COLOR, logInfo, logWarn} from '../util/cli.js'; import { decorateErrorWithIndex, + empty, mapAggregate, openAggregate, showAggregate, @@ -143,7 +144,7 @@ function makeProcessDocument( .map(([field]) => field) .filter((field) => !knownFields.includes(field)); - if (unknownFields.length) { + if (!empty(unknownFields)) { throw new makeProcessDocument.UnknownFieldsError(unknownFields); } @@ -1253,7 +1254,7 @@ export function filterDuplicateDirectories(wikiData) { directoryPlaces[directory] = [thing]; } } - if (!duplicateDirectories.length) return; + if (empty(duplicateDirectories)) return; duplicateDirectories.sort((a, b) => { const aL = a.toLowerCase(); const bL = b.toLowerCase(); |