posthtml-relative-paths
Version:
Convert the absolute paths in HTML files to relative paths
19 lines • 573 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.removeDot = exports.prependDot = exports.toPosixPath = void 0;
function toPosixPath(path) {
return path.replace(/\\/g, "/");
}
exports.toPosixPath = toPosixPath;
function prependDot(path) {
return path.startsWith("./") || path.startsWith("..") ? path : `./${path}`;
}
exports.prependDot = prependDot;
function removeDot(path) {
if (path.startsWith("./")) {
return path.slice(2);
}
return path;
}
exports.removeDot = removeDot;
//# sourceMappingURL=utils.js.map