Files
renovate/lib/config/migrations/custom/stability-days-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
710 B
TypeScript

import { isInteger } from '@sindresorhus/is';
import { AbstractMigration } from '../base/abstract-migration.ts';
export class StabilityDaysMigration extends AbstractMigration {
override readonly deprecated = true;
override readonly propertyName = 'stabilityDays';
override run(value: unknown): void {
// v8 ignore else -- TODO: add test #40625
if (isInteger(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);
}
}
}