mirror of
https://github.com/renovatebot/renovate.git
synced 2026-11-02 18:43:40 +00:00
930cf6633c
fix: Additional vi.mock path corrections and prettier formatting
19 lines
626 B
TypeScript
19 lines
626 B
TypeScript
import { isArray } from '@sindresorhus/is';
|
|
import type { PackageRule } from '../../types.ts';
|
|
import { AbstractMigration } from '../base/abstract-migration.ts';
|
|
|
|
export class PackagesMigration extends AbstractMigration {
|
|
override readonly deprecated = true;
|
|
override readonly propertyName = 'packages';
|
|
|
|
override run(value: unknown): void {
|
|
const packageRules = this.get('packageRules');
|
|
|
|
let newPackageRules = isArray(packageRules) ? packageRules : [];
|
|
if (isArray<PackageRule>(value)) {
|
|
newPackageRules = newPackageRules.concat(value);
|
|
}
|
|
this.setHard('packageRules', newPackageRules);
|
|
}
|
|
}
|