@lifaon/path
Version:
Useful tool to manage paths like the URL object
15 lines • 538 B
JavaScript
import { isRelativePathSegment } from '../../segment/functions/is/is-relative-path-segement.js';
import { joinManyPathSegments } from '../join/join-many-path-segments.js';
/**
* Converts a path to an absolute path
* INFO: root must be an absolute path
*/
export function resolvePathSegments(segments, root, options) {
if (isRelativePathSegment(segments[0])) {
return joinManyPathSegments([root, segments], options);
}
else {
return segments.slice();
}
}
//# sourceMappingURL=resolve-path-segments.js.map