path with proper links

This commit is contained in:
Daniel
2023-04-11 16:50:10 +05:30
parent 451642b9ab
commit 2ddba3d72f
18 changed files with 100 additions and 63 deletions

27
src/utils/index.js Normal file
View File

@@ -0,0 +1,27 @@
function convertPathToHtml(path) {
let count = 0
while (path.startsWith('../')) {
count++
path = path.slice(3)
}
if (count === 2) {
return '.'
}
if (count === 3) {
return '..'
}
if (count === 4) {
return '../..'
}
if (count === 5) {
return '../../..'
}
return ''
}
export { convertPathToHtml }