frontend/.pnpm-store/v3/files/6d/35a4eded3bc850103e7d90c240242a4c07fd3aa52f8c8190ff88b3ae91d40d0dc234ba4035b44dda48d8bf0d35abac5c58118bf180e8f1ac24c82751c74a9a

50 lines
576 B
Plaintext

"use strict";
function joinPath(pathArray)
{
if (pathArray.length > 0)
{
return pathArray.join("/") + "/";
}
else
{
return "";
}
}
function resolveDotSegments(pathArray)
{
var pathAbsolute = [];
pathArray.forEach( function(dir)
{
if (dir !== "..")
{
if (dir !== ".")
{
pathAbsolute.push(dir);
}
}
else
{
// Remove parent
if (pathAbsolute.length > 0)
{
pathAbsolute.splice(pathAbsolute.length-1, 1);
}
}
});
return pathAbsolute;
}
module.exports =
{
join: joinPath,
resolveDotSegments: resolveDotSegments
};