Files
renovate/lib/config/migrations/custom/datasource-migration.ts
Sergei Zharinov 930cf6633c refactor: Rewrite imports with .ts extensions (#40700)
fix: Additional vi.mock path corrections and prettier formatting
2026-01-26 22:48:17 +00:00

27 lines
680 B
TypeScript

import { isString } from '@sindresorhus/is';
import { AbstractMigration } from '../base/abstract-migration.ts';
export class DatasourceMigration extends AbstractMigration {
override readonly propertyName = 'datasource';
override run(value: unknown): void {
// v8 ignore else -- TODO: add test #40625
if (isString(value)) {
const newValue = migrateDatasource(value);
this.rewrite(newValue);
}
}
}
export function migrateDatasource(value: string): string {
switch (value) {
case 'adoptium-java':
return 'java-version';
case 'dotnet':
return 'dotnet-version';
case 'node':
return 'node-version';
}
return value;
}