MCPcopy Create free account
hub / github.com/error311/FileRise / parentFolderOf

Function parentFolderOf

public/js/fileDragDrop.js:15–21  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

13 return el?.closest('tr[data-file-name], .gallery-card[data-file-name]') || null;
14}
15function parentFolderOf(path) {
16 if (!path || path === 'root') return 'root';
17 const parts = String(path).split('/').filter(Boolean);
18 if (parts.length <= 1) return 'root';
19 parts.pop();
20 return parts.join('/');
21}
22
23function normalizeFolderToastKey(path) {
24 const raw = String(path || '').trim();

Callers 2

folderDropHandlerFunction · 0.70

Calls 1

splitMethod · 0.80

Tested by

no test coverage detected