1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-12 06:23:38 +00:00

Switching from ternary to if/else

This commit is contained in:
Tom
2024-12-10 10:47:23 -05:00
parent 847668e2a8
commit b4fc8c7602

View File

@@ -130,12 +130,15 @@ export class RiskInsightsReportService {
const weakPassword = this.findWeakPassword(cipher);
// Looping over all ciphers needs to happen first to determine reused passwords over all ciphers.
// Store in the set and evaluate later
passwordUseMap.has(cipher.login.password)
? passwordUseMap.set(
cipher.login.password,
(passwordUseMap.get(cipher.login.password) || 0) + 1,
)
: passwordUseMap.set(cipher.login.password, 1);
if (passwordUseMap.has(cipher.login.password)) {
passwordUseMap.set(
cipher.login.password,
(passwordUseMap.get(cipher.login.password) || 0) + 1,
);
} else {
passwordUseMap.set(cipher.login.password, 1);
}
const exposedPassword = await this.findExposedPassword(cipher);
// Get the cipher members