@kenjura/ursa 0.7.0 → 0.9.0
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/CHANGELOG.md +12 -0
- package/package.json +1 -1
- package/src/helper/recursive-readdir.js +9 -7
- package/src/jobs/generate.js +3 -3
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { resolve } from
|
|
2
|
-
import { readdir } from
|
|
1
|
+
import { resolve } from "path";
|
|
2
|
+
import { readdir } from "fs/promises";
|
|
3
3
|
|
|
4
4
|
export async function recurse(dir) {
|
|
5
5
|
const dirents = await readdir(dir, { withFileTypes: true });
|
|
6
|
-
const files = await Promise.all(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
const files = await Promise.all(
|
|
7
|
+
dirents.map(async (dirent) => {
|
|
8
|
+
const res = resolve(dir, dirent.name);
|
|
9
|
+
return dirent.isDirectory() ? [res, ...(await recurse(res))] : res;
|
|
10
|
+
})
|
|
11
|
+
);
|
|
10
12
|
return Array.prototype.concat(...files);
|
|
11
|
-
}
|
|
13
|
+
}
|
package/src/jobs/generate.js
CHANGED
|
@@ -107,11 +107,11 @@ export async function generate({
|
|
|
107
107
|
const jsonObject = {
|
|
108
108
|
name: base,
|
|
109
109
|
contents: rawBody,
|
|
110
|
-
bodyLessMeta: bodyLessMeta,
|
|
110
|
+
// bodyLessMeta: bodyLessMeta,
|
|
111
111
|
bodyHtml: body,
|
|
112
112
|
metadata: meta,
|
|
113
113
|
transformedMetadata,
|
|
114
|
-
html: finalHtml,
|
|
114
|
+
// html: finalHtml,
|
|
115
115
|
};
|
|
116
116
|
jsonCache.set(file, jsonObject);
|
|
117
117
|
const json = JSON.stringify(jsonObject);
|
|
@@ -263,4 +263,4 @@ function addTrailingSlash(somePath) {
|
|
|
263
263
|
if (somePath.length < 1) return somePath;
|
|
264
264
|
if (somePath[somePath.length - 1] == "/") return somePath;
|
|
265
265
|
return `${somePath}/`;
|
|
266
|
-
}
|
|
266
|
+
}
|