<commit_before>import * as viewscreens from "./viewscreens";
import addAsset from "../../../addAsset";

export default function buildExport(zip, mission) {
  let assets = [];
  mission.timeline.forEach(t =>
    t.timelineItems
      .filter(i => i.event === "updateViewscreenComponent")
      .forEach(i => {
        const args = JSON.parse(i.args);
        if (viewscreens[args.component]) {
          assets = assets.concat(
            viewscreens[args.component](JSON.parse(args.data))
          );
        }
      })
  );
  assets.forEach(key => {
    addAsset(key, zip);
  });
}
<commit_msg>Do some additional checking to see if something should be exported.<commit_after>import * as viewscreens from "./viewscreens";
import addAsset from "../../../addAsset";

export default function buildExport(zip, mission) {
  let assets = [];
  mission.timeline.forEach(t =>
    t.timelineItems
      .filter(i => i.event === "updateViewscreenComponent")
      .forEach(i => {
        const args = JSON.parse(i.args);
        if (args && args.component && viewscreens[args.component]) {
          assets = assets.concat(
            viewscreens[args.component](JSON.parse(args.data))
          );
        }
      })
  );
  assets.forEach(key => {
    addAsset(key, zip);
  });
}

{'fraction_non_alphanumeric': 0.15384615384615385, 'fraction_numerical': 0.0, 'mean_word_length': 2.551532033426184, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6816106', 'n_tokens_mistral': 378, 'n_tokens_neox': 378, 'n_words': 78}