Upgrade Prettier

This commit is contained in:
Ken Powers
2020-01-08 12:44:54 -05:00
committed by Scott Nonnenberg
parent d14c8e2277
commit 0d3b390129
57 changed files with 1074 additions and 1574 deletions

View File

@@ -1198,9 +1198,7 @@ MessageReceiver.prototype.extend({
if (!_.isNumber(size)) {
throw new Error(
`downloadAttachment: Size was not provided, actual size was ${
data.byteLength
}`
`downloadAttachment: Size was not provided, actual size was ${data.byteLength}`
);
}
@@ -1251,11 +1249,7 @@ MessageReceiver.prototype.extend({
if (envelopeTimestamp !== decryptedTimestamp) {
throw new Error(
`Timestamp ${
decrypted.timestamp
} in DataMessage did not match envelope timestamp ${
envelope.timestamp
}`
`Timestamp ${decrypted.timestamp} in DataMessage did not match envelope timestamp ${envelope.timestamp}`
);
}
}

View File

@@ -207,7 +207,7 @@ OutgoingMessage.prototype = {
}
return promise.catch(e => {
if (e.name === 'HTTPError' && (e.code !== 409 && e.code !== 410)) {
if (e.name === 'HTTPError' && e.code !== 409 && e.code !== 410) {
// 409 and 410 should bubble and be handled by doSendMessage
// 404 should throw UnregisteredUserError
// all other network errors can be retried later.

View File

@@ -18,9 +18,7 @@
}
const protos = result.build('signalservice');
if (!protos) {
const text = `Error loading protos from ${filename} (root: ${
window.PROTO_ROOT
})`;
const text = `Error loading protos from ${filename} (root: ${window.PROTO_ROOT})`;
window.log.error(text);
throw new Error(text);
}

View File

@@ -209,9 +209,7 @@ MessageSender.prototype = {
}
if (data.byteLength !== size) {
throw new Error(
`makeAttachmentPointer: Size ${size} did not match data.byteLength ${
data.byteLength
}`
`makeAttachmentPointer: Size ${size} did not match data.byteLength ${data.byteLength}`
);
}

View File

@@ -6,12 +6,13 @@
(function() {
window.StringView = {
/*
* These functions from the Mozilla Developer Network
* and have been placed in the public domain.
* https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding
* https://developer.mozilla.org/en-US/docs/MDN/About#Copyrights_and_licenses
*/
* These functions from the Mozilla Developer Network
* and have been placed in the public domain.
* https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding
* https://developer.mozilla.org/en-US/docs/MDN/About#Copyrights_and_licenses
*/
// prettier-ignore
b64ToUint6(nChr) {
return nChr > 64 && nChr < 91
? nChr - 65
@@ -59,6 +60,7 @@
return aBBytes;
},
// prettier-ignore
uint6ToB64(nUint6) {
return nUint6 < 26
? nUint6 + 65
@@ -82,7 +84,7 @@
nIdx += 1
) {
nMod3 = nIdx % 3;
if (nIdx > 0 && (nIdx * 4 / 3) % 76 === 0) {
if (nIdx > 0 && ((nIdx * 4) / 3) % 76 === 0) {
sB64Enc += '\r\n';
}
nUint24 |= aBytes[nIdx] << ((16 >>> nMod3) & 24);

View File

@@ -24,10 +24,10 @@
receiver.addEventListener('groupsync', this.ongroup);
const ourNumber = textsecure.storage.user.getNumber();
const { wrap, sendOptions } = ConversationController.prepareForSend(
ourNumber,
{ syncMessage: true }
);
const {
wrap,
sendOptions,
} = ConversationController.prepareForSend(ourNumber, { syncMessage: true });
window.log.info('SyncRequest created. Sending config sync request...');
wrap(sender.sendRequestConfigurationSyncMessage(sendOptions));

View File

@@ -50,12 +50,12 @@ describe('Key generation', function thisNeeded() {
describe('the first time', () => {
let result;
/* result should have this format
* {
* preKeys: [ { keyId, publicKey }, ... ],
* signedPreKey: { keyId, publicKey, signature },
* identityKey: <ArrayBuffer>
* }
*/
* {
* preKeys: [ { keyId, publicKey }, ... ],
* signedPreKey: { keyId, publicKey, signature },
* identityKey: <ArrayBuffer>
* }
*/
before(() => {
const accountManager = new textsecure.AccountManager('');
return accountManager.generateKeys(count).then(res => {

View File

@@ -3,26 +3,26 @@
// eslint-disable-next-line func-names
(function() {
/*
* WebSocket-Resources
*
* Create a request-response interface over websockets using the
* WebSocket-Resources sub-protocol[1].
*
* var client = new WebSocketResource(socket, function(request) {
* request.respond(200, 'OK');
* });
*
* client.sendRequest({
* verb: 'PUT',
* path: '/v1/messages',
* body: '{ some: "json" }',
* success: function(message, status, request) {...},
* error: function(message, status, request) {...}
* });
*
* 1. https://github.com/signalapp/WebSocket-Resources
*
*/
* WebSocket-Resources
*
* Create a request-response interface over websockets using the
* WebSocket-Resources sub-protocol[1].
*
* var client = new WebSocketResource(socket, function(request) {
* request.respond(200, 'OK');
* });
*
* client.sendRequest({
* verb: 'PUT',
* path: '/v1/messages',
* body: '{ some: "json" }',
* success: function(message, status, request) {...},
* error: function(message, status, request) {...}
* });
*
* 1. https://github.com/signalapp/WebSocket-Resources
*
*/
const Request = function Request(options) {
this.verb = options.verb || options.type;