0
0
Fork 0
mirror of https://github.com/renovatebot/renovate.git synced 2025-01-11 13:48:55 +00:00
renovatebot_renovate/lib/config/migrations/custom/semantic-prefix-migration.ts
2022-07-06 02:34:21 +00:00

16 lines
552 B
TypeScript

import is from '@sindresorhus/is';
import { AbstractMigration } from '../base/abstract-migration';
export class SemanticPrefixMigration extends AbstractMigration {
override readonly deprecated = true;
override readonly propertyName = 'semanticPrefix';
override run(value: unknown): void {
if (is.string(value)) {
const [text] = value.split(':');
const [type, scope] = text.split('(');
this.setSafely('semanticCommitType', type);
this.setSafely('semanticCommitScope', scope ? scope.split(')')[0] : null);
}
}
}