zodiac-mapper 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -63,6 +63,13 @@ declare function findFirstZodiacInText(text: string, options?: ZodiacMatcherOpti
63
63
  * @returns An array of matches.
64
64
  */
65
65
  declare function findAllZodiacInText(text: string, options?: ZodiacMatcherOptions): ZodiacMatch[];
66
+ /**
67
+ * Returns the list of names/aliases for a given zodiac sign in a specific locale.
68
+ * @param sign The zodiac sign.
69
+ * @param locale The locale code (e.g. "en", "zh", "es").
70
+ * @returns An array of names, or empty array if locale/sign not found.
71
+ */
72
+ declare function getZodiacNames(sign: ZodiacSign, locale: string): string[];
66
73
  //#endregion
67
74
  //#region src/date.d.ts
68
75
  interface MonthDay {
@@ -106,5 +113,5 @@ declare function getZodiacSignFromDate(date: Date | MonthDay | string): ZodiacSi
106
113
  */
107
114
  declare function normalizeName(str: string): string;
108
115
  //#endregion
109
- export { type MonthDay, type ZodiacDateRange, type ZodiacMatch, type ZodiacMatcher, type ZodiacMatcherOptions, ZodiacSign, createZodiacMatcher, findAllZodiacInText, findFirstZodiacInText, getSupportedLocales, getZodiacDateRange, getZodiacSign, getZodiacSignFromDate, normalizeName };
116
+ export { type MonthDay, type ZodiacDateRange, type ZodiacMatch, type ZodiacMatcher, type ZodiacMatcherOptions, ZodiacSign, createZodiacMatcher, findAllZodiacInText, findFirstZodiacInText, getSupportedLocales, getZodiacDateRange, getZodiacNames, getZodiacSign, getZodiacSignFromDate, normalizeName };
110
117
  //# sourceMappingURL=index.d.cts.map
package/dist/index.d.mts CHANGED
@@ -63,6 +63,13 @@ declare function findFirstZodiacInText(text: string, options?: ZodiacMatcherOpti
63
63
  * @returns An array of matches.
64
64
  */
65
65
  declare function findAllZodiacInText(text: string, options?: ZodiacMatcherOptions): ZodiacMatch[];
66
+ /**
67
+ * Returns the list of names/aliases for a given zodiac sign in a specific locale.
68
+ * @param sign The zodiac sign.
69
+ * @param locale The locale code (e.g. "en", "zh", "es").
70
+ * @returns An array of names, or empty array if locale/sign not found.
71
+ */
72
+ declare function getZodiacNames(sign: ZodiacSign, locale: string): string[];
66
73
  //#endregion
67
74
  //#region src/date.d.ts
68
75
  interface MonthDay {
@@ -106,5 +113,5 @@ declare function getZodiacSignFromDate(date: Date | MonthDay | string): ZodiacSi
106
113
  */
107
114
  declare function normalizeName(str: string): string;
108
115
  //#endregion
109
- export { type MonthDay, type ZodiacDateRange, type ZodiacMatch, type ZodiacMatcher, type ZodiacMatcherOptions, ZodiacSign, createZodiacMatcher, findAllZodiacInText, findFirstZodiacInText, getSupportedLocales, getZodiacDateRange, getZodiacSign, getZodiacSignFromDate, normalizeName };
116
+ export { type MonthDay, type ZodiacDateRange, type ZodiacMatch, type ZodiacMatcher, type ZodiacMatcherOptions, ZodiacSign, createZodiacMatcher, findAllZodiacInText, findFirstZodiacInText, getSupportedLocales, getZodiacDateRange, getZodiacNames, getZodiacSign, getZodiacSignFromDate, normalizeName };
110
117
  //# sourceMappingURL=index.d.mts.map
package/dist/index.mjs CHANGED
@@ -573,7 +573,7 @@ const ZODIAC_PER_LOCALE = {
573
573
  [ZodiacSign.VIRGO]: ["Virgo"],
574
574
  [ZodiacSign.LIBRA]: ["Libra"],
575
575
  [ZodiacSign.SCORPIO]: ["Scorpio"],
576
- [ZodiacSign.SAGITTARIUS]: ["Sagitarius"],
576
+ [ZodiacSign.SAGITTARIUS]: ["Sagittarius"],
577
577
  [ZodiacSign.CAPRICORN]: ["Capricorn"],
578
578
  [ZodiacSign.AQUARIUS]: ["Aquarius"],
579
579
  [ZodiacSign.PISCES]: ["Pisces"]
@@ -1460,18 +1460,18 @@ const ZODIAC_PER_LOCALE = {
1460
1460
  [ZodiacSign.PISCES]: ["Mina"]
1461
1461
  },
1462
1462
  ne: {
1463
- [ZodiacSign.ARIES]: ["Mes"],
1464
- [ZodiacSign.TAURUS]: ["Bris"],
1465
- [ZodiacSign.GEMINI]: ["Mithon"],
1466
- [ZodiacSign.CANCER]: ["Karat"],
1467
- [ZodiacSign.LEO]: ["Sing"],
1468
- [ZodiacSign.VIRGO]: ["Kanya"],
1469
- [ZodiacSign.LIBRA]: ["Tula"],
1470
- [ZodiacSign.SCORPIO]: ["Brischik"],
1471
- [ZodiacSign.SAGITTARIUS]: ["Dhanu"],
1472
- [ZodiacSign.CAPRICORN]: ["Makar"],
1473
- [ZodiacSign.AQUARIUS]: ["Sing"],
1474
- [ZodiacSign.PISCES]: ["Min"]
1463
+ [ZodiacSign.ARIES]: ["मेष", "Mesh"],
1464
+ [ZodiacSign.TAURUS]: ["वृष", "Brish"],
1465
+ [ZodiacSign.GEMINI]: ["मिथुन", "Mithun"],
1466
+ [ZodiacSign.CANCER]: ["कर्कट", "Karkat"],
1467
+ [ZodiacSign.LEO]: ["सिंह", "Singha"],
1468
+ [ZodiacSign.VIRGO]: ["कन्या", "Kanya"],
1469
+ [ZodiacSign.LIBRA]: ["तुला", "Tula"],
1470
+ [ZodiacSign.SCORPIO]: ["वृश्चिक", "Brischik"],
1471
+ [ZodiacSign.SAGITTARIUS]: ["धनु", "Dhanu"],
1472
+ [ZodiacSign.CAPRICORN]: ["मकर", "Makar"],
1473
+ [ZodiacSign.AQUARIUS]: ["कुम्भ", "Kumbha"],
1474
+ [ZodiacSign.PISCES]: ["मीन", "Meen"]
1475
1475
  },
1476
1476
  ur: {
1477
1477
  [ZodiacSign.ARIES]: ["Hamal", "Mekh"],
@@ -1955,7 +1955,7 @@ const ZODIAC_PER_LOCALE = {
1955
1955
  "Mekh"
1956
1956
  ],
1957
1957
  [ZodiacSign.TAURUS]: [
1958
- "વૃષ",
1958
+ "ਬ੍ਰਿਸ਼ਭ",
1959
1959
  "Vrish",
1960
1960
  "Vrishabha",
1961
1961
  "Brikh"
@@ -1970,12 +1970,12 @@ const ZODIAC_PER_LOCALE = {
1970
1970
  [ZodiacSign.VIRGO]: ["ਕੰਨਿਆ", "Kanya"],
1971
1971
  [ZodiacSign.LIBRA]: ["ਤੁਲਾ", "Tula"],
1972
1972
  [ZodiacSign.SCORPIO]: [
1973
- "ਵ੍ਰਿਸ਼ਚਿਕ",
1973
+ "ਬ੍ਰਿਸ਼ਚਕ",
1974
1974
  "Vrishchik",
1975
1975
  "Brischak"
1976
1976
  ],
1977
1977
  [ZodiacSign.SAGITTARIUS]: [
1978
- "ਧਨੁ",
1978
+ "ਧਨੂੰ",
1979
1979
  "Dhanu",
1980
1980
  "Dhan"
1981
1981
  ],
@@ -2400,18 +2400,56 @@ const ZODIAC_PER_LOCALE = {
2400
2400
  [ZodiacSign.PISCES]: ["ماس", "Masi"]
2401
2401
  },
2402
2402
  om: {
2403
- [ZodiacSign.ARIES]: ["Korma"],
2404
- [ZodiacSign.TAURUS]: ["Korma"],
2403
+ [ZodiacSign.ARIES]: ["Korbeessa", "Elemoo"],
2404
+ [ZodiacSign.TAURUS]: [
2405
+ "Gafarsa",
2406
+ "Haraashii",
2407
+ "Qotiyyoo",
2408
+ "Korma"
2409
+ ],
2405
2410
  [ZodiacSign.GEMINI]: ["Lakkuu"],
2406
- [ZodiacSign.CANCER]: ["Qaaqee"],
2407
- [ZodiacSign.LEO]: ["Leenca"],
2408
- [ZodiacSign.VIRGO]: ["Durba"],
2409
- [ZodiacSign.LIBRA]: ["Mizaana"],
2410
- [ZodiacSign.SCORPIO]: ["Gaanqabaa"],
2411
- [ZodiacSign.SAGITTARIUS]: ["Xiyya"],
2412
- [ZodiacSign.CAPRICORN]: ["Re'ee"],
2413
- [ZodiacSign.AQUARIUS]: ["Buusaa"],
2414
- [ZodiacSign.PISCES]: ["Qurxummii"]
2411
+ [ZodiacSign.CANCER]: [
2412
+ "Qaajibuu",
2413
+ "Qaajibbuu",
2414
+ "Bararii"
2415
+ ],
2416
+ [ZodiacSign.LEO]: ["Leencicha", "Leenca"],
2417
+ [ZodiacSign.VIRGO]: [
2418
+ "Duudaa",
2419
+ "Durba",
2420
+ "Dubree"
2421
+ ],
2422
+ [ZodiacSign.LIBRA]: [
2423
+ "Maadaltuu",
2424
+ "Madaltoo",
2425
+ "Mizaana"
2426
+ ],
2427
+ [ZodiacSign.SCORPIO]: [
2428
+ "Gaawisoo",
2429
+ "Gaawwisoo",
2430
+ "Gaanqabaa"
2431
+ ],
2432
+ [ZodiacSign.SAGITTARIUS]: [
2433
+ "Fuggisa xiyyaa",
2434
+ "Xiyyaa",
2435
+ "Xiyya"
2436
+ ],
2437
+ [ZodiacSign.CAPRICORN]: [
2438
+ "Reettii",
2439
+ "Qobolee",
2440
+ "Re'ee"
2441
+ ],
2442
+ [ZodiacSign.AQUARIUS]: [
2443
+ "Battuu bisaanii",
2444
+ "Tuuja Baaldii",
2445
+ "Kuroo",
2446
+ "Buusaa"
2447
+ ],
2448
+ [ZodiacSign.PISCES]: [
2449
+ "Albaadhessa",
2450
+ "Albaadheesaa",
2451
+ "Qurxummii"
2452
+ ]
2415
2453
  }
2416
2454
  };
2417
2455
 
@@ -2541,6 +2579,19 @@ function findFirstZodiacInText(text, options) {
2541
2579
  function findAllZodiacInText(text, options) {
2542
2580
  return findZodiacMatchesInText(text, options);
2543
2581
  }
2582
+ /**
2583
+ * Returns the list of names/aliases for a given zodiac sign in a specific locale.
2584
+ * @param sign The zodiac sign.
2585
+ * @param locale The locale code (e.g. "en", "zh", "es").
2586
+ * @returns An array of names, or empty array if locale/sign not found.
2587
+ */
2588
+ function getZodiacNames(sign, locale) {
2589
+ const canonical = canonicalizeLocale(locale);
2590
+ const base = getBaseLanguage(locale);
2591
+ if (ZODIAC_PER_LOCALE[canonical]?.[sign]) return ZODIAC_PER_LOCALE[canonical][sign];
2592
+ if (ZODIAC_PER_LOCALE[base]?.[sign]) return ZODIAC_PER_LOCALE[base][sign];
2593
+ return [];
2594
+ }
2544
2595
  function isLatin(str) {
2545
2596
  return /^[a-zA-Z\u00C0-\u00FF]+$/.test(str);
2546
2597
  }
@@ -2792,5 +2843,5 @@ function getZodiacSignFromDate(date) {
2792
2843
  }
2793
2844
 
2794
2845
  //#endregion
2795
- export { ZodiacSign, createZodiacMatcher, findAllZodiacInText, findFirstZodiacInText, getSupportedLocales, getZodiacDateRange, getZodiacSign, getZodiacSignFromDate, normalizeName };
2846
+ export { ZodiacSign, createZodiacMatcher, findAllZodiacInText, findFirstZodiacInText, getSupportedLocales, getZodiacDateRange, getZodiacNames, getZodiacSign, getZodiacSignFromDate, normalizeName };
2796
2847
  //# sourceMappingURL=index.mjs.map