lastSegmentLength = 2;
}
if (res.length > 0) {
res += `${separator}${path.slice(lastSlash + 1, i)}`;
}
res = path.slice(lastSlash + 1, i);
}
lastSegmentLength = i - lastSlash - 1;
}
lastSlash = i;
dots = 0;
} else if (code === CHAR_DOT && dots !== -1) {
++dots;
dots = -1;
}
}
return res;