lib/localPersistence/inputPersister.js
/**
   * Populates level configuration with payload data when levelConfig.type is 'dynamic'. In case
   * levelConfig.type is static defines levelConfig.source as 'static'
   *
   * @param {*} levelConfig Level configuration entered in Levels configurations
   * @param {*} payload the payload from which the level name will be extracted
   * @returns The level configuration with name defined.
   *
   * @private
   */
Populates level configuration with payload data when levelConfig.type is 'dynamic'.

@param {*} levelConfig Level configuration entered in Levels configurations
@param {*} payload the payload from which the level name will be extracted
@returns The level configuration with name defined.

@private
Populates level configuration with payload data when levelConfig . type is ' dynamic ' . @param { * } levelConfig Level configuration entered in Levels configurations @param { * } payload the payload from which the level name will be extracted @returns The level configuration with name defined . @private
prepareLevel(levelConfig, payload) {
    if (levelConfig.type === 'static') {
      this.logger.debug(`Preparing ${levelConfig.name} level..`);
      return {
        ...levelConfig,
        source: 'static',
      };
    } if (levelConfig.type === 'dynamic') {
      this.logger.debug(`Preparing ${levelConfig.source} level..`);
      return {
        ...levelConfig,
        name: InputPersister.get(levelConfig.source, payload),
      };
    }
    return null;
  }
prepareLevel ( levelConfig , payload ) { if ( levelConfig . type === 'static' ) { this . logger . debug ( ` ${ levelConfig . name } ` ) ; return { ... levelConfig , source : 'static' , } ; } if ( levelConfig . type === 'dynamic' ) { this . logger . debug ( ` ${ levelConfig . source } ` ) ; return { ... levelConfig , name : InputPersister . get ( levelConfig . source , payload ) , } ; } return null ; }
Populates level configuration with payload data when levelConfig.type is 'dynamic'.
Populates level configuration with payload data when levelConfig . type is ' dynamic ' .