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 11'use strict' ;
2+
23const express = require ( 'express' ) ;
34const path = require ( 'path' ) ;
4- const packageJson = require ( 'package-json' ) ;
55const csrf = require ( 'csurf' ) ;
66const Authentication = require ( './Authentication.js' ) ;
77const fs = require ( 'fs' ) ;
88const ConfigKeyCache = require ( './configKeyCache.js' ) ;
9-
109const currentVersionFeatures = require ( '../package.json' ) . parseDashboardFeatures ;
1110
1211let 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 {
1522 if ( latestPackage . parseDashboardFeatures instanceof Array ) {
1623 newFeaturesInLatestVersion = latestPackage . parseDashboardFeatures . filter ( feature => {
1724 return currentVersionFeatures . indexOf ( feature ) === - 1 ;
1825 } ) ;
1926 }
20- } )
21- . catch ( ( ) => {
22- // In case of a failure make sure the final value is an empty array
27+ } catch {
2328 newFeaturesInLatestVersion = [ ] ;
24- } ) ;
29+ }
30+ }
31+ getNewFeaturesInLatestVersion ( )
2532
2633function getMount ( mountPath ) {
2734 mountPath = mountPath || '' ;
You can’t perform that action at this time.
0 commit comments