5etools-utils 0.12.19 → 0.12.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/BrewIndexGenerator.js +18 -0
- package/package.json +1 -1
|
@@ -96,6 +96,23 @@ class _BrewIndexMeta extends _BrewIndex {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
class _BrewIndexAdventureBookIds extends _BrewIndex {
|
|
100
|
+
static _FILE_PATH = "_generated/index-adventure-book-ids.json";
|
|
101
|
+
static _DISPLAY_NAME = "ids";
|
|
102
|
+
|
|
103
|
+
addToIndex (fileInfo) {
|
|
104
|
+
["adventure", "book"]
|
|
105
|
+
.forEach(prop => {
|
|
106
|
+
(fileInfo.contents[prop] || [])
|
|
107
|
+
.forEach(({name, source, id}) => {
|
|
108
|
+
if (!name || !source || !id) return;
|
|
109
|
+
// Lowercase the key, as we expect this to come from a hash
|
|
110
|
+
this._index[id.toLowerCase()] = {name, source, id};
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
99
116
|
class BrewIndexGenerator {
|
|
100
117
|
static _DIR_TO_PRIMARY_PROP = {
|
|
101
118
|
"creature": [
|
|
@@ -147,6 +164,7 @@ class BrewIndexGenerator {
|
|
|
147
164
|
new _BrewIndexProps(),
|
|
148
165
|
new _BrewIndexSources(),
|
|
149
166
|
new _BrewIndexMeta(),
|
|
167
|
+
new _BrewIndexAdventureBookIds(),
|
|
150
168
|
];
|
|
151
169
|
|
|
152
170
|
Um.info(`INDEX`, `Indexing...`);
|