1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

Tools: Implement "prefer-object-spread" eslint rule

This commit is contained in:
Laurent Cozic
2023-06-01 12:02:36 +01:00
parent 804d674d37
commit c89edd7b22
126 changed files with 588 additions and 909 deletions

View File

@ -237,9 +237,7 @@ export default class EncryptionService {
}
private async generateMasterKeyContent_(password: string, options: EncryptOptions = null) {
options = Object.assign({}, {
encryptionMethod: this.defaultMasterKeyEncryptionMethod_,
}, options);
options = { encryptionMethod: this.defaultMasterKeyEncryptionMethod_, ...options };
const bytes: any[] = await shim.randomBytes(256);
const hexaBytes = bytes.map(a => hexPad(a.toString(16), 2)).join('');
@ -412,9 +410,7 @@ export default class EncryptionService {
}
private async encryptAbstract_(source: any, destination: any, options: EncryptOptions = null) {
options = Object.assign({}, {
encryptionMethod: this.defaultEncryptionMethod(),
}, options);
options = { encryptionMethod: this.defaultEncryptionMethod(), ...options };
const method = options.encryptionMethod;
const masterKeyId = options.masterKeyId ? options.masterKeyId : this.activeMasterKeyId();