server-ts: Fix errors in abstract_becca_entity

This commit is contained in:
Elian Doran
2024-02-17 10:02:50 +02:00
parent f51f070b2f
commit f9ba8ca87d
8 changed files with 69 additions and 43 deletions

View File

@@ -1,5 +1,5 @@
export interface Blob {
blobId: string;
content: Buffer;
content: string | Buffer;
utcDateModified: string;
}

View File

@@ -6,7 +6,7 @@ export interface EntityChange {
entity?: any;
positions?: Record<string, string>;
hash: string;
utcDateChanged: string;
utcDateChanged?: string;
isSynced: boolean | 1 | 0;
isErased: boolean | 1 | 0;
componentId?: string | null;

View File

@@ -24,7 +24,7 @@ function md5(content: crypto.BinaryLike) {
return crypto.createHash('md5').update(content).digest('hex');
}
function hashedBlobId(content: string) {
function hashedBlobId(content: string | Buffer) {
if (content === null || content === undefined) {
content = "";
}