@@ -17,19 +17,19 @@ async function checkForUpdate(deploymentKey = null) {
17
17
* for their specific deployment and version and which are actually
18
18
* different from the CodePush update they have already installed.
19
19
*/
20
- let nativeConfig = await getConfiguration ( ) ;
20
+ const nativeConfig = await getConfiguration ( ) ;
21
21
/*
22
22
* If a deployment key was explicitly provided,
23
23
* then let's override the one we retrieved
24
24
* from the native-side of the app. This allows
25
25
* dynamically "redirecting" end-users at different
26
26
* deployments (e.g. an early access deployment for insiders).
27
27
*/
28
- let config = deploymentKey ? { ...nativeConfig , ...{ deploymentKey } }
28
+ const config = deploymentKey ? { ...nativeConfig , ...{ deploymentKey } }
29
29
: nativeConfig ;
30
- let sdk = getPromisifiedSdk ( requestFetchAdapter , config ) ;
30
+ const sdk = getPromisifiedSdk ( requestFetchAdapter , config ) ;
31
31
// Use dynamically overridden getCurrentPackage() during tests.
32
- let localPackage = await module . exports . getCurrentPackage ( ) ;
32
+ const localPackage = await module . exports . getCurrentPackage ( ) ;
33
33
/*
34
34
* If the app has a previously installed update, and that update
35
35
* was targetted at the same app version that is currently running,
@@ -38,10 +38,10 @@ async function checkForUpdate(deploymentKey = null) {
38
38
* to send the app version to the server, since we are interested
39
39
* in any updates for current app store version, regardless of hash.
40
40
*/
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
42
42
? localPackage
43
43
: { appVersion : config . appVersion } ;
44
- let update = await sdk . queryUpdateWithCurrentPackage ( queryPackage ) ;
44
+ const update = await sdk . queryUpdateWithCurrentPackage ( queryPackage ) ;
45
45
/*
46
46
* There are three cases where checkForUpdate will resolve to null:
47
47
* ----------------------------------------------------------------
@@ -257,16 +257,16 @@ async function sync(options = {}, syncStatusChangeCallback, downloadProgressCall
257
257
}
258
258
} ;
259
259
260
- var CodePush = {
260
+ export default {
261
261
AcquisitionSdk : Sdk ,
262
- checkForUpdate : checkForUpdate ,
263
- getConfiguration : getConfiguration ,
264
- getCurrentPackage : getCurrentPackage ,
265
- log : log ,
262
+ checkForUpdate,
263
+ getConfiguration,
264
+ getCurrentPackage,
265
+ log,
266
266
notifyApplicationReady : NativeCodePush . notifyApplicationReady ,
267
267
restartApp : NativeCodePush . restartApp ,
268
- setUpTestDependencies : setUpTestDependencies ,
269
- sync : sync ,
268
+ setUpTestDependencies,
269
+ sync,
270
270
InstallMode : {
271
271
IMMEDIATE : NativeCodePush . codePushInstallModeImmediate , // Restart the app immediately
272
272
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 = {
293
293
title : "Update available"
294
294
}
295
295
} ;
296
-
297
- export default CodePush ;
0 commit comments