@nxworker/workspace
Version:
Nx plugin providing generators for managing workspace files, including the move-file generator for safely moving files between projects while updating all imports
23 lines (22 loc) • 745 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "checkForImportsInProject", {
enumerable: true,
get: function() {
return checkForImportsInProject;
}
});
const _jscodeshiftutils = require("../jscodeshift-utils");
function checkForImportsInProject(tree, project, importPath, getProjectSourceFilesFn) {
const sourceFiles = getProjectSourceFilesFn(tree, project.root);
for (const filePath of sourceFiles){
// Use jscodeshift to check for imports
if ((0, _jscodeshiftutils.hasImportSpecifier)(tree, filePath, importPath)) {
return true;
}
}
return false;
}
//# sourceMappingURL=check-for-imports-in-project.js.map