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:
@@ -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);
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user