Add trailing comma to all the things

This commit is contained in:
Ilya Ig. Petrov 2019-02-26 14:59:33 +00:00
parent 5d64e445fc
commit 26fc0c4de3

View File

@ -58,7 +58,7 @@
}; };
const setPacAsync = function setPacAsync( const setPacAsync = function setPacAsync(
pacData = mandatory(), cb = throwIfError pacData = mandatory(), cb = throwIfError,
) { ) {
const config = { const config = {
@ -80,7 +80,7 @@
console.warn('Failed, other extension is in control.'); console.warn('Failed, other extension is in control.');
return cb( return cb(
new Error( window.utils.messages.whichExtensionHtml() ) new Error( window.utils.messages.whichExtensionHtml() ),
); );
} }
@ -99,20 +99,20 @@
cb = asyncLogGroup( cb = asyncLogGroup(
'Getting IPs for PAC hosts...', 'Getting IPs for PAC hosts...',
cb cb,
); );
window.utils.fireRequest('ip-to-host-update-all', cb); window.utils.fireRequest('ip-to-host-update-all', cb);
}; };
const setPacScriptFromProviderAsync = function setPacScriptFromProviderAsync( const setPacScriptFromProviderAsync = function setPacScriptFromProviderAsync(
provider, lastModifiedStr = mandatory(), cb = throwIfError provider, lastModifiedStr = mandatory(), cb = throwIfError,
) { ) {
const pacUrl = provider.pacUrls[0]; const pacUrl = provider.pacUrls[0];
cb = asyncLogGroup( cb = asyncLogGroup(
'Getting PAC script from provider...', pacUrl, 'Getting PAC script from provider...', pacUrl,
cb cb,
); );
const warnings = []; const warnings = [];
@ -143,7 +143,7 @@
addWarning( addWarning(
'Ваш PAC-скрипт не нуждается в обновлении. Его дата: ' + 'Ваш PAC-скрипт не нуждается в обновлении. Его дата: ' +
lastModifiedStr lastModifiedStr,
); );
const res = {lastModified: lastModifiedStr}; const res = {lastModified: lastModifiedStr};
return cb(null, res); return cb(null, res);
@ -156,11 +156,11 @@
() => new Promise( () => new Promise(
(resolve, reject) => httpLib.get( (resolve, reject) => httpLib.get(
url, url,
(newErr, pacData) => newErr ? reject(newErr) : resolve(pacData) (newErr, pacData) => newErr ? reject(newErr) : resolve(pacData),
) ),
) ),
), ),
Promise.reject() Promise.reject(),
); );
pacDataPromise.then( pacDataPromise.then(
@ -172,7 +172,7 @@
(err, res) => cb( (err, res) => cb(
err, err,
Object.assign(res || {}, {lastModified: newLastModifiedStr}), Object.assign(res || {}, {lastModified: newLastModifiedStr}),
) ),
); );
}, },
@ -229,7 +229,7 @@
order: 99, order: 99,
pacUrls: [ pacUrls: [
'data:application/x-ns-proxy-autoconfig,' + escape('function FindProxyForURL(){ return "DIRECT"; }'), 'data:application/x-ns-proxy-autoconfig,' + escape('function FindProxyForURL(){ return "DIRECT"; }'),
] ],
} }
}, },
@ -290,7 +290,7 @@
setCurrentPacProviderKey( setCurrentPacProviderKey(
newKey = mandatory(), newKey = mandatory(),
lastModified = new Date().toUTCString() lastModified = new Date().toUTCString(),
) { ) {
this.mustBeKey(newKey); this.mustBeKey(newKey);
@ -330,7 +330,7 @@
chrome.storage.local.clear( chrome.storage.local.clear(
() => chrome.storage.local.set( () => chrome.storage.local.set(
onlySettable, onlySettable,
chromified(cb) chromified(cb),
) )
); );
@ -374,8 +374,8 @@
const ipsErrorPromise = new Promise( const ipsErrorPromise = new Promise(
(resolve, reject) => updatePacProxyIps( (resolve, reject) => updatePacProxyIps(
resolve resolve,
) ),
); );
Promise.all([pacSetPromise, ipsErrorPromise]).then( Promise.all([pacSetPromise, ipsErrorPromise]).then(
@ -389,7 +389,7 @@
warns.push(ipsErr); warns.push(ipsErr);
} }
this.pushToStorageAsync( this.pushToStorageAsync(
(pushErr) => cb(pacErr || pushErr, null, ...warns) (pushErr) => cb(pacErr || pushErr, null, ...warns),
); );
}, },
@ -416,7 +416,7 @@
console.log( console.log(
'Next PAC update is scheduled on', 'Next PAC update is scheduled on',
new Date(nextUpdateMoment).toLocaleString('ru-RU') new Date(nextUpdateMoment).toLocaleString('ru-RU'),
); );
chrome.alarms.create( chrome.alarms.create(
@ -459,11 +459,11 @@
} }
this.setCurrentPacProviderKey(null); this.setCurrentPacProviderKey(null);
this.pushToStorageAsync( this.pushToStorageAsync(
() => handlers.updateControlState(cb) () => handlers.updateControlState(cb),
); );
}) }),
) ),
); );
}, },
@ -491,7 +491,7 @@
if (alarm.name === antiCensorRu._periodicUpdateAlarmReason) { if (alarm.name === antiCensorRu._periodicUpdateAlarmReason) {
console.log( console.log(
'Periodic PAC update triggered:', 'Periodic PAC update triggered:',
new Date().toLocaleString('ru-RU') new Date().toLocaleString('ru-RU'),
); );
antiCensorRu.syncWithPacProviderAsync(() => {/* swallow */}); antiCensorRu.syncWithPacProviderAsync(() => {/* swallow */});
} }
@ -531,7 +531,7 @@
|| antiCensorRu._currentPacProviderLastModified; || antiCensorRu._currentPacProviderLastModified;
console.log( console.log(
'Last PAC update was on', 'Last PAC update was on',
new Date(antiCensorRu.lastPacUpdateStamp).toLocaleString('ru-RU') new Date(antiCensorRu.lastPacUpdateStamp).toLocaleString('ru-RU'),
); );