File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
+
2
3
const express = require ( 'express' ) ;
3
4
const path = require ( 'path' ) ;
4
- const packageJson = require ( 'package-json' ) ;
5
5
const csrf = require ( 'csurf' ) ;
6
6
const Authentication = require ( './Authentication.js' ) ;
7
7
const fs = require ( 'fs' ) ;
8
8
const ConfigKeyCache = require ( './configKeyCache.js' ) ;
9
-
10
9
const currentVersionFeatures = require ( '../package.json' ) . parseDashboardFeatures ;
11
10
12
11
let newFeaturesInLatestVersion = [ ] ;
13
- packageJson ( 'parse-dashboard' , { version : 'latest' , fullMetadata : true } )
14
- . then ( latestPackage => {
12
+
13
+ /**
14
+ * Gets the new features in the latest version of Parse Dashboard.
15
+ */
16
+ async function getNewFeaturesInLatestVersion ( ) {
17
+ // Get latest version
18
+ const packageJson = ( await import ( 'package-json' ) ) . default ;
19
+ const latestPackage = await packageJson ( 'parse-dashboard' , { version : 'latest' , fullMetadata : true } ) ;
20
+
21
+ try {
15
22
if ( latestPackage . parseDashboardFeatures instanceof Array ) {
16
23
newFeaturesInLatestVersion = latestPackage . parseDashboardFeatures . filter ( feature => {
17
24
return currentVersionFeatures . indexOf ( feature ) === - 1 ;
18
25
} ) ;
19
26
}
20
- } )
21
- . catch ( ( ) => {
22
- // In case of a failure make sure the final value is an empty array
27
+ } catch {
23
28
newFeaturesInLatestVersion = [ ] ;
24
- } ) ;
29
+ }
30
+ }
31
+ getNewFeaturesInLatestVersion ( )
25
32
26
33
function getMount ( mountPath ) {
27
34
mountPath = mountPath || '' ;
You can’t perform that action at this time.
0 commit comments