core.js 501 B

12345678910111213141516171819
  1. /**
  2. * Core logic for the Star Sign component.
  3. */
  4. export const STAR_SIGNS = [
  5. 'Aries', 'Taurus', 'Gemini', 'Cancer',
  6. 'Leo', 'Virgo', 'Libra', 'Scorpio',
  7. 'Sagittarius', 'Capricorn', 'Aquarius', 'Pisces'
  8. ];
  9. /**
  10. * Returns a random star sign from the list.
  11. * @param {Function} getRandomInt - Dependency injection for randomness.
  12. * @returns {string}
  13. */
  14. export const getRandomStarSign = (getRandomInt) => {
  15. const index = getRandomInt(0, STAR_SIGNS.length - 1);
  16. return STAR_SIGNS[index];
  17. };