mirror of
https://github.com/renovatebot/renovate.git
synced 2024-12-22 21:48:32 +00:00
ed73d380e8
* refactor: improve commit message functionality * refactor: fix test coverage * refactor: fix by comments * refactor: fix build * refactor: fix linting * refactor: fix export type * refactor: js private fields * refactor: static private fields * fix: lint * refactor: fix tsconfig * refactor: implement method normalizeInput * refactor: fix by comments * Update lib/workers/repository/model/commit-message.ts * refactor: fix by comments * refactor: use private typescript fields again * refactor: fix by comments Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
28 lines
568 B
TypeScript
28 lines
568 B
TypeScript
import type { CommitMessageJSON } from '../../../types';
|
|
import { CommitMessage } from './commit-message';
|
|
|
|
export interface CustomCommitMessageJSON extends CommitMessageJSON {
|
|
prefix?: string;
|
|
}
|
|
|
|
export class CustomCommitMessage extends CommitMessage {
|
|
private _prefix = '';
|
|
|
|
get prefix(): string {
|
|
return this._prefix;
|
|
}
|
|
|
|
set prefix(value: string) {
|
|
this._prefix = this.normalizeInput(value);
|
|
}
|
|
|
|
override toJSON(): CustomCommitMessageJSON {
|
|
const json = super.toJSON();
|
|
|
|
return {
|
|
...json,
|
|
prefix: this._prefix,
|
|
};
|
|
}
|
|
}
|