0
0
mirror of https://github.com/renovatebot/renovate.git synced 2024-12-22 13:38:32 +00:00
renovatebot_renovate/lib/config/migrations/custom/match-managers-migration.ts

19 lines
523 B
TypeScript

import is from '@sindresorhus/is';
import { AbstractMigration } from '../base/abstract-migration';
export class MatchManagersMigration extends AbstractMigration {
override readonly propertyName = 'matchManagers';
override run(value: unknown): void {
if (!is.array<string>(value, is.string)) {
return;
}
// prefix custom. before custom managers if not present
const newValue = value.map((manager) =>
manager === 'regex' ? 'custom.regex' : manager,
);
this.rewrite(newValue);
}
}