Files
gitlab/ts/gitlab.classes.branch.ts

19 lines
391 B
TypeScript

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 },
};
}
}