(value)
| 107 | } |
| 108 | |
| 109 | function normalizeFolderPath(value) { |
| 110 | let v = String(value || '').trim(); |
| 111 | if (v === '' || v.toLowerCase() === 'root') return 'root'; |
| 112 | v = v.replace(/\\/g, '/'); |
| 113 | v = v.replace(/^\/+|\/+$/g, ''); |
| 114 | if (v.toLowerCase() === 'root') return 'root'; |
| 115 | if (v.toLowerCase().startsWith('root/')) { |
| 116 | v = v.slice(5); |
| 117 | } |
| 118 | return v === '' ? 'root' : v; |
| 119 | } |
| 120 | |
| 121 | function parentFolderPath(folder) { |
| 122 | const f = normalizeFolderPath(folder); |
no outgoing calls
no test coverage detected