19 lines
379 B
TypeScript
19 lines
379 B
TypeScript
import type { IGitLabTag } from './gitlab.interfaces.js';
|
|
|
|
export class GitLabTag {
|
|
public readonly name: string;
|
|
public readonly commitSha: string;
|
|
|
|
constructor(raw: IGitLabTag) {
|
|
this.name = raw.name || '';
|
|
this.commitSha = raw.commit?.id || '';
|
|
}
|
|
|
|
toJSON(): IGitLabTag {
|
|
return {
|
|
name: this.name,
|
|
commit: { id: this.commitSha },
|
|
};
|
|
}
|
|
}
|