function determine_shards_included_in_aggregate_shards (client_side_compilation_context) {
          var shard_included_in_hash = {};
          var scope_count = client_side_compilation_context.get_scope_count();

          for (var i = 0; i < scope_count; i++) {
            var current_scope = client_side_compilation_context.get_scope(i);
            if (!current_scope.is_shard_root()) continue;

            var current_shard_root_id = current_scope.get_identity();
            shard_included_in_hash[current_shard_root_id] = {};

            var metadata = current_scope.get_shard_metadata();
            if (!metadata.include_traits) continue;

            traverse_included_shards(current_scope, metadata.include_traits, current_scope);
          }
          return shard_included_in_hash;

          function element_in_array (arr) {
            return function (el) { return arr.indexOf(el) !== -1; };
          }
          function traverse_included_shards (shard, includes, aggregate_shard) {
            var ref_count = shard.get_referenced_scope_count();
            for (var i = 0; i < ref_count; i++) {
              var new_includes = includes;
              var scope = shard.get_referenced_scope(i);
              if (scope.is_shard_root()) {
                var scope_shard_data = scope.get_shard_metadata();
                var traits = scope_shard_data.traits;
                if (traits && !traits.some(element_in_array(includes))) {
                  continue;
                } else {
                  aggregate_shard.add_implied_shard(scope.get_identity());
                  shard_included_in_hash[scope.get_identity()][aggregate_shard.get_identity()] = true;
                }
                var include_traits = scope_shard_data.include_traits;
                if (include_traits) new_includes = new_includes.concat(include_traits);
              }
              traverse_included_shards(scope, new_includes, aggregate_shard);
            }
          }
        }
/**
         * Sets all 'implied_shards' on relevant scopes. Implied shards are the shards included in an aggregate shard.
         * @returns {object}
         */
Sets all 'implied_shards' on relevant scopes. Implied shards are the shards included in an aggregate shard.
@returns {object}
Sets all ' implied_shards ' on relevant scopes . Implied shards are the shards included in an aggregate shard . @returns { object }
function determine_shards_included_in_aggregate_shards (client_side_compilation_context) {
          var shard_included_in_hash = {};
          var scope_count = client_side_compilation_context.get_scope_count();
          for (var i = 0; i < scope_count; i++) {
            var current_scope = client_side_compilation_context.get_scope(i);
            if (!current_scope.is_shard_root()) continue;
            var current_shard_root_id = current_scope.get_identity();
            shard_included_in_hash[current_shard_root_id] = {};
            var metadata = current_scope.get_shard_metadata();
            if (!metadata.include_traits) continue;
            traverse_included_shards(current_scope, metadata.include_traits, current_scope);
          }
          return shard_included_in_hash;
          function element_in_array (arr) {
            return function (el) { return arr.indexOf(el) !== -1; };
          }
          function traverse_included_shards (shard, includes, aggregate_shard) {
            var ref_count = shard.get_referenced_scope_count();
            for (var i = 0; i < ref_count; i++) {
              var new_includes = includes;
              var scope = shard.get_referenced_scope(i);
              if (scope.is_shard_root()) {
                var scope_shard_data = scope.get_shard_metadata();
                var traits = scope_shard_data.traits;
                if (traits && !traits.some(element_in_array(includes))) {
                  continue;
                } else {
                  aggregate_shard.add_implied_shard(scope.get_identity());
                  shard_included_in_hash[scope.get_identity()][aggregate_shard.get_identity()] = true;
                }
                var include_traits = scope_shard_data.include_traits;
                if (include_traits) new_includes = new_includes.concat(include_traits);
              }
              traverse_included_shards(scope, new_includes, aggregate_shard);
            }
          }
        }
function determine_shards_included_in_aggregate_shards ( client_side_compilation_context ) { var shard_included_in_hash = { } ; var scope_count = client_side_compilation_context . get_scope_count ( ) ; for ( var i = 0 ; i < scope_count ; i ++ ) { var current_scope = client_side_compilation_context . get_scope ( i ) ; if ( ! current_scope . is_shard_root ( ) ) continue ; var current_shard_root_id = current_scope . get_identity ( ) ; shard_included_in_hash [ current_shard_root_id ] = { } ; var metadata = current_scope . get_shard_metadata ( ) ; if ( ! metadata . include_traits ) continue ; traverse_included_shards ( current_scope , metadata . include_traits , current_scope ) ; } return shard_included_in_hash ; function element_in_array ( arr ) { return function ( el ) { return arr . indexOf ( el ) !== - 1 ; } ; } function traverse_included_shards ( shard , includes , aggregate_shard ) { var ref_count = shard . get_referenced_scope_count ( ) ; for ( var i = 0 ; i < ref_count ; i ++ ) { var new_includes = includes ; var scope = shard . get_referenced_scope ( i ) ; if ( scope . is_shard_root ( ) ) { var scope_shard_data = scope . get_shard_metadata ( ) ; var traits = scope_shard_data . traits ; if ( traits && ! traits . some ( element_in_array ( includes ) ) ) { continue ; } else { aggregate_shard . add_implied_shard ( scope . get_identity ( ) ) ; shard_included_in_hash [ scope . get_identity ( ) ] [ aggregate_shard . get_identity ( ) ] = true ; } var include_traits = scope_shard_data . include_traits ; if ( include_traits ) new_includes = new_includes . concat ( include_traits ) ; } traverse_included_shards ( scope , new_includes , aggregate_shard ) ; } } }
Sets all 'implied_shards' on relevant scopes.
Sets all ' implied_shards ' on relevant scopes .