lib/Models/SdmxJsonCatalogItem.js
function fixSelectedInitially(item, conceptDimensions) {
  conceptDimensions.forEach(dimension => {
    if (defined(item.selectedInitially)) {
      var thisSelectedInitially = item.selectedInitially[dimension.id];
      if (thisSelectedInitially) {
        var valueIds = dimension.values.map(value => value.id);
        if (
          !thisSelectedInitially.some(
            initialValue => valueIds.indexOf(initialValue) >= 0
          )
        ) {
          console.warn(
            "Ignoring invalid initial selection " +
              thisSelectedInitially +
              " on " +
              dimension.name
          );
          item.selectedInitially[dimension.id] = undefined;
        }
      }
    }
  });
}
function fixSelectedInitially(item, conceptDimensions) {
  conceptDimensions.forEach(dimension => {
    if (defined(item.selectedInitially)) {
      var thisSelectedInitially = item.selectedInitially[dimension.id];
      if (thisSelectedInitially) {
        var valueIds = dimension.values.map(value => value.id);
        if (
          !thisSelectedInitially.some(
            initialValue => valueIds.indexOf(initialValue) >= 0
          )
        ) {
          console.warn(
            "Ignoring invalid initial selection " +
              thisSelectedInitially +
              " on " +
              dimension.name
          );
          item.selectedInitially[dimension.id] = undefined;
        }
      }
    }
  });
}
function fixSelectedInitially ( item , conceptDimensions ) { conceptDimensions . forEach ( dimension => { if ( defined ( item . selectedInitially ) ) { var thisSelectedInitially = item . selectedInitially [ dimension . id ] ; if ( thisSelectedInitially ) { var valueIds = dimension . values . map ( value => value . id ) ; if ( ! thisSelectedInitially . some ( initialValue => valueIds . indexOf ( initialValue ) >= 0 ) ) { console . warn ( "Ignoring invalid initial selection " + thisSelectedInitially + " on " + dimension . name ) ; item . selectedInitially [ dimension . id ] = undefined ; } } } } ) ; }
Check if item.selectedInitially has at least one value that exists in dimension.values, and if it doesn't, reset item.selectedInitially.
Check if item . selectedInitially has at least one value that exists in dimension . values and if it doesn t reset item . selectedInitially .