@procore/core-scripts
Version:
A CLI to enhance your development experience
14 lines • 563 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.withoutSlash = exports.withSlash = exports.ensureSlash = void 0;
const ensureSlash = (needsSlash) => (path) => {
const hasSlash = path.endsWith('/');
if (hasSlash && !needsSlash) {
return path.substr(0, path.length - 1);
}
return !hasSlash && needsSlash ? `${path}/` : path;
};
exports.ensureSlash = ensureSlash;
exports.withSlash = (0, exports.ensureSlash)(true);
exports.withoutSlash = (0, exports.ensureSlash)(false);
//# sourceMappingURL=paths.js.map
;