@microfleet/core
Version:
Abstract microservice core
16 lines • 649 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromNameToPath = exports.fromPathToName = void 0;
function fromPathToName(path, prefix) {
const { length } = prefix;
const start = length ? length + 2 : 1;
const end = path[path.length - 1] === '/' ? -1 : undefined;
return path.slice(start, end).replace(/\//g, '.');
}
exports.fromPathToName = fromPathToName;
function fromNameToPath(name, prefix) {
const actionName = prefix.length ? `/${prefix}/${name}` : `/${name}`;
return actionName.replace(/\./g, '/');
}
exports.fromNameToPath = fromNameToPath;
//# sourceMappingURL=actionName.js.map
;