lib/services/pages.js
function replacePageReferenceVersions(data, version) {
  const replace = _.partial(replaceVersion, _, version);

  return _.mapValues(data, function (value, key) {
    let result;

    if (references.isUri(value)) {
      result = replace(value);
    } else if (_.isArray(value) && key !== 'urlHistory') {
      // urlHistory is an array of old page urls. they're not component refs and shouldn't be versioned
      result = _.map(value, replace);
    } else {
      result = value;
    }
    return result;
  });
}
function replacePageReferenceVersions(data, version) {
  const replace = _.partial(replaceVersion, _, version);

  return _.mapValues(data, function (value, key) {
    let result;

    if (references.isUri(value)) {
      result = replace(value);
    } else if (_.isArray(value) && key !== 'urlHistory') {
      // urlHistory is an array of old page urls. they're not component refs and shouldn't be versioned
      result = _.map(value, replace);
    } else {
      result = value;
    }
    return result;
  });
}
function replacePageReferenceVersions ( data , version ) { const replace = _ . partial ( replaceVersion , _ , version ) ; return _ . mapValues ( data , function ( value , key ) { let result ; if ( references . isUri ( value ) ) { result = replace ( value ) ; } else if ( _ . isArray ( value ) && key !== 'urlHistory' ) { // urlHistory is an array of old page urls. they're not component refs and shouldn't be versioned result = _ . map ( value , replace ) ; } else { result = value ; } return result ; } ) ; }
Replace the referenced things in the page data with a different version
@param {object} data
@param {string} version
@returns {object}
Replace the referenced things in the page data with a different version