0
0
Fork 0
mirror of https://github.com/renovatebot/renovate.git synced 2025-03-12 15:26:58 +00:00
renovatebot_renovate/lib/config/migrations/custom/path-rules-migration.ts
2023-11-07 15:50:29 +00:00

19 lines
561 B
TypeScript

import is from '@sindresorhus/is';
import type { PackageRule } from '../../types';
import { AbstractMigration } from '../base/abstract-migration';
export class PathRulesMigration extends AbstractMigration {
override readonly deprecated = true;
override readonly propertyName = 'pathRules';
override run(value: unknown): void {
const packageRules = this.get('packageRules');
if (is.array<PackageRule>(value)) {
this.setHard(
'packageRules',
is.array(packageRules) ? packageRules.concat(value) : value,
);
}
}
}