You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
643 B
TypeScript
29 lines
643 B
TypeScript
import {RepositoryData} from "../api-types/repo";
|
|
|
|
export class Repository {
|
|
constructor(
|
|
private repoData: RepositoryData,
|
|
) {
|
|
}
|
|
|
|
public get name(): string {
|
|
return this.repoData.name;
|
|
}
|
|
|
|
public get address(): string | undefined {
|
|
return this.repoData.address;
|
|
}
|
|
|
|
public get path(): string | undefined {
|
|
return this.repoData.path;
|
|
}
|
|
|
|
public get local(): boolean {
|
|
return this.repoData.local;
|
|
}
|
|
|
|
public update(data: { name?: string, address?: string, path?: string, local?: boolean }) {
|
|
this.repoData = Object.assign(this.repoData, data);
|
|
}
|
|
}
|