mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 09:43:23 +00:00
[deps] Autofill: Update prettier to v3 (#7014)
* [deps] Autofill: Update prettier to v3 * prettier formatting updates --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>
This commit is contained in:
@@ -33,7 +33,7 @@ export class LoginApi extends BaseResponse {
|
||||
const fido2Credentials = this.getResponseProperty("Fido2Credentials");
|
||||
if (fido2Credentials != null) {
|
||||
this.fido2Credentials = fido2Credentials.map(
|
||||
(key: JsonObject) => new Fido2CredentialApi(key)
|
||||
(key: JsonObject) => new Fido2CredentialApi(key),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ describe("Attachment", () => {
|
||||
|
||||
(window as any).bitwardenContainerService = new ContainerService(
|
||||
cryptoService,
|
||||
encryptService
|
||||
encryptService,
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ export class Attachment extends Domain {
|
||||
fileName: null,
|
||||
key: null,
|
||||
},
|
||||
["id", "url", "sizeName"]
|
||||
["id", "url", "sizeName"],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ export class Attachment extends Domain {
|
||||
fileName: null,
|
||||
},
|
||||
orgId,
|
||||
encKey
|
||||
encKey,
|
||||
);
|
||||
|
||||
if (this.key != null) {
|
||||
@@ -87,7 +87,7 @@ export class Attachment extends Domain {
|
||||
fileName: null,
|
||||
key: null,
|
||||
},
|
||||
["id", "url", "sizeName"]
|
||||
["id", "url", "sizeName"],
|
||||
);
|
||||
return a;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ export class Card extends Domain {
|
||||
expYear: null,
|
||||
code: null,
|
||||
},
|
||||
[]
|
||||
[],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ export class Card extends Domain {
|
||||
code: null,
|
||||
},
|
||||
orgId,
|
||||
encKey
|
||||
encKey,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -230,11 +230,11 @@ describe("Cipher DTO", () => {
|
||||
|
||||
(window as any).bitwardenContainerService = new ContainerService(
|
||||
cryptoService,
|
||||
encryptService
|
||||
encryptService,
|
||||
);
|
||||
|
||||
const cipherView = await cipher.decrypt(
|
||||
await cipherService.getKeyForCipherKeyDecryption(cipher)
|
||||
await cipherService.getKeyForCipherKeyDecryption(cipher),
|
||||
);
|
||||
|
||||
expect(cipherView).toMatchObject({
|
||||
@@ -350,11 +350,11 @@ describe("Cipher DTO", () => {
|
||||
|
||||
(window as any).bitwardenContainerService = new ContainerService(
|
||||
cryptoService,
|
||||
encryptService
|
||||
encryptService,
|
||||
);
|
||||
|
||||
const cipherView = await cipher.decrypt(
|
||||
await cipherService.getKeyForCipherKeyDecryption(cipher)
|
||||
await cipherService.getKeyForCipherKeyDecryption(cipher),
|
||||
);
|
||||
|
||||
expect(cipherView).toMatchObject({
|
||||
@@ -488,11 +488,11 @@ describe("Cipher DTO", () => {
|
||||
|
||||
(window as any).bitwardenContainerService = new ContainerService(
|
||||
cryptoService,
|
||||
encryptService
|
||||
encryptService,
|
||||
);
|
||||
|
||||
const cipherView = await cipher.decrypt(
|
||||
await cipherService.getKeyForCipherKeyDecryption(cipher)
|
||||
await cipherService.getKeyForCipherKeyDecryption(cipher),
|
||||
);
|
||||
|
||||
expect(cipherView).toMatchObject({
|
||||
@@ -650,11 +650,11 @@ describe("Cipher DTO", () => {
|
||||
|
||||
(window as any).bitwardenContainerService = new ContainerService(
|
||||
cryptoService,
|
||||
encryptService
|
||||
encryptService,
|
||||
);
|
||||
|
||||
const cipherView = await cipher.decrypt(
|
||||
await cipherService.getKeyForCipherKeyDecryption(cipher)
|
||||
await cipherService.getKeyForCipherKeyDecryption(cipher),
|
||||
);
|
||||
|
||||
expect(cipherView).toMatchObject({
|
||||
|
||||
@@ -65,7 +65,7 @@ export class Cipher extends Domain implements Decryptable<CipherView> {
|
||||
notes: null,
|
||||
key: null,
|
||||
},
|
||||
["id", "organizationId", "folderId"]
|
||||
["id", "organizationId", "folderId"],
|
||||
);
|
||||
|
||||
this.type = obj.type;
|
||||
@@ -138,7 +138,7 @@ export class Cipher extends Domain implements Decryptable<CipherView> {
|
||||
notes: null,
|
||||
},
|
||||
this.organizationId,
|
||||
encKey
|
||||
encKey,
|
||||
);
|
||||
|
||||
switch (this.type) {
|
||||
|
||||
@@ -30,7 +30,7 @@ export class Collection extends Domain {
|
||||
hidePasswords: null,
|
||||
manage: null,
|
||||
},
|
||||
["id", "organizationId", "externalId", "readOnly", "hidePasswords", "manage"]
|
||||
["id", "organizationId", "externalId", "readOnly", "hidePasswords", "manage"],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ export class Collection extends Domain {
|
||||
{
|
||||
name: null,
|
||||
},
|
||||
this.organizationId
|
||||
this.organizationId,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ export class Fido2Credential extends Domain {
|
||||
userDisplayName: null,
|
||||
discoverable: null,
|
||||
},
|
||||
[]
|
||||
[],
|
||||
);
|
||||
this.creationDate = obj.creationDate != null ? new Date(obj.creationDate) : null;
|
||||
}
|
||||
@@ -66,7 +66,7 @@ export class Fido2Credential extends Domain {
|
||||
discoverable: null,
|
||||
},
|
||||
orgId,
|
||||
encKey
|
||||
encKey,
|
||||
);
|
||||
|
||||
const { counter } = await this.decryptObj(
|
||||
@@ -75,7 +75,7 @@ export class Fido2Credential extends Domain {
|
||||
counter: null,
|
||||
},
|
||||
orgId,
|
||||
encKey
|
||||
encKey,
|
||||
);
|
||||
// Counter will end up as NaN if this fails
|
||||
view.counter = parseInt(counter);
|
||||
@@ -86,7 +86,7 @@ export class Fido2Credential extends Domain {
|
||||
discoverable: null,
|
||||
},
|
||||
orgId,
|
||||
encKey
|
||||
encKey,
|
||||
);
|
||||
view.discoverable = discoverable === "true";
|
||||
view.creationDate = this.creationDate;
|
||||
|
||||
@@ -28,7 +28,7 @@ export class Field extends Domain {
|
||||
name: null,
|
||||
value: null,
|
||||
},
|
||||
[]
|
||||
[],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ export class Field extends Domain {
|
||||
value: null,
|
||||
},
|
||||
orgId,
|
||||
encKey
|
||||
encKey,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ export class Field extends Domain {
|
||||
type: null,
|
||||
linkedId: null,
|
||||
},
|
||||
["type", "linkedId"]
|
||||
["type", "linkedId"],
|
||||
);
|
||||
return f;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ export class Folder extends Domain {
|
||||
id: null,
|
||||
name: null,
|
||||
},
|
||||
["id"]
|
||||
["id"],
|
||||
);
|
||||
|
||||
this.revisionDate = obj.revisionDate != null ? new Date(obj.revisionDate) : null;
|
||||
@@ -35,7 +35,7 @@ export class Folder extends Domain {
|
||||
{
|
||||
name: null,
|
||||
},
|
||||
null
|
||||
null,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ export class Identity extends Domain {
|
||||
passportNumber: null,
|
||||
licenseNumber: null,
|
||||
},
|
||||
[]
|
||||
[],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ export class Identity extends Domain {
|
||||
licenseNumber: null,
|
||||
},
|
||||
orgId,
|
||||
encKey
|
||||
encKey,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ export class LoginUri extends Domain {
|
||||
{
|
||||
uri: null,
|
||||
},
|
||||
[]
|
||||
[],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ export class LoginUri extends Domain {
|
||||
uri: null,
|
||||
},
|
||||
orgId,
|
||||
encKey
|
||||
encKey,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ export class LoginUri extends Domain {
|
||||
uri: null,
|
||||
match: null,
|
||||
},
|
||||
["match"]
|
||||
["match"],
|
||||
);
|
||||
return u;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ export class Login extends Domain {
|
||||
password: null,
|
||||
totp: null,
|
||||
},
|
||||
[]
|
||||
[],
|
||||
);
|
||||
|
||||
if (obj.uris) {
|
||||
@@ -59,7 +59,7 @@ export class Login extends Domain {
|
||||
totp: null,
|
||||
},
|
||||
orgId,
|
||||
encKey
|
||||
encKey,
|
||||
);
|
||||
|
||||
if (this.uris != null) {
|
||||
@@ -72,7 +72,7 @@ export class Login extends Domain {
|
||||
|
||||
if (this.fido2Credentials != null) {
|
||||
view.fido2Credentials = await Promise.all(
|
||||
this.fido2Credentials.map((key) => key.decrypt(orgId, encKey))
|
||||
this.fido2Credentials.map((key) => key.decrypt(orgId, encKey)),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ export class Password extends Domain {
|
||||
password: null,
|
||||
},
|
||||
orgId,
|
||||
encKey
|
||||
encKey,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ export class SortedCiphersCache {
|
||||
setTimeout(() => {
|
||||
this.sortedCiphersByUrl.delete(url);
|
||||
this.timeouts.delete(url);
|
||||
}, CacheTTL)
|
||||
}, CacheTTL),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,7 @@ class Ciphers {
|
||||
getLastLaunched() {
|
||||
const usedCiphers = this.ciphers.filter((cipher) => cipher.localData?.lastLaunched);
|
||||
const sortedCiphers = usedCiphers.sort(
|
||||
(x, y) => y.localData.lastLaunched.valueOf() - x.localData.lastLaunched.valueOf()
|
||||
(x, y) => y.localData.lastLaunched.valueOf() - x.localData.lastLaunched.valueOf(),
|
||||
);
|
||||
return sortedCiphers[0];
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ export class CardView extends ItemView {
|
||||
// Updated for Mastercard 2017 BINs expansion
|
||||
if (
|
||||
/^(5[1-5][0-9]{14}|2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12}))$/.test(
|
||||
cardNum
|
||||
cardNum,
|
||||
)
|
||||
) {
|
||||
return "Mastercard";
|
||||
@@ -112,7 +112,7 @@ export class CardView extends ItemView {
|
||||
|
||||
// Discover
|
||||
re = new RegExp(
|
||||
"^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)"
|
||||
"^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)",
|
||||
);
|
||||
if (cardNum.match(re) != null) {
|
||||
return "Discover";
|
||||
|
||||
@@ -35,7 +35,7 @@ export class CollectionView implements View, ITreeNodeObject {
|
||||
canEdit(org: Organization): boolean {
|
||||
if (org.id !== this.organizationId) {
|
||||
throw new Error(
|
||||
"Id of the organization provided does not match the org id of the collection."
|
||||
"Id of the organization provided does not match the org id of the collection.",
|
||||
);
|
||||
}
|
||||
return org?.canEditAnyCollection || org?.canEditAssignedCollections;
|
||||
@@ -45,7 +45,7 @@ export class CollectionView implements View, ITreeNodeObject {
|
||||
canDelete(org: Organization, flexibleCollectionsEnabled: boolean): boolean {
|
||||
if (org.id !== this.organizationId) {
|
||||
throw new Error(
|
||||
"Id of the organization provided does not match the org id of the collection."
|
||||
"Id of the organization provided does not match the org id of the collection.",
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ describe("LoginUriView", () => {
|
||||
const uri = uriFactory(UriMatchType.Domain, exampleUris.standard);
|
||||
const actual = uri.matchesUri(
|
||||
exampleUris.differentDomain,
|
||||
exampleUris.noEquivalentDomains()
|
||||
exampleUris.noEquivalentDomains(),
|
||||
);
|
||||
expect(actual).toBe(false);
|
||||
});
|
||||
@@ -136,7 +136,7 @@ describe("LoginUriView", () => {
|
||||
const uri = uriFactory(UriMatchType.Exact, exampleUris.standard);
|
||||
const actual = uri.matchesUri(
|
||||
exampleUris.standard + "#",
|
||||
exampleUris.noEquivalentDomains()
|
||||
exampleUris.noEquivalentDomains(),
|
||||
);
|
||||
expect(actual).toBe(false);
|
||||
});
|
||||
@@ -147,7 +147,7 @@ describe("LoginUriView", () => {
|
||||
const uri = uriFactory(UriMatchType.StartsWith, exampleUris.standard);
|
||||
const actual = uri.matchesUri(
|
||||
exampleUris.standard + "#bookmark",
|
||||
exampleUris.noEquivalentDomains()
|
||||
exampleUris.noEquivalentDomains(),
|
||||
);
|
||||
expect(actual).toBe(true);
|
||||
});
|
||||
@@ -156,7 +156,7 @@ describe("LoginUriView", () => {
|
||||
const uri = uriFactory(UriMatchType.StartsWith, exampleUris.standard);
|
||||
const actual = uri.matchesUri(
|
||||
exampleUris.standard.slice(1),
|
||||
exampleUris.noEquivalentDomains()
|
||||
exampleUris.noEquivalentDomains(),
|
||||
);
|
||||
expect(actual).toBe(false);
|
||||
});
|
||||
|
||||
@@ -113,7 +113,7 @@ export class LoginUriView implements View {
|
||||
matchesUri(
|
||||
targetUri: string,
|
||||
equivalentDomains: Set<string>,
|
||||
defaultUriMatch: UriMatchType = null
|
||||
defaultUriMatch: UriMatchType = null,
|
||||
): boolean {
|
||||
if (!this.uri || !targetUri) {
|
||||
return false;
|
||||
|
||||
@@ -72,7 +72,7 @@ export class LoginView extends ItemView {
|
||||
matchesUri(
|
||||
targetUri: string,
|
||||
equivalentDomains: Set<string>,
|
||||
defaultUriMatch: UriMatchType = null
|
||||
defaultUriMatch: UriMatchType = null,
|
||||
): boolean {
|
||||
if (this.uris == null) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user