@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) • 767 B
JavaScript
/**
* Builds a list of patterns by combining prefixes with file names.
* For example, ['src/', 'lib/'] with ['index.ts', 'main.js'] produces:
* ['src/index.ts', 'src/main.js', 'lib/index.ts', 'lib/main.js']
*
* @param prefixes - Array of path prefixes (e.g., directory paths)
* @param fileNames - Array of file names
* @returns Array of combined path patterns
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "buildPatterns", {
enumerable: true,
get: function() {
return buildPatterns;
}
});
function buildPatterns(prefixes, fileNames) {
return prefixes.flatMap((prefix)=>fileNames.map((fileName)=>`${prefix}${fileName}`));
}
//# sourceMappingURL=build-patterns.js.map