diff options
| author | (quasar) nebula <qznebula@protonmail.com> | 2026-01-26 15:14:38 -0400 |
|---|---|---|
| committer | (quasar) nebula <qznebula@protonmail.com> | 2026-01-26 15:14:38 -0400 |
| commit | a074fd54107c51c4fcbfedbbf6df6eca539d19d3 (patch) | |
| tree | 4fec08106aa3054c1954c5fa4ade0fb880c5eeb3 /src/data/yaml.js | |
| parent | 796e4bc1452b918bbf50a2e802b308f6ac20f2c2 (diff) | |
data, yaml: split yaml loading specs into src/data/files
Diffstat (limited to 'src/data/yaml.js')
| -rw-r--r-- | src/data/yaml.js | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/data/yaml.js b/src/data/yaml.js index 908d42c6..50496c00 100644 --- a/src/data/yaml.js +++ b/src/data/yaml.js @@ -7,6 +7,7 @@ import {inspect as nodeInspect} from 'node:util'; import yaml from 'js-yaml'; +import * as fileLoadingSpecs from '#files'; import {colors, ENABLE_COLOR, logInfo, logWarn} from '#cli'; import {parseContentNodes, splitContentNodesAround} from '#replacer'; import {sortByName} from '#sort'; @@ -1157,17 +1158,7 @@ export function getAllDataSteps() { const steps = []; - const seenLoadingFns = new Set(); - - for (const thingConstructor of Object.values(thingConstructors)) { - const getSpecFn = thingConstructor[Thing.getYamlLoadingSpec]; - if (!getSpecFn) continue; - - // Subclasses can expose literally the same static properties - // by inheritence. We don't want to double-count those! - if (seenLoadingFns.has(getSpecFn)) continue; - seenLoadingFns.add(getSpecFn); - + for (const getSpecFn of Object.values(fileLoadingSpecs)) { steps.push(getSpecFn({ documentModes, thingConstructors, @@ -1837,6 +1828,7 @@ export function linkWikiDataArrays(wikiData, {bindFind, bindReverse}) { for (const thing of things) { if (thing === undefined) continue; + if (thing === null) continue; let hasFind; if (constructorHasFindMap.has(thing.constructor)) { |