Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit f62da66

Browse files
committed
feedback
1 parent a981a76 commit f62da66

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

CodePush.js

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ async function checkForUpdate(deploymentKey = null) {
1717
* for their specific deployment and version and which are actually
1818
* different from the CodePush update they have already installed.
1919
*/
20-
let nativeConfig = await getConfiguration();
20+
const nativeConfig = await getConfiguration();
2121
/*
2222
* If a deployment key was explicitly provided,
2323
* then let's override the one we retrieved
2424
* from the native-side of the app. This allows
2525
* dynamically "redirecting" end-users at different
2626
* deployments (e.g. an early access deployment for insiders).
2727
*/
28-
let config = deploymentKey ? { ...nativeConfig, ...{ deploymentKey } }
28+
const config = deploymentKey ? { ...nativeConfig, ...{ deploymentKey } }
2929
: nativeConfig;
30-
let sdk = getPromisifiedSdk(requestFetchAdapter, config);
30+
const sdk = getPromisifiedSdk(requestFetchAdapter, config);
3131
// Use dynamically overridden getCurrentPackage() during tests.
32-
let localPackage = await module.exports.getCurrentPackage();
32+
const localPackage = await module.exports.getCurrentPackage();
3333
/*
3434
* If the app has a previously installed update, and that update
3535
* was targetted at the same app version that is currently running,
@@ -38,10 +38,10 @@ async function checkForUpdate(deploymentKey = null) {
3838
* to send the app version to the server, since we are interested
3939
* in any updates for current app store version, regardless of hash.
4040
*/
41-
let queryPackage = localPackage && localPackage.appVersion && semver.compare(localPackage.appVersion, config.appVersion) === 0
41+
const queryPackage = localPackage && localPackage.appVersion && semver.compare(localPackage.appVersion, config.appVersion) === 0
4242
? localPackage
4343
: { appVersion: config.appVersion };
44-
let update = await sdk.queryUpdateWithCurrentPackage(queryPackage);
44+
const update = await sdk.queryUpdateWithCurrentPackage(queryPackage);
4545
/*
4646
* There are three cases where checkForUpdate will resolve to null:
4747
* ----------------------------------------------------------------
@@ -257,16 +257,16 @@ async function sync(options = {}, syncStatusChangeCallback, downloadProgressCall
257257
}
258258
};
259259

260-
var CodePush = {
260+
export default {
261261
AcquisitionSdk: Sdk,
262-
checkForUpdate: checkForUpdate,
263-
getConfiguration: getConfiguration,
264-
getCurrentPackage: getCurrentPackage,
265-
log: log,
262+
checkForUpdate,
263+
getConfiguration,
264+
getCurrentPackage,
265+
log,
266266
notifyApplicationReady: NativeCodePush.notifyApplicationReady,
267267
restartApp: NativeCodePush.restartApp,
268-
setUpTestDependencies: setUpTestDependencies,
269-
sync: sync,
268+
setUpTestDependencies,
269+
sync,
270270
InstallMode: {
271271
IMMEDIATE: NativeCodePush.codePushInstallModeImmediate, // Restart the app immediately
272272
ON_NEXT_RESTART: NativeCodePush.codePushInstallModeOnNextRestart, // Don't artificially restart the app. Allow the update to be "picked up" on the next app restart
@@ -293,5 +293,3 @@ var CodePush = {
293293
title: "Update available"
294294
}
295295
};
296-
297-
export default CodePush;

0 commit comments

Comments
 (0)