You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-16 00:14:34 +02:00
@ -240,6 +240,26 @@ export class SyncInfo {
|
||||
};
|
||||
}
|
||||
|
||||
public filterSyncInfo() {
|
||||
const filtered = JSON.parse(JSON.stringify(this.toObject()));
|
||||
|
||||
// Filter content and checksum properties from master keys
|
||||
if (filtered.masterKeys) {
|
||||
filtered.masterKeys = filtered.masterKeys.map((mk: MasterKeyEntity) => {
|
||||
delete mk.content;
|
||||
delete mk.checksum;
|
||||
return mk;
|
||||
});
|
||||
}
|
||||
|
||||
// Truncate the private key and public key
|
||||
if (filtered.ppk.value) {
|
||||
filtered.ppk.value.privateKey.ciphertext = `${filtered.ppk.value.privateKey.ciphertext.substr(0, 20)}...${filtered.ppk.value.privateKey.ciphertext.substr(-20)}`;
|
||||
filtered.ppk.value.publicKey = `${filtered.ppk.value.publicKey.substr(0, 40)}...`;
|
||||
}
|
||||
return filtered;
|
||||
}
|
||||
|
||||
public serialize(): string {
|
||||
return JSON.stringify(this.toObject(), null, '\t');
|
||||
}
|
||||
|
Reference in New Issue
Block a user