RevisionEntity: Add create() method

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2020-09-19 16:04:30 +02:00
parent 2ab90917bc
commit 5d07481387
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3

View file

@ -65,4 +65,15 @@ export class Revision {
) )
@JoinTable() @JoinTable()
authorships: Authorship[]; authorships: Authorship[];
// eslint-disable-next-line @typescript-eslint/no-empty-function
private constructor() {}
static create(content: string, patch: string): Revision {
const newRevision = new Revision();
newRevision.patch = patch;
newRevision.content = content;
newRevision.length = content.length;
return newRevision;
}
} }