MCPcopy Create free account
hub / github.com/ReactiveX/rxjs / applyMigrationPlan

Function applyMigrationPlan

packages/migrate/src/node.ts:126–136  ·  view source on GitHub ↗
(
  plan: MigrationFilePlan,
  options: ApplyMigrationPlanOptions = {}
)

Source from the content-addressed store, hash-verified

124
125/** Writes the exact transformed bytes contained in an already validated plan. */
126export async function applyMigrationPlan(
127 plan: MigrationFilePlan,
128 options: ApplyMigrationPlanOptions = {}
129): Promise<readonly MigratedFile[]> {
130 await preflightPlanOutputs(plan, options);
131 for (const { outputPath, result } of plan.files) {
132 await mkdir(dirname(outputPath), { recursive: true });
133 await writeFile(outputPath, result.code, 'utf8');
134 }
135 return plan.files;
136}
137
138async function preflightPlanOutputs(plan: MigrationFilePlan, options: ApplyMigrationPlanOptions): Promise<void> {
139 const outputRoot = resolve(plan.outputRoot);

Callers 3

migrateTestFilesFunction · 0.85
node.spec.tsFile · 0.85
createMigrationCliReportFunction · 0.85

Calls 1

preflightPlanOutputsFunction · 0.85

Tested by

no test coverage detected