<commit_before>// demo.ts

"use strict";

// superHeroName doesn't make sense for a superVillain.
// The Interface will help us to solve this issue

/* let superHero: {
  secretIdentity: string;
  superHeroName: string;
  health: number;
};

let superVillain: {
  secretIdentity: string;
  superHeroName: string;
  health: number;
}; */

interface ComicBookCharacter {
  secretIdentity?: string;
  alias: string;
  health: number;
}

let superHero: ComicBookCharacter = {
  alias: "She-Hulk",
  health: 5000
};

let superVillain: ComicBookCharacter = {
  secretIdentity: "<NAME>",
  alias: "Joker",
  health: 75
};<commit_msg>Added getSecretIdentity. Using interface for specifying argument type<commit_after>// demo.ts

"use strict";

// superHeroName doesn't make sense for a superVillain.
// The Interface will help us to solve this issue

/* let superHero: {
  secretIdentity: string;
  superHeroName: string;
  health: number;
};

let superVillain: {
  secretIdentity: string;
  superHeroName: string;
  health: number;
}; */

interface ComicBookCharacter {
  secretIdentity?: string;
  alias: string;
  health: number;
}

let superHero: ComicBookCharacter = {
  alias: "She-Hulk",
  health: 5000
};

let superVillain: ComicBookCharacter = {
  secretIdentity: "<NAME>",
  alias: "Joker",
  health: 75
};

function getSecretIdentity(character: ComicBookCharacter) {
  if (character.secretIdentity) {
    console.log(`${character.alias} is ${character.secretIdentity}`);
  } else {
    console.log(`${character.alias} has no secret identity`);
  }
}

getSecretIdentity(superHero);
{'fraction_non_alphanumeric': 0.12002526847757422, 'fraction_numerical': 0.007580543272267846, 'mean_word_length': 4.387755102040816, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1215039', 'n_tokens_mistral': 530, 'n_tokens_neox': 499, 'n_words': 142}