feat(gitea): add domain model classes, helpers, and refactor GiteaClient internals; expand README with usage and docs
This commit is contained in:
18
ts/gitea.classes.branch.ts
Normal file
18
ts/gitea.classes.branch.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { IGiteaBranch } from './gitea.interfaces.js';
|
||||
|
||||
export class GiteaBranch {
|
||||
public readonly name: string;
|
||||
public readonly commitSha: string;
|
||||
|
||||
constructor(raw: IGiteaBranch) {
|
||||
this.name = raw.name || '';
|
||||
this.commitSha = raw.commit?.id || '';
|
||||
}
|
||||
|
||||
toJSON(): IGiteaBranch {
|
||||
return {
|
||||
name: this.name,
|
||||
commit: { id: this.commitSha },
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user