mirror of
https://github.com/renovatebot/renovate.git
synced 2024-12-22 13:38:32 +00:00
135e6cd078
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
26 lines
650 B
TypeScript
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);
|
|
}
|
|
}
|
|
}
|