@kt3k/tku 1.2.1 → 1.2.2
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/main.js +6 -4
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -238,10 +238,12 @@ function formatTree(result, options = {}) {
|
|
|
238
238
|
function summarizeByDir(result) {
|
|
239
239
|
const dirMap = /* @__PURE__ */ new Map();
|
|
240
240
|
for (const file of result.files) {
|
|
241
|
-
const
|
|
242
|
-
if (
|
|
243
|
-
|
|
244
|
-
|
|
241
|
+
const parts = file.path.split("/");
|
|
242
|
+
if (parts.length < 2) continue;
|
|
243
|
+
for (let i = 1; i < parts.length; i++) {
|
|
244
|
+
const dir = parts.slice(0, i).join("/");
|
|
245
|
+
dirMap.set(dir, (dirMap.get(dir) ?? 0) + file.tokens);
|
|
246
|
+
}
|
|
245
247
|
}
|
|
246
248
|
const files = [
|
|
247
249
|
...dirMap.entries()
|