Skip to content
Snippets Groups Projects
Unverified Commit 0638bfd7 authored by Sergei Zharinov's avatar Sergei Zharinov Committed by GitHub
Browse files

refactor(workers): Strict nulls for CommitMessage class (#12863)

parent e7a96901
No related branches found
No related tags found
No related merge requests found
export class CommitMessage { export class CommitMessage {
public static readonly SEPARATOR: string = ':'; public static readonly SEPARATOR: string = ':';
private message: string; private message = '';
private prefix: string; private prefix = '';
constructor(message = '') { constructor(message = '') {
this.setMessage(message); this.setMessage(message);
...@@ -26,11 +26,11 @@ export class CommitMessage { ...@@ -26,11 +26,11 @@ export class CommitMessage {
} }
public setCustomPrefix(prefix?: string): void { public setCustomPrefix(prefix?: string): void {
this.prefix = (prefix || '').trim(); this.prefix = (prefix ?? '').trim();
} }
public setSemanticPrefix(type?: string, scope?: string): void { public setSemanticPrefix(type?: string, scope?: string): void {
this.prefix = (type || '').trim(); this.prefix = (type ?? '').trim();
if (scope?.trim()) { if (scope?.trim()) {
this.prefix += `(${scope.trim()})`; this.prefix += `(${scope.trim()})`;
......
...@@ -122,6 +122,7 @@ ...@@ -122,6 +122,7 @@
"./lib/workers/pr/changelog/hbs-template.ts", "./lib/workers/pr/changelog/hbs-template.ts",
"./lib/workers/pr/changelog/types.ts", "./lib/workers/pr/changelog/types.ts",
"./lib/workers/repository/init/types.ts", "./lib/workers/repository/init/types.ts",
"./lib/workers/repository/model/commit-message.ts",
"./test/graphql-snapshot.ts", "./test/graphql-snapshot.ts",
"./test/json-schema.ts", "./test/json-schema.ts",
"./test/newline-snapshot-serializer.ts", "./test/newline-snapshot-serializer.ts",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment