Files
renovate/lib/config/migrations/custom/path-rules-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

20 lines
574 B
TypeScript

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