Files
upload-platform/upload/frontend/table/rebase_tree.js
T

7 lines
268 B
JavaScript

export function rebaseTree(root, prefix) {
root.path = `${prefix}/${root.path}`;
if (root.file) root.file = new File([root.file], root.path, { lastModified: root.file.lastModified });
root.children.forEach((child) => rebaseTree(child, prefix));
return root;
}