1
0
mirror of https://github.com/bitwarden/web synced 2026-01-03 17:13:58 +00:00

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

This commit is contained in:
Matt Gibson
2021-02-03 11:41:33 -06:00
committed by GitHub
parent 5010736ca3
commit 2e7b88f149
68 changed files with 161 additions and 157 deletions

View File

@@ -42,11 +42,11 @@ export class ExposedPasswordsReportComponent extends CipherReportComponent imple
const allCiphers = await this.getAllCiphers();
const exposedPasswordCiphers: CipherView[] = [];
const promises: Promise<void>[] = [];
allCiphers.forEach((c) => {
allCiphers.forEach(c => {
if (c.type !== CipherType.Login || c.login.password == null || c.login.password === '' || c.isDeleted) {
return;
}
const promise = this.auditService.passwordLeaked(c.login.password).then((exposedCount) => {
const promise = this.auditService.passwordLeaked(c.login.password).then(exposedCount => {
if (exposedCount > 0) {
exposedPasswordCiphers.push(c);
this.exposedPasswordMap.set(c.id, exposedCount);

View File

@@ -99,7 +99,7 @@ export class ImportComponent implements OnInit {
return null;
}
const results = this.featuredImportOptions.concat(this.importOptions).filter((o) => o.id === this.format);
const results = this.featuredImportOptions.concat(this.importOptions).filter(o => o.id === this.format);
if (results.length > 0) {
return this.i18nService.t('instructionsFor', results[0].name);
}
@@ -126,7 +126,7 @@ export class ImportComponent implements OnInit {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsText(file, 'utf-8');
reader.onload = (evt) => {
reader.onload = evt => {
if (this.format === 'lastpasscsv' && file.type === 'text/html') {
const parser = new DOMParser();
const doc = parser.parseFromString((evt.target as any).result, 'text/html');

View File

@@ -44,7 +44,7 @@ export class InactiveTwoFactorReportComponent extends CipherReportComponent impl
const inactive2faCiphers: CipherView[] = [];
const promises: Promise<void>[] = [];
const docs = new Map<string, string>();
allCiphers.forEach((c) => {
allCiphers.forEach(c => {
if (c.type !== CipherType.Login || (c.login.totp != null && c.login.totp !== '') || !c.login.hasUris ||
c.isDeleted) {
return;

View File

@@ -36,7 +36,7 @@ export class ReusedPasswordsReportComponent extends CipherReportComponent implem
const allCiphers = await this.getAllCiphers();
const ciphersWithPasswords: CipherView[] = [];
this.passwordUseMap = new Map<string, number>();
allCiphers.forEach((c) => {
allCiphers.forEach(c => {
if (c.type !== CipherType.Login || c.login.password == null || c.login.password === '' || c.isDeleted) {
return;
}
@@ -47,7 +47,7 @@ export class ReusedPasswordsReportComponent extends CipherReportComponent implem
this.passwordUseMap.set(c.login.password, 1);
}
});
const reusedPasswordCiphers = ciphersWithPasswords.filter((c) =>
const reusedPasswordCiphers = ciphersWithPasswords.filter(c =>
this.passwordUseMap.has(c.login.password) && this.passwordUseMap.get(c.login.password) > 1);
this.ciphers = reusedPasswordCiphers;
}

View File

@@ -32,11 +32,11 @@ export class UnsecuredWebsitesReportComponent extends CipherReportComponent impl
async setCiphers() {
const allCiphers = await this.getAllCiphers();
const unsecuredCiphers = allCiphers.filter((c) => {
const unsecuredCiphers = allCiphers.filter(c => {
if (c.type !== CipherType.Login || !c.login.hasUris || c.isDeleted) {
return false;
}
return c.login.uris.some((u) => u.uri != null && u.uri.indexOf('http://') === 0);
return c.login.uris.some(u => u.uri != null && u.uri.indexOf('http://') === 0);
});
this.ciphers = unsecuredCiphers;
}

View File

@@ -39,7 +39,7 @@ export class WeakPasswordsReportComponent extends CipherReportComponent implemen
async setCiphers() {
const allCiphers = await this.getAllCiphers();
const weakPasswordCiphers: CipherView[] = [];
allCiphers.forEach((c) => {
allCiphers.forEach(c => {
if (c.type !== CipherType.Login || c.login.password == null || c.login.password === '' || c.isDeleted) {
return;
}
@@ -52,10 +52,10 @@ export class WeakPasswordsReportComponent extends CipherReportComponent implemen
if (atPosition > -1) {
userInput = userInput.concat(
c.login.username.substr(0, atPosition).trim().toLowerCase().split(/[^A-Za-z0-9]/))
.filter((i) => i.length >= 3);
.filter(i => i.length >= 3);
} else {
userInput = c.login.username.trim().toLowerCase().split(/[^A-Za-z0-9]/)
.filter((i) => i.length >= 3);
.filter(i => i.length >= 3);
}
}
const result = this.passwordGenerationService.passwordStrength(c.login.password,