feat(client): add rich domain classes, helpers, and refactor GitLabClient internals
This commit is contained in:
18
ts/gitlab.classes.branch.ts
Normal file
18
ts/gitlab.classes.branch.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { IGitLabBranch } from './gitlab.interfaces.js';
|
||||
|
||||
export class GitLabBranch {
|
||||
public readonly name: string;
|
||||
public readonly commitSha: string;
|
||||
|
||||
constructor(raw: IGitLabBranch) {
|
||||
this.name = raw.name || '';
|
||||
this.commitSha = raw.commit?.id || '';
|
||||
}
|
||||
|
||||
toJSON(): IGitLabBranch {
|
||||
return {
|
||||
name: this.name,
|
||||
commit: { id: this.commitSha },
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user