chore: publish from main

This commit is contained in:
github-actions[bot]
2026-08-12 00:06:37 +00:00
parent b2f6d8fa4e
commit 96340d28c0
52 changed files with 15387 additions and 0 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,38 @@
export function normalizePath(value) {
return String(value ?? "")
.replaceAll("/", "\\")
.replace(/\\+$/, "")
.toLowerCase();
}
export function containsPath(parentPath, targetPath) {
const parent = normalizePath(parentPath);
const target = normalizePath(targetPath);
return parent === "" || target === parent || target.startsWith(`${parent}\\`);
}
export function getParentPath(value) {
const path = String(value ?? "").replaceAll("/", "\\").replace(/\\+$/, "");
const separatorIndex = path.lastIndexOf("\\");
if (separatorIndex < 0) {
return path;
}
return separatorIndex === 2 ? path.slice(0, separatorIndex + 1) : path.slice(0, separatorIndex);
}
export function findTreeStackForPath(tree, targetPath) {
if (!tree || !normalizePath(targetPath)) {
return [];
}
const stack = [tree];
let node = tree;
while (true) {
const child = node.children?.find((item) => !item.aggregate && containsPath(item.path, targetPath));
if (!child) {
return stack;
}
stack.push(child);
node = child;
}
}