src/common/config/index.js
/**
   * Determines if locally stored data needs to be updated and upgrades as needed
   *
   * @param {*} data locally stored data
   */
Determines if locally stored data needs to be updated and upgrades as needed
@param {*} data locally stored data
Determines if locally stored data needs to be updated and upgrades as needed @param { * } data locally stored data
checkForConfigUpdates(data) {
    let configData = data;
    try {
      if (configData.version !== this.defaultConfigData.version) {
        configData = upgradeConfigData(configData);
        this.writeFileSync(this.configFilePath, configData);
        console.log(`Configuration updated to version ${this.defaultConfigData.version} successfully.`);
      }
    } catch (error) {
      console.log(`Failed to update configuration to version ${this.defaultConfigData.version}.`);
    }
    return configData;
  }
checkForConfigUpdates ( data ) { let configData = data ; try { if ( configData . version !== this . defaultConfigData . version ) { configData = upgradeConfigData ( configData ) ; this . writeFileSync ( this . configFilePath , configData ) ; console . log ( ` ${ this . defaultConfigData . version } ` ) ; } } catch ( error ) { console . log ( ` ${ this . defaultConfigData . version } ` ) ; } return configData ; }
Determines if locally stored data needs to be updated and upgrades as needed
 @param {*} data locally stored data
Determines if locally stored data needs to be updated and upgrades as needed @param { * } data locally stored data