aboutsummaryrefslogtreecommitdiff
path: root/packages/server/src/git/blob.ts
blob: aa3f9ad26169d3ca356f174dfebde4b6268764c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import { TreeEntry as NodeGitTreeEntry } from "nodegit";

export class Blob {
	private _ng_tree_entry: NodeGitTreeEntry;

	constructor(entry: NodeGitTreeEntry) {
		this._ng_tree_entry = entry;
	}

	async content(): Promise<string> {
		return this._ng_tree_entry.isBlob() ? (await this._ng_tree_entry.getBlob()).toString() : "";
	}
}