@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.
15 lines • 458 B
JavaScript
import path from "node:path";
export function findSrcDir(filePath) {
let currentDir = filePath;
const cwdPath = process.cwd();
while (currentDir !== path.parse(currentDir).root &&
currentDir !== cwdPath &&
currentDir !== ".") {
if (path.basename(currentDir) === "src") {
return currentDir;
}
currentDir = path.dirname(currentDir);
}
return null;
}
//# sourceMappingURL=findSrcDir.js.map