1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 00:03:56 +00:00

Fix glob processing in npm. Ban single param parens (#257)

This commit is contained in:
Matt Gibson
2021-02-04 09:49:23 -06:00
committed by GitHub
parent a16d8f7de7
commit 58f40b0085
98 changed files with 275 additions and 271 deletions

View File

@@ -113,12 +113,12 @@ export class CipherService implements CipherServiceAbstraction {
}
}
if (existingCipher.hasFields) {
const existingHiddenFields = existingCipher.fields.filter((f) => f.type === FieldType.Hidden &&
const existingHiddenFields = existingCipher.fields.filter(f => f.type === FieldType.Hidden &&
f.name != null && f.name !== '' && f.value != null && f.value !== '');
const hiddenFields = model.fields == null ? [] :
model.fields.filter((f) => f.type === FieldType.Hidden && f.name != null && f.name !== '');
existingHiddenFields.forEach((ef) => {
const matchedField = hiddenFields.find((f) => f.name === ef.name);
model.fields.filter(f => f.type === FieldType.Hidden && f.name != null && f.name !== '');
existingHiddenFields.forEach(ef => {
const matchedField = hiddenFields.find(f => f.name === ef.name);
if (matchedField == null || matchedField.value !== ef.value) {
const ph = new PasswordHistoryView();
ph.password = ef.name + ': ' + ef.value;
@@ -157,13 +157,13 @@ export class CipherService implements CipherServiceAbstraction {
notes: null,
}, key),
this.encryptCipherData(cipher, model, key),
this.encryptFields(model.fields, key).then((fields) => {
this.encryptFields(model.fields, key).then(fields => {
cipher.fields = fields;
}),
this.encryptPasswordHistories(model.passwordHistory, key).then((ph) => {
this.encryptPasswordHistories(model.passwordHistory, key).then(ph => {
cipher.passwordHistory = ph;
}),
this.encryptAttachments(model.attachments, key).then((attachments) => {
this.encryptAttachments(model.attachments, key).then(attachments => {
cipher.attachments = attachments;
}),
]);
@@ -178,7 +178,7 @@ export class CipherService implements CipherServiceAbstraction {
const promises: Promise<any>[] = [];
const encAttachments: Attachment[] = [];
attachmentsModel.forEach(async (model) => {
attachmentsModel.forEach(async model => {
const attachment = new Attachment();
attachment.id = model.id;
attachment.size = model.size;
@@ -302,8 +302,8 @@ export class CipherService implements CipherServiceAbstraction {
const promises: any[] = [];
const ciphers = await this.getAll();
ciphers.forEach((cipher) => {
promises.push(cipher.decrypt().then((c) => decCiphers.push(c)));
ciphers.forEach(cipher => {
promises.push(cipher.decrypt().then(c => decCiphers.push(c)));
});
await Promise.all(promises);
@@ -315,7 +315,7 @@ export class CipherService implements CipherServiceAbstraction {
async getAllDecryptedForGrouping(groupingId: string, folder: boolean = true): Promise<CipherView[]> {
const ciphers = await this.getAllDecrypted();
return ciphers.filter((cipher) => {
return ciphers.filter(cipher => {
if (cipher.isDeleted) {
return false;
}
@@ -339,7 +339,7 @@ export class CipherService implements CipherServiceAbstraction {
const eqDomainsPromise = domain == null ? Promise.resolve([]) :
this.settingsService.getEquivalentDomains().then((eqDomains: any[][]) => {
let matches: any[] = [];
eqDomains.forEach((eqDomain) => {
eqDomains.forEach(eqDomain => {
if (eqDomain.length && eqDomain.indexOf(domain) >= 0) {
matches = matches.concat(eqDomain);
}
@@ -363,7 +363,7 @@ export class CipherService implements CipherServiceAbstraction {
}
}
return ciphers.filter((cipher) => {
return ciphers.filter(cipher => {
if (cipher.deletedDate != null) {
return false;
}
@@ -432,10 +432,10 @@ export class CipherService implements CipherServiceAbstraction {
if (ciphers != null && ciphers.data != null && ciphers.data.length) {
const decCiphers: CipherView[] = [];
const promises: any[] = [];
ciphers.data.forEach((r) => {
ciphers.data.forEach(r => {
const data = new CipherData(r);
const cipher = new Cipher(data);
promises.push(cipher.decrypt().then((c) => decCiphers.push(c)));
promises.push(cipher.decrypt().then(c => decCiphers.push(c)));
});
await Promise.all(promises);
decCiphers.sort(this.getLocaleSortingFunction());
@@ -556,7 +556,7 @@ export class CipherService implements CipherServiceAbstraction {
async shareWithServer(cipher: CipherView, organizationId: string, collectionIds: string[]): Promise<any> {
const attachmentPromises: Promise<any>[] = [];
if (cipher.attachments != null) {
cipher.attachments.forEach((attachment) => {
cipher.attachments.forEach(attachment => {
if (attachment.key == null) {
attachmentPromises.push(this.shareAttachmentWithServer(attachment, cipher.id, organizationId));
}
@@ -580,7 +580,7 @@ export class CipherService implements CipherServiceAbstraction {
for (const cipher of ciphers) {
cipher.organizationId = organizationId;
cipher.collectionIds = collectionIds;
promises.push(this.encrypt(cipher).then((c) => {
promises.push(this.encrypt(cipher).then(c => {
encCiphers.push(c);
}));
}
@@ -588,7 +588,7 @@ export class CipherService implements CipherServiceAbstraction {
const request = new CipherBulkShareRequest(encCiphers, collectionIds);
await this.apiService.putShareCiphers(request);
const userId = await this.userService.getUserId();
await this.upsert(encCiphers.map((c) => c.toCipherData(userId)));
await this.upsert(encCiphers.map(c => c.toCipherData(userId)));
}
saveAttachmentWithServer(cipher: Cipher, unencryptedFile: any, admin = false): Promise<Cipher> {
@@ -604,7 +604,7 @@ export class CipherService implements CipherServiceAbstraction {
reject(e);
}
};
reader.onerror = (evt) => {
reader.onerror = evt => {
reject('Error reading file.');
};
});
@@ -674,7 +674,7 @@ export class CipherService implements CipherServiceAbstraction {
const c = cipher as CipherData;
ciphers[c.id] = c;
} else {
(cipher as CipherData[]).forEach((c) => {
(cipher as CipherData[]).forEach(c => {
ciphers[c.id] = c;
});
}
@@ -704,7 +704,7 @@ export class CipherService implements CipherServiceAbstraction {
ciphers = {};
}
ids.forEach((id) => {
ids.forEach(id => {
if (ciphers.hasOwnProperty(id)) {
ciphers[id].folderId = folderId;
}
@@ -728,7 +728,7 @@ export class CipherService implements CipherServiceAbstraction {
}
delete ciphers[id];
} else {
(id as string[]).forEach((i) => {
(id as string[]).forEach(i => {
delete ciphers[i];
});
}