koishipro-core.js 1.1.3 → 1.1.4
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/dist/index.cjs +21 -23
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +21 -23
- package/dist/index.mjs.map +2 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2298,31 +2298,29 @@ async function safeReadDir2(fs, dirPath) {
|
|
|
2298
2298
|
}
|
|
2299
2299
|
}
|
|
2300
2300
|
async function collectFsDbPaths(fs, pathMod, baseDir) {
|
|
2301
|
-
const
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
const
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
const fullPath = joinPath3(pathMod, expansionsDir, entry);
|
|
2317
|
-
try {
|
|
2318
|
-
const stats = await fs.promises.stat(fullPath);
|
|
2319
|
-
if (stats.isFile()) {
|
|
2320
|
-
results.push(fullPath);
|
|
2301
|
+
const collectCdbFiles = async (dirPath) => {
|
|
2302
|
+
const paths = [];
|
|
2303
|
+
const entries = await safeReadDir2(fs, dirPath);
|
|
2304
|
+
for (const entry of entries) {
|
|
2305
|
+
if (!entry.toLowerCase().endsWith(".cdb")) {
|
|
2306
|
+
continue;
|
|
2307
|
+
}
|
|
2308
|
+
const fullPath = joinPath3(pathMod, dirPath, entry);
|
|
2309
|
+
try {
|
|
2310
|
+
const stats = await fs.promises.stat(fullPath);
|
|
2311
|
+
if (stats.isFile()) {
|
|
2312
|
+
paths.push(fullPath);
|
|
2313
|
+
}
|
|
2314
|
+
} catch {
|
|
2315
|
+
continue;
|
|
2321
2316
|
}
|
|
2322
|
-
} catch {
|
|
2323
|
-
continue;
|
|
2324
2317
|
}
|
|
2325
|
-
|
|
2318
|
+
return paths;
|
|
2319
|
+
};
|
|
2320
|
+
const results = [];
|
|
2321
|
+
results.push(...await collectCdbFiles(baseDir));
|
|
2322
|
+
const expansionsDir = joinPath3(pathMod, baseDir, "expansions");
|
|
2323
|
+
results.push(...await collectCdbFiles(expansionsDir));
|
|
2326
2324
|
return results;
|
|
2327
2325
|
}
|
|
2328
2326
|
function isRootCdbEntry(entryName) {
|