mirror of
https://github.com/bitwarden/browser
synced 2026-01-06 18:43:25 +00:00
Fix glob processing in npm. Ban single param parens (#257)
This commit is contained in:
@@ -72,13 +72,13 @@ export class CipherData {
|
||||
}
|
||||
|
||||
if (response.fields != null) {
|
||||
this.fields = response.fields.map((f) => new FieldData(f));
|
||||
this.fields = response.fields.map(f => new FieldData(f));
|
||||
}
|
||||
if (response.attachments != null) {
|
||||
this.attachments = response.attachments.map((a) => new AttachmentData(a));
|
||||
this.attachments = response.attachments.map(a => new AttachmentData(a));
|
||||
}
|
||||
if (response.passwordHistory != null) {
|
||||
this.passwordHistory = response.passwordHistory.map((ph) => new PasswordHistoryData(ph));
|
||||
this.passwordHistory = response.passwordHistory.map(ph => new PasswordHistoryData(ph));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ export class LoginData {
|
||||
this.totp = data.totp;
|
||||
|
||||
if (data.uris) {
|
||||
this.uris = data.uris.map((u) => new LoginUriData(u));
|
||||
this.uris = data.uris.map(u => new LoginUriData(u));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,19 +85,19 @@ export class Cipher extends Domain {
|
||||
}
|
||||
|
||||
if (obj.attachments != null) {
|
||||
this.attachments = obj.attachments.map((a) => new Attachment(a, alreadyEncrypted));
|
||||
this.attachments = obj.attachments.map(a => new Attachment(a, alreadyEncrypted));
|
||||
} else {
|
||||
this.attachments = null;
|
||||
}
|
||||
|
||||
if (obj.fields != null) {
|
||||
this.fields = obj.fields.map((f) => new Field(f, alreadyEncrypted));
|
||||
this.fields = obj.fields.map(f => new Field(f, alreadyEncrypted));
|
||||
} else {
|
||||
this.fields = null;
|
||||
}
|
||||
|
||||
if (obj.passwordHistory != null) {
|
||||
this.passwordHistory = obj.passwordHistory.map((ph) => new Password(ph, alreadyEncrypted));
|
||||
this.passwordHistory = obj.passwordHistory.map(ph => new Password(ph, alreadyEncrypted));
|
||||
} else {
|
||||
this.passwordHistory = null;
|
||||
}
|
||||
@@ -135,7 +135,7 @@ export class Cipher extends Domain {
|
||||
await this.attachments.reduce((promise, attachment) => {
|
||||
return promise.then(() => {
|
||||
return attachment.decrypt(orgId, encKey);
|
||||
}).then((decAttachment) => {
|
||||
}).then(decAttachment => {
|
||||
attachments.push(decAttachment);
|
||||
});
|
||||
}, Promise.resolve());
|
||||
@@ -147,7 +147,7 @@ export class Cipher extends Domain {
|
||||
await this.fields.reduce((promise, field) => {
|
||||
return promise.then(() => {
|
||||
return field.decrypt(orgId, encKey);
|
||||
}).then((decField) => {
|
||||
}).then(decField => {
|
||||
fields.push(decField);
|
||||
});
|
||||
}, Promise.resolve());
|
||||
@@ -159,7 +159,7 @@ export class Cipher extends Domain {
|
||||
await this.passwordHistory.reduce((promise, ph) => {
|
||||
return promise.then(() => {
|
||||
return ph.decrypt(orgId, encKey);
|
||||
}).then((decPh) => {
|
||||
}).then(decPh => {
|
||||
passwordHistory.push(decPh);
|
||||
});
|
||||
}, Promise.resolve());
|
||||
@@ -207,13 +207,13 @@ export class Cipher extends Domain {
|
||||
}
|
||||
|
||||
if (this.fields != null) {
|
||||
c.fields = this.fields.map((f) => f.toFieldData());
|
||||
c.fields = this.fields.map(f => f.toFieldData());
|
||||
}
|
||||
if (this.attachments != null) {
|
||||
c.attachments = this.attachments.map((a) => a.toAttachmentData());
|
||||
c.attachments = this.attachments.map(a => a.toAttachmentData());
|
||||
}
|
||||
if (this.passwordHistory != null) {
|
||||
c.passwordHistory = this.passwordHistory.map((ph) => ph.toPasswordHistoryData());
|
||||
c.passwordHistory = this.passwordHistory.map(ph => ph.toPasswordHistoryData());
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ export class Login extends Domain {
|
||||
|
||||
if (obj.uris) {
|
||||
this.uris = [];
|
||||
obj.uris.forEach((u) => {
|
||||
obj.uris.forEach(u => {
|
||||
this.uris.push(new LoginUri(u, alreadyEncrypted));
|
||||
});
|
||||
}
|
||||
@@ -65,7 +65,7 @@ export class Login extends Domain {
|
||||
|
||||
if (this.uris != null && this.uris.length > 0) {
|
||||
l.uris = [];
|
||||
this.uris.forEach((u) => {
|
||||
this.uris.forEach(u => {
|
||||
l.uris.push(u.toLoginUriData());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ export class Cipher {
|
||||
view.favorite = req.favorite;
|
||||
|
||||
if (req.fields != null) {
|
||||
view.fields = req.fields.map((f) => Field.toView(f));
|
||||
view.fields = req.fields.map(f => Field.toView(f));
|
||||
}
|
||||
|
||||
switch (req.type) {
|
||||
@@ -71,7 +71,7 @@ export class Cipher {
|
||||
domain.favorite = req.favorite;
|
||||
|
||||
if (req.fields != null) {
|
||||
domain.fields = req.fields.map((f) => Field.toDomain(f));
|
||||
domain.fields = req.fields.map(f => Field.toDomain(f));
|
||||
}
|
||||
|
||||
switch (req.type) {
|
||||
@@ -122,9 +122,9 @@ export class Cipher {
|
||||
|
||||
if (o.fields != null) {
|
||||
if (o instanceof CipherView) {
|
||||
this.fields = o.fields.map((f) => new Field(f));
|
||||
this.fields = o.fields.map(f => new Field(f));
|
||||
} else {
|
||||
this.fields = o.fields.map((f) => new Field(f));
|
||||
this.fields = o.fields.map(f => new Field(f));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ export class Login {
|
||||
|
||||
static toView(req: Login, view = new LoginView()) {
|
||||
if (req.uris != null) {
|
||||
view.uris = req.uris.map((u) => LoginUri.toView(u));
|
||||
view.uris = req.uris.map(u => LoginUri.toView(u));
|
||||
}
|
||||
view.username = req.username;
|
||||
view.password = req.password;
|
||||
@@ -27,7 +27,7 @@ export class Login {
|
||||
|
||||
static toDomain(req: Login, domain = new LoginDomain()) {
|
||||
if (req.uris != null) {
|
||||
domain.uris = req.uris.map((u) => LoginUri.toDomain(u));
|
||||
domain.uris = req.uris.map(u => LoginUri.toDomain(u));
|
||||
}
|
||||
domain.username = req.username != null ? new CipherString(req.username) : null;
|
||||
domain.password = req.password != null ? new CipherString(req.password) : null;
|
||||
@@ -47,9 +47,9 @@ export class Login {
|
||||
|
||||
if (o.uris != null) {
|
||||
if (o instanceof LoginView) {
|
||||
this.uris = o.uris.map((u) => new LoginUri(u));
|
||||
this.uris = o.uris.map(u => new LoginUri(u));
|
||||
} else {
|
||||
this.uris = o.uris.map((u) => new LoginUri(u));
|
||||
this.uris = o.uris.map(u => new LoginUri(u));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ export class CipherBulkShareRequest {
|
||||
constructor(ciphers: Cipher[], collectionIds: string[]) {
|
||||
if (ciphers != null) {
|
||||
this.ciphers = [];
|
||||
ciphers.forEach((c) => {
|
||||
ciphers.forEach(c => {
|
||||
this.ciphers.push(new CipherWithIdRequest(c));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ export class CipherRequest {
|
||||
this.login.totp = cipher.login.totp ? cipher.login.totp.encryptedString : null;
|
||||
|
||||
if (cipher.login.uris != null) {
|
||||
this.login.uris = cipher.login.uris.map((u) => {
|
||||
this.login.uris = cipher.login.uris.map(u => {
|
||||
const uri = new LoginUriApi();
|
||||
uri.uri = u.uri != null ? u.uri.encryptedString : null;
|
||||
uri.match = u.match != null ? u.match : null;
|
||||
@@ -110,7 +110,7 @@ export class CipherRequest {
|
||||
}
|
||||
|
||||
if (cipher.fields != null) {
|
||||
this.fields = cipher.fields.map((f) => {
|
||||
this.fields = cipher.fields.map(f => {
|
||||
const field = new FieldApi();
|
||||
field.type = f.type;
|
||||
field.name = f.name ? f.name.encryptedString : null;
|
||||
@@ -121,7 +121,7 @@ export class CipherRequest {
|
||||
|
||||
if (cipher.passwordHistory != null) {
|
||||
this.passwordHistory = [];
|
||||
cipher.passwordHistory.forEach((ph) => {
|
||||
cipher.passwordHistory.forEach(ph => {
|
||||
this.passwordHistory.push({
|
||||
lastUsedDate: ph.lastUsedDate,
|
||||
password: ph.password ? ph.password.encryptedString : null,
|
||||
@@ -132,7 +132,7 @@ export class CipherRequest {
|
||||
if (cipher.attachments != null) {
|
||||
this.attachments = {};
|
||||
this.attachments2 = {};
|
||||
cipher.attachments.forEach((attachment) => {
|
||||
cipher.attachments.forEach(attachment => {
|
||||
const fileName = attachment.fileName ? attachment.fileName.encryptedString : null;
|
||||
this.attachments[attachment.id] = fileName;
|
||||
const attachmentRequest = new AttachmentRequest();
|
||||
|
||||
@@ -32,7 +32,7 @@ export class LoginView implements View {
|
||||
}
|
||||
|
||||
get canLaunch(): boolean {
|
||||
return this.hasUris && this.uris.some((u) => u.canLaunch);
|
||||
return this.hasUris && this.uris.some(u => u.canLaunch);
|
||||
}
|
||||
|
||||
get hasTotp(): boolean {
|
||||
@@ -41,7 +41,7 @@ export class LoginView implements View {
|
||||
|
||||
get launchUri(): string {
|
||||
if (this.hasUris) {
|
||||
const uri = this.uris.find((u) => u.canLaunch);
|
||||
const uri = this.uris.find(u => u.canLaunch);
|
||||
if (uri != null) {
|
||||
return uri.launchUri;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user