@wroud/di-tools-codemod
Version:
@wroud/di-tools-codemod is a codemod utility that automates the migration of your codebase from Inversify to @wroud/di. It streamlines the transformation process, allowing for effortless and customizable transitions through configuration support.
17 lines • 586 B
JavaScript
import path from "node:path";
export function getModulePath(file, transformerOptions) {
const pathWithoutExtension = path.join(file.path.replace(/\.[^/.]+$/, ""));
const ext = path.extname(file.path);
if (transformerOptions.esm) {
switch (ext) {
case ".ts":
return `${pathWithoutExtension}.js`;
case ".tsx":
return `${pathWithoutExtension}.jsx`;
default:
return pathWithoutExtension + ext;
}
}
return pathWithoutExtension;
}
//# sourceMappingURL=getModulePath.js.map