dff-util 1.1.6 → 1.1.8

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/README.md CHANGED
@@ -243,10 +243,66 @@ ResponseType = {
243
243
  status?: string | number;
244
244
  data?: any;
245
245
  error?: any;
246
+ total?: number;
246
247
  };
247
248
 
248
249
  ```
249
250
 
251
+ ## SearchByLimitType
252
+ ```
253
+ export type SearchByLimitType = {
254
+ limit: number;
255
+ skip: number;
256
+ query?: Record<string, any>;
257
+ orderBy?: string;
258
+ order: "ASC" | "DESC";
259
+ };
260
+ ```
261
+
262
+ ## CountryType
263
+ ```
264
+ export type CountryType = {
265
+ code: string; // ISO 3166-1 alpha-2
266
+ name: string; // English country name
267
+ locale: string; // Native/local language name
268
+ googleNames: string[]; // Common names
269
+ currencyCode: string; // ISO 4217 currency code
270
+ currency: string; // Currency symbol
271
+ telCode: number; // Numeric only (no +)
272
+ flag: string; // Emoji flag
273
+ };
274
+ ```
275
+
276
+ ## LangDirType
277
+ ```
278
+ export type LangDirType = "ltr" | "rtl";
279
+ ```
280
+ ## LanguageType
281
+ ```
282
+ export type LanguageType = {
283
+ lang: string; // Locale code (e.g., en-US, hi-IN)
284
+ code: string; // ISO 639-1 language code (e.g., en, hi)
285
+ country: string; // ISO 3166-1 alpha-2 country code (e.g., US, IN)
286
+ name: string; // English name of the language
287
+ dir: "ltr" | "rtl"; // Text direction
288
+ locale: string; // Native name of the language
289
+ };
290
+ ```
291
+ ## LangCountryType
292
+ ```
293
+ export type LangCountryType = {
294
+ lang: string; // Locale code (e.g., en-US, hi-IN)
295
+ country: string; // ISO 3166-1 alpha-2 country code (e.g., US, IN)
296
+ name: string; // English name of the language
297
+ locale: string; // Native name of the language
298
+ currencyCode: string; // ISO 4217 currency code
299
+ currency: string; // Currency symbol
300
+ telCode: number; // Numeric only (no +)
301
+ flag: string; // Emoji flag
302
+ dir: "ltr" | "rtl"; // Text direction
303
+ };
304
+ ```
305
+
250
306
  ## ConstMessages
251
307
 
252
308
  ```
@@ -453,4 +509,254 @@ const main = async () => {
453
509
  };
454
510
 
455
511
  main();
512
+
513
+
514
+
456
515
  ```
516
+
517
+ ### Call LangText, CallLangCountry, CurrencyConvert,
518
+ ```
519
+ // bun run src/tests/util.ts
520
+
521
+ import { CurrencyConvert, LangCountryCode } from "../main/util";
522
+
523
+ const CallLangCountry = () => {
524
+ const lang = "en-US";
525
+ const country = LangCountryCode(lang);
526
+ console.log("LangCountryCode:: ", country);
527
+ };
528
+
529
+ const CallLangText = async () => {
530
+ const resp = await LangText("Hello, how are you?", "en-US", "te-IN");
531
+ console.log("Resp Kannada:: ", resp);
532
+ }
533
+
534
+ const CallCurrencyConvert = async () => {
535
+ const resp = await CurrencyConvert("INR", "USD");
536
+ console.log("Resp Currency:: ", resp);
537
+ }
538
+
539
+ import { LangText } from "../main/util";
540
+
541
+ const run = async () => {
542
+ await CallLangCountry();
543
+ await CallLangText();
544
+ await CallCurrencyConvert();
545
+ };
546
+
547
+ run();
548
+
549
+ ```
550
+
551
+ ### Type AllLanguageCodesType
552
+ ```
553
+ export type AllLanguageCodesType =
554
+ | "ps-AF"
555
+ | "sq-AL"
556
+ | "ar-DZ"
557
+ | "ca-AD"
558
+ | "pt-AO"
559
+ | "en-AG"
560
+ | "es-AR"
561
+ | "hy-AM"
562
+ | "en-AU"
563
+ | "de-AT"
564
+ | "az-AZ"
565
+ | "en-BS"
566
+ | "ar-BH"
567
+ | "bn-BD"
568
+ | "en-BB"
569
+ | "be-BY"
570
+ | "nl-BE"
571
+ | "en-BZ"
572
+ | "fr-BJ"
573
+ | "dz-BT"
574
+ | "es-BO"
575
+ | "bs-BA"
576
+ | "en-BW"
577
+ | "pt-BR"
578
+ | "ms-BN"
579
+ | "bg-BG"
580
+ | "fr-BF"
581
+ | "rn-BI"
582
+ | "pt-CV"
583
+ | "km-KH"
584
+ | "fr-CM"
585
+ | "en-CA"
586
+ | "fr-CF"
587
+ | "fr-TD"
588
+ | "es-CL"
589
+ | "zh-CN"
590
+ | "es-CO"
591
+ | "ar-KM"
592
+ | "fr-CG"
593
+ | "fr-CD"
594
+ | "es-CR"
595
+ | "fr-CI"
596
+ | "hr-HR"
597
+ | "es-CU"
598
+ | "el-CY"
599
+ | "cs-CZ"
600
+ | "da-DK"
601
+ | "fr-DJ"
602
+ | "en-DM"
603
+ | "es-DO"
604
+ | "es-EC"
605
+ | "ar-EG"
606
+ | "es-SV"
607
+ | "es-GQ"
608
+ | "ti-ER"
609
+ | "et-EE"
610
+ | "si-SZ"
611
+ | "am-ET"
612
+ | "en-FJ"
613
+ | "fi-FI"
614
+ | "fr-FR"
615
+ | "fr-GA"
616
+ | "en-GM"
617
+ | "ka-GE"
618
+ | "de-DE"
619
+ | "en-GH"
620
+ | "el-GR"
621
+ | "en-GD"
622
+ | "es-GT"
623
+ | "fr-GN"
624
+ | "pt-GW"
625
+ | "en-GY"
626
+ | "fr-HT"
627
+ | "es-HN"
628
+ | "hu-HU"
629
+ | "is-IS"
630
+ | "hi-IN"
631
+ | "kn-IN"
632
+ | "ta-IN"
633
+ | "te-IN"
634
+ | "bn-IN"
635
+ | "mr-IN"
636
+ | "gu-IN"
637
+ | "ml-IN"
638
+ | "pa-IN"
639
+ | "or-IN"
640
+ | "as-IN"
641
+ | "id-ID"
642
+ | "fa-IR"
643
+ | "ar-IQ"
644
+ | "ga-IE"
645
+ | "he-IL"
646
+ | "it-IT"
647
+ | "en-JM"
648
+ | "ja-JP"
649
+ | "ar-JO"
650
+ | "kk-KZ"
651
+ | "sw-KE"
652
+ | "en-KI"
653
+ | "ko-KP"
654
+ | "ko-KR"
655
+ | "ar-KW"
656
+ | "ky-KG"
657
+ | "lo-LA"
658
+ | "lv-LV"
659
+ | "ar-LB"
660
+ | "st-LS"
661
+ | "en-LR"
662
+ | "ar-LY"
663
+ | "de-LI"
664
+ | "lt-LT"
665
+ | "fr-LU"
666
+ | "mg-MG"
667
+ | "ny-MW"
668
+ | "ms-MY"
669
+ | "dv-MV"
670
+ | "fr-ML"
671
+ | "mt-MT"
672
+ | "en-MH"
673
+ | "ar-MR"
674
+ | "en-MU"
675
+ | "es-MX"
676
+ | "en-FM"
677
+ | "ro-MD"
678
+ | "fr-MC"
679
+ | "mn-MN"
680
+ | "sr-ME"
681
+ | "ar-MA"
682
+ | "pt-MZ"
683
+ | "my-MM"
684
+ | "en-NA"
685
+ | "en-NR"
686
+ | "ne-NP"
687
+ | "nl-NL"
688
+ | "en-NZ"
689
+ | "es-NI"
690
+ | "fr-NE"
691
+ | "en-NG"
692
+ | "yo-NG"
693
+ | "ha-NG"
694
+ | "ig-NG"
695
+ | "en-NU"
696
+ | "nb-NO"
697
+ | "ar-OM"
698
+ | "ur-PK"
699
+ | "en-PW"
700
+ | "ar-PS"
701
+ | "es-PA"
702
+ | "en-PG"
703
+ | "es-PY"
704
+ | "es-PE"
705
+ | "tl-PH"
706
+ | "pl-PL"
707
+ | "pt-PT"
708
+ | "ar-QA"
709
+ | "ro-RO"
710
+ | "ru-RU"
711
+ | "rw-RW"
712
+ | "en-KN"
713
+ | "en-LC"
714
+ | "en-VC"
715
+ | "sm-WS"
716
+ | "it-SM"
717
+ | "pt-ST"
718
+ | "ar-SA"
719
+ | "fr-SN"
720
+ | "sr-RS"
721
+ | "en-SC"
722
+ | "en-SL"
723
+ | "en-SG"
724
+ | "sk-SK"
725
+ | "sl-SI"
726
+ | "en-SB"
727
+ | "so-SO"
728
+ | "af-ZA"
729
+ | "en-SS"
730
+ | "es-ES"
731
+ | "si-LK"
732
+ | "ar-SD"
733
+ | "nl-SR"
734
+ | "sv-SE"
735
+ | "de-CH"
736
+ | "ar-SY"
737
+ | "tg-TJ"
738
+ | "sw-TZ"
739
+ | "th-TH"
740
+ | "pt-TL"
741
+ | "fr-TG"
742
+ | "to-TO"
743
+ | "en-TT"
744
+ | "ar-TN"
745
+ | "tr-TR"
746
+ | "tk-TM"
747
+ | "en-TV"
748
+ | "en-UG"
749
+ | "uk-UA"
750
+ | "ar-AE"
751
+ | "en-GB"
752
+ | "en-US"
753
+ | "es-UY"
754
+ | "uz-UZ"
755
+ | "bi-VU"
756
+ | "it-VA"
757
+ | "es-VE"
758
+ | "vi-VN"
759
+ | "ar-YE"
760
+ | "en-ZM"
761
+ | "en-ZW";
762
+ ```
package/dist/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  export * from './main/util';
2
2
  export * from './main/jwt-util';
3
3
  export * from './main/http';
4
- export * from './main/regexr';
4
+ export * from './main/reg-exr';
5
5
  export * from './main/const-value';
6
6
  export * from './main/const-type';
7
7
  export * from './main/const-messages';
8
+ export * from './main/countries';
9
+ export * from './main/languages';
package/dist/index.js CHANGED
@@ -17,7 +17,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./main/util"), exports);
18
18
  __exportStar(require("./main/jwt-util"), exports);
19
19
  __exportStar(require("./main/http"), exports);
20
- __exportStar(require("./main/regexr"), exports);
20
+ __exportStar(require("./main/reg-exr"), exports);
21
21
  __exportStar(require("./main/const-value"), exports);
22
22
  __exportStar(require("./main/const-type"), exports);
23
23
  __exportStar(require("./main/const-messages"), exports);
24
+ __exportStar(require("./main/countries"), exports);
25
+ __exportStar(require("./main/languages"), exports);
@@ -23,4 +23,43 @@ export type ResponseType = {
23
23
  status?: string | number;
24
24
  data?: any;
25
25
  error?: any;
26
+ total?: number;
26
27
  };
28
+ export type SearchByLimitType = {
29
+ limit: number;
30
+ skip: number;
31
+ query?: Record<string, any>;
32
+ orderBy?: string;
33
+ order: "ASC" | "DESC";
34
+ };
35
+ export type CountryType = {
36
+ code: string;
37
+ name: string;
38
+ locale: string;
39
+ googleNames: string[];
40
+ currencyCode: string;
41
+ currency: string;
42
+ telCode: number;
43
+ flag: string;
44
+ };
45
+ export type LangDirType = "ltr" | "rtl";
46
+ export type LanguageType = {
47
+ lang: string;
48
+ code: string;
49
+ country: string;
50
+ name: string;
51
+ dir: "ltr" | "rtl";
52
+ locale: string;
53
+ };
54
+ export type LangCountryType = {
55
+ lang: string;
56
+ country: string;
57
+ name: string;
58
+ locale: string;
59
+ currencyCode: string;
60
+ currency: string;
61
+ telCode: number;
62
+ flag: string;
63
+ dir: "ltr" | "rtl";
64
+ };
65
+ export type AllLanguageCodesType = "ps-AF" | "sq-AL" | "ar-DZ" | "ca-AD" | "pt-AO" | "en-AG" | "es-AR" | "hy-AM" | "en-AU" | "de-AT" | "az-AZ" | "en-BS" | "ar-BH" | "bn-BD" | "en-BB" | "be-BY" | "nl-BE" | "en-BZ" | "fr-BJ" | "dz-BT" | "es-BO" | "bs-BA" | "en-BW" | "pt-BR" | "ms-BN" | "bg-BG" | "fr-BF" | "rn-BI" | "pt-CV" | "km-KH" | "fr-CM" | "en-CA" | "fr-CF" | "fr-TD" | "es-CL" | "zh-CN" | "es-CO" | "ar-KM" | "fr-CG" | "fr-CD" | "es-CR" | "fr-CI" | "hr-HR" | "es-CU" | "el-CY" | "cs-CZ" | "da-DK" | "fr-DJ" | "en-DM" | "es-DO" | "es-EC" | "ar-EG" | "es-SV" | "es-GQ" | "ti-ER" | "et-EE" | "si-SZ" | "am-ET" | "en-FJ" | "fi-FI" | "fr-FR" | "fr-GA" | "en-GM" | "ka-GE" | "de-DE" | "en-GH" | "el-GR" | "en-GD" | "es-GT" | "fr-GN" | "pt-GW" | "en-GY" | "fr-HT" | "es-HN" | "hu-HU" | "is-IS" | "hi-IN" | "kn-IN" | "ta-IN" | "te-IN" | "bn-IN" | "mr-IN" | "gu-IN" | "ml-IN" | "pa-IN" | "or-IN" | "as-IN" | "id-ID" | "fa-IR" | "ar-IQ" | "ga-IE" | "he-IL" | "it-IT" | "en-JM" | "ja-JP" | "ar-JO" | "kk-KZ" | "sw-KE" | "en-KI" | "ko-KP" | "ko-KR" | "ar-KW" | "ky-KG" | "lo-LA" | "lv-LV" | "ar-LB" | "st-LS" | "en-LR" | "ar-LY" | "de-LI" | "lt-LT" | "fr-LU" | "mg-MG" | "ny-MW" | "ms-MY" | "dv-MV" | "fr-ML" | "mt-MT" | "en-MH" | "ar-MR" | "en-MU" | "es-MX" | "en-FM" | "ro-MD" | "fr-MC" | "mn-MN" | "sr-ME" | "ar-MA" | "pt-MZ" | "my-MM" | "en-NA" | "en-NR" | "ne-NP" | "nl-NL" | "en-NZ" | "es-NI" | "fr-NE" | "en-NG" | "yo-NG" | "ha-NG" | "ig-NG" | "en-NU" | "nb-NO" | "ar-OM" | "ur-PK" | "en-PW" | "ar-PS" | "es-PA" | "en-PG" | "es-PY" | "es-PE" | "tl-PH" | "pl-PL" | "pt-PT" | "ar-QA" | "ro-RO" | "ru-RU" | "rw-RW" | "en-KN" | "en-LC" | "en-VC" | "sm-WS" | "it-SM" | "pt-ST" | "ar-SA" | "fr-SN" | "sr-RS" | "en-SC" | "en-SL" | "en-SG" | "sk-SK" | "sl-SI" | "en-SB" | "so-SO" | "af-ZA" | "en-SS" | "es-ES" | "si-LK" | "ar-SD" | "nl-SR" | "sv-SE" | "de-CH" | "ar-SY" | "tg-TJ" | "sw-TZ" | "th-TH" | "pt-TL" | "fr-TG" | "to-TO" | "en-TT" | "ar-TN" | "tr-TR" | "tk-TM" | "en-TV" | "en-UG" | "uk-UA" | "ar-AE" | "en-GB" | "en-US" | "es-UY" | "uz-UZ" | "bi-VU" | "it-VA" | "es-VE" | "vi-VN" | "ar-YE" | "en-ZM" | "en-ZW";
@@ -0,0 +1,2 @@
1
+ import { CountryType } from "./const-type";
2
+ export declare const countries: CountryType[];