function _getUpdatedURLParameters(aNewHashParameters, oModel) {
		var aAddedVMReferences = [];
		return aNewHashParameters.reduce(function(oResultantParameters, sVariantReference) {
			var sVariantManagementReference = oModel.getVariantManagementReference(sVariantReference).variantManagementReference;

			if (sVariantManagementReference) {
				// check if a URL parameter for this variant management reference was already added
				if (includes(aAddedVMReferences, sVariantManagementReference)) {
					oResultantParameters.updateRequired = true;
					return oResultantParameters;
				}
				aAddedVMReferences.push(sVariantManagementReference);
			}
			// if there exists a variant management reference AND current variant has changed
			if (sVariantManagementReference && oModel.oData[sVariantManagementReference].currentVariant !== sVariantReference) {
				oResultantParameters.updateRequired = true;
				if (oModel.oData[sVariantManagementReference].currentVariant !== oModel.oData[sVariantManagementReference].defaultVariant) {
					// the current variant is not equal to default variant
					// add the updated variant
					oResultantParameters.parameters.push(oModel.oData[sVariantManagementReference].currentVariant);
				}
			} else {
				// when the variant management reference is unknown OR the current variant hasn't changed
				oResultantParameters.parameters.push(sVariantReference);
			}

			return oResultantParameters;
		}, {updateRequired: false, parameters: []});
	}
/**
	 * Checks if the parsed shell hash contains outdated variant parameters.
	 *
	 * @param {sap.ui.fl.Model} oModel - Variant model
	 * @param {array} aNewHashParameters - Variant URL Parameters
	 *
	 * @returns {object} oIfUpdateIsRequiredWithCurrentVariants
	 * @returns {boolean} oIfUpdateIsRequiredWithCurrentVariants.updateRequired - If update is required
	 * @returns {object} oIfUpdateIsRequiredWithCurrentVariants.currentVariantReferences - Current variant references
	 */
Checks if the parsed shell hash contains outdated variant parameters.
@param {sap.ui.fl.Model} oModel - Variant model
@param {array} aNewHashParameters - Variant URL Parameters

@returns {object} oIfUpdateIsRequiredWithCurrentVariants
@returns {boolean} oIfUpdateIsRequiredWithCurrentVariants.updateRequired - If update is required
@returns {object} oIfUpdateIsRequiredWithCurrentVariants.currentVariantReferences - Current variant references
Checks if the parsed shell hash contains outdated variant parameters . @param { sap . ui . fl . Model } oModel - Variant model @param { array } aNewHashParameters - Variant URL Parameters @returns { object } oIfUpdateIsRequiredWithCurrentVariants @returns { boolean } oIfUpdateIsRequiredWithCurrentVariants . updateRequired - If update is required @returns { object } oIfUpdateIsRequiredWithCurrentVariants . currentVariantReferences - Current variant references
function _getUpdatedURLParameters(aNewHashParameters, oModel) {
		var aAddedVMReferences = [];
		return aNewHashParameters.reduce(function(oResultantParameters, sVariantReference) {
			var sVariantManagementReference = oModel.getVariantManagementReference(sVariantReference).variantManagementReference;
			if (sVariantManagementReference) {
				if (includes(aAddedVMReferences, sVariantManagementReference)) {
					oResultantParameters.updateRequired = true;
					return oResultantParameters;
				}
				aAddedVMReferences.push(sVariantManagementReference);
			}
			if (sVariantManagementReference && oModel.oData[sVariantManagementReference].currentVariant !== sVariantReference) {
				oResultantParameters.updateRequired = true;
				if (oModel.oData[sVariantManagementReference].currentVariant !== oModel.oData[sVariantManagementReference].defaultVariant) {
					oResultantParameters.parameters.push(oModel.oData[sVariantManagementReference].currentVariant);
				}
			} else {
				oResultantParameters.parameters.push(sVariantReference);
			}
			return oResultantParameters;
		}, {updateRequired: false, parameters: []});
	}
function _getUpdatedURLParameters ( aNewHashParameters , oModel ) { var aAddedVMReferences = [ ] ; return aNewHashParameters . reduce ( function ( oResultantParameters , sVariantReference ) { var sVariantManagementReference = oModel . getVariantManagementReference ( sVariantReference ) . variantManagementReference ; if ( sVariantManagementReference ) { if ( includes ( aAddedVMReferences , sVariantManagementReference ) ) { oResultantParameters . updateRequired = true ; return oResultantParameters ; } aAddedVMReferences . push ( sVariantManagementReference ) ; } if ( sVariantManagementReference && oModel . oData [ sVariantManagementReference ] . currentVariant !== sVariantReference ) { oResultantParameters . updateRequired = true ; if ( oModel . oData [ sVariantManagementReference ] . currentVariant !== oModel . oData [ sVariantManagementReference ] . defaultVariant ) { oResultantParameters . parameters . push ( oModel . oData [ sVariantManagementReference ] . currentVariant ) ; } } else { oResultantParameters . parameters . push ( sVariantReference ) ; } return oResultantParameters ; } , { updateRequired : false , parameters : [ ] } ) ; }
Checks if the parsed shell hash contains outdated variant parameters.
Checks if the parsed shell hash contains outdated variant parameters .
// check if a URL parameter for this variant management reference was already added // if there exists a variant management reference AND current variant has changed // the current variant is not equal to default variant // add the updated variant // when the variant management reference is unknown OR the current variant hasn't changed