[
  {
    "path": ".babelrc",
    "content": "{\n  \"presets\": [\"@babel/preset-env\"]\n}\n"
  },
  {
    "path": ".github/workflows/test.yml",
    "content": "name: test\n\non:\n  push:\n    branches:\n      - master\n  pull_request:\n    branches:\n      - master\n  workflow_dispatch:\n\njobs:\n  test:\n    strategy:\n      matrix:\n        os:\n          - ubuntu-latest\n          - macos-latest\n          - windows-latest\n    name: Testing as a good child on ${{ matrix.os }}\n    runs-on: ${{ matrix.os }}\n    steps:\n      - uses: actions/checkout@v2\n      - uses: actions/setup-node@v2\n        with:\n          node-version: 16\n      - run: npm install --ignore-scripts\n      - run: npm test\n"
  },
  {
    "path": ".gitignore",
    "content": "/node_modules\n/lib\n/coverage\n.idea/\n"
  },
  {
    "path": ".prettierrc",
    "content": "{\n  \"tabWidth\": 2,\n  \"useTabs\": false,\n  \"semi\": true,\n  \"singleQuote\": false,\n  \"endOfLine\": \"lf\",\n  \"trailingComma\": \"es5\"\n}\n"
  },
  {
    "path": "README.md",
    "content": "# Hi, mom!\n\nA blazingly fast JavaScript library to say hi to your mom!\n\n## Install\n\n#### yarn\n\n```bash\nyarn add hi-mom\n```\n\n#### npm\n\n```bash\nnpm i hi-mom\n```\n\n#### unpkg.com (UMD)\n\n```html\n<script src=\"https://unpkg.com/hi-mom/lib/hi-mom.umd.js\"></script>\n```\n\n## Usage\n\n#### CommonJS\n\n```javascript\nconst { hiMom } = require(\"hi-mom\");\n\nconsole.log(hiMom()); // Hi, mom!\n```\n\n#### ES Modules\n\n```javascript\nimport { hiMom } from \"hi-mom\";\n\nconsole.log(hiMom()); // Hi, mom!\n```\n\n#### Browser (UMD)\n\n```javascript\nconsole.log(hiMom.hiMom());\n```\n\n#### custom mother name\n\n```javascript\nimport { hiMom } from \"hi-mom\";\n\nconsole.log(hiMom(\"Mother\")); // Hi, Mother!\n```\n\n## Languages supported\n\n- ar - Arabic\n- ar-IQ - Iraqi Arabic\n- as - Assamese\n- az - Azerbaijani\n- bn - Bengali\n- bg - Bulgarian\n- ca - Catalan\n- cn - Chinese\n- cs - Czech\n- da - Danish\n- de - German\n- en - English\n- en-AU - Australian English\n- en-PT - Pirate Speak\n- es - Spanish\n- fa - Persian\n- fr - French\n- he - Hebrew\n- hi - Hindi\n- hr - Croatian\n- hu - Hungarian\n- id - Indonesian\n- it - Italian\n- ja - Japanese\n- ko - Korean\n- kaa - Karakalpak\n- lt - Lithuanian\n- mar - Marathi\n- ml - Malayalam\n- ms - Malay\n- nl-BE - Flemish\n- nl-NL - Dutch\n- no - Norwegian\n- no-NB - Norwegian Bokmål\n- no-NN - Norwegian Nynorsk\n- pl - Polish\n- pt - Portuguese\n- qt - Crimean\n- ro - Romanian\n- ru - Russian\n- se - Swedish\n- si - Sinhala\n- sr - Serbian\n- ta - Tamil\n- th - Thai\n- tl - Filipino\n- tr - Turkish\n- tm - Turkmen\n- ua - Ukrainian\n- ur - Urdu\n- vi - Vietnamese\n- zh - Zhongwen\n- ug - Uyghur\n"
  },
  {
    "path": "index.d.ts",
    "content": "import languages from \"./languages/index\";\n\n/**\n * Say hi to your mom blazingly fast!\n * @param name Mother's name\n * @param language Language of your mother\n * @example\n * import { hiMom } from \"hi-mom\";\n * console.log(hiMom()); // Hi, mom!\n */\nexport function hiMom(\n  name?: string,\n  language: keyof typeof languages = \"en\"\n): string;\n\n/**\n * Say hi to multiple moms blazingly fast!\n * @param mothers Your moms\n * @example\n * import { hiMoms } from \"hi-mom\";\n * console.log(hiMoms([\n *  { lang: \"en\" },\n *  { lang: \"si\" },\n * ]])); // Hi, mom! ආයුබෝවන්, අම්මේ!\n */\nexport function hiMoms(\n  mothers: string | { name?: string; lang?: keyof typeof languages }[]\n): string;\n"
  },
  {
    "path": "index.js",
    "content": "import languages from \"./languages/index.js\";\n\n/**\n * A blazingly fast way to say hi to your mom!\n * @param {string} name - The mom name\n * @param {string} [language=\"en\"] - The language\n * @example hiMom()\n * // \"Hi, mom!\"\n * @example hiMom(\"Kate\")\n * // \"Hi, Kate!\"\n * @example hiMom(\"Maria\", \"pt\")\n * // \"Oi, Maria!\"\n * @returns {string} A greeting to your mom in the informed language\n */\nexport function hiMom(name, language = \"en\") {\n  if (!language || !languages.hasOwnProperty(language)) {\n    throw new Error(\"Language not yet supported, but hi mom anyway!\");\n  }\n\n  const regex = /\\{{2}([^}]+)\\}{2}/;\n  const greeting = languages[language];\n  const localeName = greeting.split(regex)[1];\n\n  return greeting.replace(regex, name || localeName);\n}\n\nexport function hiMoms(mothers) {\n  if (typeof mothers == \"string\") {\n    return hiMom(mothers);\n  } else if (mothers instanceof Array) {\n    return mothers.map((mother) => hiMom(mother?.name, mother?.lang)).join(\" \");\n  }\n\n  throw new Error(\"Mother type not supported, but hi mom anyway!\");\n}\n"
  },
  {
    "path": "index.test.js",
    "content": "import { hiMom } from \"./index\";\n\ntest(\"should say hi to mom\", () => {\n  expect(hiMom()).toBe(\"Hi, mom!\");\n});\n\ntest(\"should not say hi to dad\", () => {\n  expect(hiMom()).not.toBe(\"Hi, dad!\");\n});\n\ntest(\"should say hi to Mother when requested\", () => {\n  expect(hiMom(\"Mother\")).toBe(\"Hi, Mother!\");\n});\n\ntest(\"should say hi to mom in tamil when requested\", () => {\n  expect(hiMom(\"\", \"ta\")).toContain(\"வணக்கம் அம்மா\");\n});\n\ntest(\"should say hi to mom in german when requested\", () => {\n  expect(hiMom(\"\", \"de\")).toContain(\"Hallo\");\n});\n\ntest(\"should say hi to mom in danish when requested\", () => {\n  expect(hiMom(\"\", \"da\")).toContain(\"Hej\");\n});\n\ntest(\"should say hi to mom in russian when requested\", () => {\n  expect(hiMom(\"\", \"ru\")).toBe(\"Привет, мама!\");\n});\n\ntest(\"should say hi to mom in persian when requested\", () => {\n  expect(hiMom(\"\", \"fa\")).toContain(\"مامان\");\n});\n\ntest(\"should say hi to Mother in french when requested\", () => {\n  expect(hiMom(\"Mother\", \"fr\")).toContain(\"Mother\");\n});\n\ntest(\"should say hi to Mother in arabic when requested\", () => {\n  expect(hiMom(\"\", \"ar-IQ\")).toContain(\"يمه\");\n});\n\ntest(\"should say hi to Mother in darija (Moroccan Arabic) when requested\", () => {\n  expect(hiMom(\"\", \"ar-MA\")).toContain(\"ماما\");\n});\n\ntest(\"nl-Be should not say the same as nl-NL when requested\", () => {\n  expect(hiMom(\"\", \"nl-BE\")).not.toBe(hiMom(\"\", \"nl-NL\"));\n});\n\ntest(\"should say hi to Mother in assamese when requested\", () => {\n  expect(hiMom(\"\", \"as\")).toContain(\"অ' মা\");\n});\n\ntest(\"should say hi to mom in pirate speak when requested\", () => {\n  expect(hiMom(\"\", \"en-PT\")).toContain(\"Ahoy,\");\n});\n\ntest(\"should say hi to Mother in azerbaijani when requested\", () => {\n  expect(hiMom(\"\", \"az\")).toBe(\"Salam, ana!\");\n});\n\ntest(\"should say hi to Mother in Swedish and not Bork Bork!\", () => {\n  expect(hiMom(\"\", \"se\")).toBe(\"Hej, mamma!\");\n});\n\ntest(\"should say hi to Mother in Norwegian Bokmål when requested\", () => {\n  expect(hiMom(\"\", \"no-NB\")).toBe(\"Hei, mamma!\");\n});\n\ntest(\"should say hi to Mother in Norwegian Nynorsk when requested\", () => {\n  expect(hiMom(\"\", \"no-NN\")).toBe(\"Hei, mamma!\");\n});\n\ntest(\"should say hi to Mother in Croatian when requested\", () => {\n  expect(hiMom(\"\", \"hr\")).toBe(\"Bok, mama!\");\n});\n\ntest(\"should say hi to Mother in Filipino when requested\", () => {\n  expect(hiMom(\"\", \"tl\")).toBe(\"Kamusta po, nanay!\");\n});\n\ntest(\"should say hi to Mother in Crimean when requested\", () => {\n  expect(hiMom(\"\", \"qt\")).toBe(\"Selâm, anam!\");\n});\n\ntest(\"should say hi to Mother in Marathi when requested\", () => {\n  expect(hiMom(\"\", \"mar\")).toBe(\"नमस्कार, आई!\");\n});\n\ntest(\"should say hi to mom in Bengali when requested\", () => {\n  expect(hiMom(\"\", \"bn\")).toBe(\"নমস্কার, মা!\");\n});\n\ntest(\"should throw error when requested\", () => {\n  expect(() => hiMom(\"\", \"\")).toThrowError(/language/i);\n});\n"
  },
  {
    "path": "languages/index.js",
    "content": "export default {\n  ar: \"مرحباً, {{امي}}!\",\n  \"ar-IQ\": \"هلا, {{يمه}}!\",\n  as: \"মা, {{অ' মা}}\",\n  \"ar-MA\": \"سلام، {{ماما}}\",\n  az: \"Salam, {{ana}}!\",\n  bn: \"নমস্কার, {{মা}}!\",\n  bg: \"Здрасти, {{мамо}}!\",\n  ca: \"Hola, {{mamà}}!\",\n  cn: \"你好，{{妈妈}}!\",\n  cs: \"Ahoj, {{mamá}}!\",\n  da: \"Hej, {{mor}}!\",\n  de: \"Hallo, {{Mama}}!\",\n  en: \"Hi, {{mom}}!\",\n  \"en-AU\": \"Hi, {{mum}}!\",\n  \"en-PT\": \"Ahoy, {{mom}}!\",\n  es: \"Hola, {{mamá}}!\",\n  fa: \"سلام، {{مامان}}!\",\n  fr: \"Salut, {{maman}}!\",\n  he: \"שלום, {{מה}}!\",\n  hi: \"नमस्ते {{मम्मी}}!\",\n  hr: \"Bok, {{mama}}!\",\n  hu: \"Szia, {{anya}}!\",\n  id: \"Hai, {{ibu}}!\",\n  it: \"Ciao {{mamma}}!\",\n  ja: \"こんにちは、{{ママ}}!\",\n  ko: \"안녕, {{엄마}}!\",\n  kaa: \"Sálem, {{anajan}}!\",\n  lt: \"Labas, {{mama}}!\",\n  mar: \"नमस्कार, {{आई}}!\",\n  ml: \"ഹായ്, {{അമ്മേ}}!\",\n  ms: \"Hai, {{bapa}}!\",\n  \"nl-BE\": \"Hallo, {{moeke}}!\",\n  \"nl-NL\": \"Hallo, {{moeder}}!\",\n  no: \"Hei, {{mamma}}!\",\n  \"no-NB\": \"Hei, {{mamma}}!\",\n  \"no-NN\": \"Hei, {{mamma}}!\",\n  pl: \"Cześć, {{matka}}!\",\n  pt: \"Oi, {{mãe}}!\",\n  ro: \"Bună, {{mamă}}!\",\n  ru: \"Привет, {{мама}}!\",\n  se: \"Hej, {{mamma}}!\",\n  si: \"ආයුබෝවන්, {{අම්මේ}}!\",\n  sr: \"Ćao, {{mama}}!\",\n  ta: \"வணக்கம் {{அம்மா}}\",\n  th: \"สวัสดีค่ะ, {{มา}}!\",\n  tl: \"Kamusta po, {{nanay}}!\",\n  tr: \"Merhaba, {{anne}}!\",\n  tm: \"Salam, {{eje}}!\",\n  ua: \"Привіт, {{мама}}!\",\n  ur: \"سلام، {{امی}}\",\n  vi: \"Xin chào, {{mẹ}}!\",\n  zh: \"你好，{{妈妈}}!\",\n  ug: \"سالام، {{ئاپا}}!\",\n  qt: \"Selâm, {{anam}}!\",\n};\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"hi-mom\",\n  \"version\": \"1.2.1\",\n  \"description\": \"A blazingly fast JavaScript library to say hi to your mom!\",\n  \"main\": \"index.js\",\n  \"types\": \"index.d.ts\",\n  \"keywords\": [\n    \"hello-world\",\n    \"hello\",\n    \"hi\",\n    \"mom\",\n    \"hi-mom\"\n  ],\n  \"author\": \"Daniil Tsivinsky\",\n  \"license\": \"MIT\",\n  \"type\": \"module\",\n  \"devDependencies\": {\n    \"@babel/core\": \"^7.17.8\",\n    \"@babel/preset-env\": \"^7.16.11\",\n    \"jest\": \"^27.5.1\",\n    \"rollup\": \"^2.70.1\"\n  },\n  \"scripts\": {\n    \"prebuild\": \"npm run test\",\n    \"build\": \"rollup -c rollup.config.js\",\n    \"prepublishOnly\": \"npm run build\",\n    \"test\": \"jest\",\n    \"coverage\": \"jest --coverage\"\n  },\n  \"exports\": {\n    \".\": {\n      \"require\": \"./lib/hi-mom.cjs\",\n      \"import\": \"./lib/hi-mom.esm.js\"\n    }\n  },\n  \"files\": [\n    \"lib/\",\n    \"languages/\",\n    \"index.d.ts\"\n  ]\n}\n"
  },
  {
    "path": "rollup.config.js",
    "content": "import { defineConfig } from \"rollup\";\n\nexport default defineConfig({\n  input: \"./index.js\",\n  output: [\n    {\n      file: \"./lib/hi-mom.cjs\",\n      format: \"cjs\",\n      exports: \"auto\",\n    },\n    {\n      file: \"./lib/hi-mom.esm.js\",\n      format: \"esm\",\n      exports: \"auto\",\n    },\n    {\n      file: \"./lib/hi-mom.umd.js\",\n      format: \"umd\",\n      exports: \"auto\",\n      name: \"hiMom\",\n    },\n  ],\n});\n"
  }
]