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/stability-days-migration.ts
RahulGautamSingh 135e6cd078
feat(config): rename stabilityDays to minimumReleaseAge (#21376)
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
2023-04-12 17:59:24 +00:00

26 lines
650 B
TypeScript

import is from '@sindresorhus/is';
import { AbstractMigration } from '../base/abstract-migration';
export class StabilityDaysMigration extends AbstractMigration {
override readonly deprecated = true;
override readonly propertyName = 'stabilityDays';
override run(value: unknown): void {
if (is.integer(value)) {
let newValue: null | string;
switch (value) {
case 0:
newValue = null;
break;
case 1:
newValue = '1 day';
break;
default:
newValue = `${value} days`;
break;
}
this.setSafely('minimumReleaseAge', newValue);
}
}
}