mirror of
https://github.com/renovatebot/renovate.git
synced 2024-12-22 13:38:32 +00:00
79556f4ecb
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com> Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
25 lines
592 B
TypeScript
25 lines
592 B
TypeScript
import is from '@sindresorhus/is';
|
|
import { AbstractMigration } from '../base/abstract-migration';
|
|
|
|
export class EnabledManagersMigration extends AbstractMigration {
|
|
override readonly propertyName = 'enabledManagers';
|
|
|
|
override run(value: unknown): void {
|
|
if (!is.array<string>(value, is.string)) {
|
|
return;
|
|
}
|
|
|
|
const newValue = value.map((manager) => {
|
|
switch (manager) {
|
|
case 'yarn':
|
|
return 'npm';
|
|
case 'regex':
|
|
return 'custom.regex';
|
|
default:
|
|
return manager;
|
|
}
|
|
});
|
|
this.rewrite(newValue);
|
|
}
|
|
}
|