caseparser 4.0.0 → 4.2.0

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.cjs CHANGED
@@ -28,31 +28,91 @@ const CamelToPascal = (str) => Capitalize(str);
28
28
  const CamelToSnake = (str) => str.replace(/([A-Z])/g, (g) => "_" + g[0].toLowerCase());
29
29
  const CamelToUpperDash = (str) => Uppercase(CamelToDash(str));
30
30
  const CamelToUpperSnake = (str) => Uppercase(CamelToSnake(str));
31
+ const CamelToTrain = (str) => DashToTrain(CamelToDash(str));
32
+ const CamelToDot = (str) => DashToDot(CamelToDash(str));
31
33
  const DashToCamel = (str) => str.replace(/(\-\w)/g, (g) => g[1].toUpperCase());
32
34
  const DashToPascal = (str) => Capitalize(DashToCamel(str));
33
35
  const DashToSnake = (str) => str.replace(/(\-)/g, "_");
34
36
  const DashToUpperDash = (str) => Uppercase(str);
35
37
  const DashToUpperSnake = (str) => Uppercase(DashToSnake(str));
38
+ const DashToTrain = (str) => str.split("-").map(Capitalize).join("-");
39
+ const DashToDot = (str) => str.replace(/(\-)/g, ".");
36
40
  const PascalToCamel = (str) => Uncapitalize(str);
37
41
  const PascalToDash = (str) => CamelToDash(Uncapitalize(str));
38
42
  const PascalToSnake = (str) => CamelToSnake(Uncapitalize(str));
39
43
  const PascalToUpperDash = (str) => Uppercase(PascalToDash(str));
40
44
  const PascalToUpperSnake = (str) => Uppercase(PascalToSnake(str));
45
+ const PascalToTrain = (str) => DashToTrain(PascalToDash(str));
46
+ const PascalToDot = (str) => DashToDot(PascalToDash(str));
41
47
  const SnakeToCamel = (str) => str.replace(/(\_\w)/g, (g) => g[1].toUpperCase());
42
48
  const SnakeToDash = (str) => str.replace(/(\_)/g, "-");
43
49
  const SnakeToPascal = (str) => Capitalize(SnakeToCamel(str));
44
50
  const SnakeToUpperDash = (str) => Uppercase(SnakeToDash(str));
51
+ const SnakeToTrain = (str) => DashToTrain(SnakeToDash(str));
52
+ const SnakeToDot = (str) => DashToDot(SnakeToDash(str));
45
53
  const SnakeToUpperSnake = (str) => Uppercase(str);
46
54
  const UpperDashToCamel = (str) => DashToCamel(Lowercase(str));
47
55
  const UpperDashToDash = (str) => Lowercase(str);
48
56
  const UpperDashToPascal = (str) => Capitalize(UpperDashToCamel(str));
49
57
  const UpperDashToSnake = (str) => DashToSnake(UpperDashToDash(str));
50
58
  const UpperDashToUpperSnake = (str) => Uppercase(UpperDashToSnake(str));
59
+ const UpperDashToTrain = (str) => DashToTrain(UpperDashToDash(str));
60
+ const UpperDashToDot = (str) => DashToDot(UpperDashToDash(str));
51
61
  const UpperSnakeToCamel = (str) => SnakeToCamel(Lowercase(str));
52
62
  const UpperSnakeToDash = (str) => str.replace(/(\_)/g, "-").toLowerCase();
53
63
  const UpperSnakeToPascal = (str) => SnakeToPascal(Lowercase(str));
54
64
  const UpperSnakeToSnake = (str) => Lowercase(str);
55
65
  const UpperSnakeToUpperDash = (str) => Uppercase(UpperSnakeToDash(str));
66
+ const UpperSnakeToTrain = (str) => DashToTrain(UpperSnakeToDash(str));
67
+ const UpperSnakeToDot = (str) => DashToDot(UpperSnakeToDash(str));
68
+ const TrainToCamel = (str) => DashToCamel(TrainToDash(str));
69
+ const TrainToDash = (str) => Lowercase(str);
70
+ const TrainToDot = (str) => DashToDot(TrainToDash(str));
71
+ const TrainToPascal = (str) => DashToPascal(TrainToDash(str));
72
+ const TrainToSnake = (str) => DashToSnake(TrainToDash(str));
73
+ const TrainToUpperDash = (str) => Uppercase(str);
74
+ const TrainToUpperSnake = (str) => DashToUpperSnake(TrainToDash(str));
75
+ const DotToCamel = (str) => DashToCamel(DotToDash(str));
76
+ const DotToDash = (str) => str.replace(/(\.)/g, "-");
77
+ const DotToPascal = (str) => DashToPascal(DotToDash(str));
78
+ const DotToSnake = (str) => DashToSnake(DotToDash(str));
79
+ const DotToTrain = (str) => DashToTrain(DotToDash(str));
80
+ const DotToUpperDash = (str) => Uppercase(DotToDash(str));
81
+ const DotToUpperSnake = (str) => DashToUpperSnake(DotToDash(str));
82
+ const DashToTitle = (str) => str.split("-").map(Capitalize).join(" ");
83
+ const DashToSentence = (str) => Capitalize(str.replace(/(\-)/g, " "));
84
+ const CamelToTitle = (str) => DashToTitle(CamelToDash(str));
85
+ const CamelToSentence = (str) => DashToSentence(CamelToDash(str));
86
+ const PascalToTitle = (str) => DashToTitle(PascalToDash(str));
87
+ const PascalToSentence = (str) => DashToSentence(PascalToDash(str));
88
+ const SnakeToTitle = (str) => DashToTitle(SnakeToDash(str));
89
+ const SnakeToSentence = (str) => DashToSentence(SnakeToDash(str));
90
+ const UpperSnakeToTitle = (str) => DashToTitle(UpperSnakeToDash(str));
91
+ const UpperSnakeToSentence = (str) => DashToSentence(UpperSnakeToDash(str));
92
+ const UpperDashToTitle = (str) => DashToTitle(UpperDashToDash(str));
93
+ const UpperDashToSentence = (str) => DashToSentence(UpperDashToDash(str));
94
+ const TrainToTitle = (str) => DashToTitle(TrainToDash(str));
95
+ const TrainToSentence = (str) => DashToSentence(TrainToDash(str));
96
+ const DotToTitle = (str) => DashToTitle(DotToDash(str));
97
+ const DotToSentence = (str) => DashToSentence(DotToDash(str));
98
+ const TitleToDash = (str) => Lowercase(str).replace(/( )/g, "-");
99
+ const TitleToCamel = (str) => DashToCamel(TitleToDash(str));
100
+ const TitleToPascal = (str) => DashToPascal(TitleToDash(str));
101
+ const TitleToSnake = (str) => DashToSnake(TitleToDash(str));
102
+ const TitleToUpperSnake = (str) => DashToUpperSnake(TitleToDash(str));
103
+ const TitleToUpperDash = (str) => DashToUpperDash(TitleToDash(str));
104
+ const TitleToTrain = (str) => DashToTrain(TitleToDash(str));
105
+ const TitleToDot = (str) => DashToDot(TitleToDash(str));
106
+ const TitleToSentence = (str) => DashToSentence(TitleToDash(str));
107
+ const SentenceToDash = (str) => Lowercase(str).replace(/( )/g, "-");
108
+ const SentenceToCamel = (str) => DashToCamel(SentenceToDash(str));
109
+ const SentenceToPascal = (str) => DashToPascal(SentenceToDash(str));
110
+ const SentenceToSnake = (str) => DashToSnake(SentenceToDash(str));
111
+ const SentenceToUpperSnake = (str) => DashToUpperSnake(SentenceToDash(str));
112
+ const SentenceToUpperDash = (str) => DashToUpperDash(SentenceToDash(str));
113
+ const SentenceToTrain = (str) => DashToTrain(SentenceToDash(str));
114
+ const SentenceToDot = (str) => DashToDot(SentenceToDash(str));
115
+ const SentenceToTitle = (str) => DashToTitle(SentenceToDash(str));
56
116
  function parse(input, type) {
57
117
  return {
58
118
  CamelToDash,
@@ -84,7 +144,67 @@ function parse(input, type) {
84
144
  UpperDashToSnake,
85
145
  UpperDashToDash,
86
146
  UpperDashToPascal,
87
- UpperDashToUpperSnake
147
+ UpperDashToUpperSnake,
148
+ CamelToTrain,
149
+ CamelToDot,
150
+ PascalToTrain,
151
+ PascalToDot,
152
+ SnakeToTrain,
153
+ SnakeToDot,
154
+ DashToTrain,
155
+ DashToDot,
156
+ UpperSnakeToTrain,
157
+ UpperSnakeToDot,
158
+ UpperDashToTrain,
159
+ UpperDashToDot,
160
+ TrainToCamel,
161
+ TrainToPascal,
162
+ TrainToSnake,
163
+ TrainToDash,
164
+ TrainToUpperSnake,
165
+ TrainToUpperDash,
166
+ TrainToDot,
167
+ DotToCamel,
168
+ DotToPascal,
169
+ DotToSnake,
170
+ DotToDash,
171
+ DotToUpperSnake,
172
+ DotToUpperDash,
173
+ DotToTrain,
174
+ CamelToTitle,
175
+ CamelToSentence,
176
+ PascalToTitle,
177
+ PascalToSentence,
178
+ SnakeToTitle,
179
+ SnakeToSentence,
180
+ DashToTitle,
181
+ DashToSentence,
182
+ UpperSnakeToTitle,
183
+ UpperSnakeToSentence,
184
+ UpperDashToTitle,
185
+ UpperDashToSentence,
186
+ TrainToTitle,
187
+ TrainToSentence,
188
+ DotToTitle,
189
+ DotToSentence,
190
+ TitleToCamel,
191
+ TitleToPascal,
192
+ TitleToSnake,
193
+ TitleToDash,
194
+ TitleToUpperSnake,
195
+ TitleToUpperDash,
196
+ TitleToTrain,
197
+ TitleToDot,
198
+ TitleToSentence,
199
+ SentenceToCamel,
200
+ SentenceToPascal,
201
+ SentenceToSnake,
202
+ SentenceToDash,
203
+ SentenceToUpperSnake,
204
+ SentenceToUpperDash,
205
+ SentenceToTrain,
206
+ SentenceToDot,
207
+ SentenceToTitle
88
208
  }[type](input);
89
209
  }
90
210
  //#endregion
@@ -187,6 +307,54 @@ function camelToUpperSnake(input) {
187
307
  function camelToUpperDash(input) {
188
308
  return converter(input, "CamelToUpperDash");
189
309
  }
310
+ /**
311
+ * Converts a string, or the keys of an object/array (deeply), from camelCase to Train-Case.
312
+ *
313
+ * @example
314
+ * ```ts
315
+ * camelToTrain('helloWorld'); // 'Hello-World'
316
+ * camelToTrain({ firstName: 'John' }); // { 'First-Name': 'John' }
317
+ * ```
318
+ */
319
+ function camelToTrain(input) {
320
+ return converter(input, "CamelToTrain");
321
+ }
322
+ /**
323
+ * Converts a string, or the keys of an object/array (deeply), from camelCase to dot.case.
324
+ *
325
+ * @example
326
+ * ```ts
327
+ * camelToDot('helloWorld'); // 'hello.world'
328
+ * camelToDot({ firstName: 'John' }); // { 'first.name': 'John' }
329
+ * ```
330
+ */
331
+ function camelToDot(input) {
332
+ return converter(input, "CamelToDot");
333
+ }
334
+ /**
335
+ * Converts a string, or the keys of an object/array (deeply), from camelCase to Title Case.
336
+ *
337
+ * @example
338
+ * ```ts
339
+ * camelToTitle('helloWorld'); // 'Hello World'
340
+ * camelToTitle({ firstName: 'John' }); // { 'First Name': 'John' }
341
+ * ```
342
+ */
343
+ function camelToTitle(input) {
344
+ return converter(input, "CamelToTitle");
345
+ }
346
+ /**
347
+ * Converts a string, or the keys of an object/array (deeply), from camelCase to Sentence case.
348
+ *
349
+ * @example
350
+ * ```ts
351
+ * camelToSentence('helloWorld'); // 'Hello world'
352
+ * camelToSentence({ firstName: 'John' }); // { 'First name': 'John' }
353
+ * ```
354
+ */
355
+ function camelToSentence(input) {
356
+ return converter(input, "CamelToSentence");
357
+ }
190
358
  //#endregion
191
359
  //#region src/dashCase/dashCase.ts
192
360
  /**
@@ -249,6 +417,54 @@ function dashToUpperSnake(input) {
249
417
  function dashToUpperDash(input) {
250
418
  return converter(input, "DashToUpperDash");
251
419
  }
420
+ /**
421
+ * Converts a string, or the keys of an object/array (deeply), from dash-case to Train-Case.
422
+ *
423
+ * @example
424
+ * ```ts
425
+ * dashToTrain('hello-world'); // 'Hello-World'
426
+ * dashToTrain({ 'first-name': 'John' }); // { 'First-Name': 'John' }
427
+ * ```
428
+ */
429
+ function dashToTrain(input) {
430
+ return converter(input, "DashToTrain");
431
+ }
432
+ /**
433
+ * Converts a string, or the keys of an object/array (deeply), from dash-case to dot.case.
434
+ *
435
+ * @example
436
+ * ```ts
437
+ * dashToDot('hello-world'); // 'hello.world'
438
+ * dashToDot({ 'first-name': 'John' }); // { 'first.name': 'John' }
439
+ * ```
440
+ */
441
+ function dashToDot(input) {
442
+ return converter(input, "DashToDot");
443
+ }
444
+ /**
445
+ * Converts a string, or the keys of an object/array (deeply), from dash-case to Title Case.
446
+ *
447
+ * @example
448
+ * ```ts
449
+ * dashToTitle('hello-world'); // 'Hello World'
450
+ * dashToTitle({ 'first-name': 'John' }); // { 'First Name': 'John' }
451
+ * ```
452
+ */
453
+ function dashToTitle(input) {
454
+ return converter(input, "DashToTitle");
455
+ }
456
+ /**
457
+ * Converts a string, or the keys of an object/array (deeply), from dash-case to Sentence case.
458
+ *
459
+ * @example
460
+ * ```ts
461
+ * dashToSentence('hello-world'); // 'Hello world'
462
+ * dashToSentence({ 'first-name': 'John' }); // { 'First name': 'John' }
463
+ * ```
464
+ */
465
+ function dashToSentence(input) {
466
+ return converter(input, "DashToSentence");
467
+ }
252
468
  //#endregion
253
469
  //#region src/pascalCase/pascalCase.ts
254
470
  /**
@@ -311,6 +527,54 @@ function pascalToUpperSnake(input) {
311
527
  function pascalToUpperDash(input) {
312
528
  return converter(input, "PascalToUpperDash");
313
529
  }
530
+ /**
531
+ * Converts a string, or the keys of an object/array (deeply), from PascalCase to Train-Case.
532
+ *
533
+ * @example
534
+ * ```ts
535
+ * pascalToTrain('HelloWorld'); // 'Hello-World'
536
+ * pascalToTrain({ FirstName: 'John' }); // { 'First-Name': 'John' }
537
+ * ```
538
+ */
539
+ function pascalToTrain(input) {
540
+ return converter(input, "PascalToTrain");
541
+ }
542
+ /**
543
+ * Converts a string, or the keys of an object/array (deeply), from PascalCase to dot.case.
544
+ *
545
+ * @example
546
+ * ```ts
547
+ * pascalToDot('HelloWorld'); // 'hello.world'
548
+ * pascalToDot({ FirstName: 'John' }); // { 'first.name': 'John' }
549
+ * ```
550
+ */
551
+ function pascalToDot(input) {
552
+ return converter(input, "PascalToDot");
553
+ }
554
+ /**
555
+ * Converts a string, or the keys of an object/array (deeply), from PascalCase to Title Case.
556
+ *
557
+ * @example
558
+ * ```ts
559
+ * pascalToTitle('HelloWorld'); // 'Hello World'
560
+ * pascalToTitle({ FirstName: 'John' }); // { 'First Name': 'John' }
561
+ * ```
562
+ */
563
+ function pascalToTitle(input) {
564
+ return converter(input, "PascalToTitle");
565
+ }
566
+ /**
567
+ * Converts a string, or the keys of an object/array (deeply), from PascalCase to Sentence case.
568
+ *
569
+ * @example
570
+ * ```ts
571
+ * pascalToSentence('HelloWorld'); // 'Hello world'
572
+ * pascalToSentence({ FirstName: 'John' }); // { 'First name': 'John' }
573
+ * ```
574
+ */
575
+ function pascalToSentence(input) {
576
+ return converter(input, "PascalToSentence");
577
+ }
314
578
  //#endregion
315
579
  //#region src/snakeCase/snakeCase.ts
316
580
  /**
@@ -373,6 +637,494 @@ function snakeToUpperSnake(input) {
373
637
  function snakeToUpperDash(input) {
374
638
  return converter(input, "SnakeToUpperDash");
375
639
  }
640
+ /**
641
+ * Converts a string, or the keys of an object/array (deeply), from snake_case to Train-Case.
642
+ *
643
+ * @example
644
+ * ```ts
645
+ * snakeToTrain('hello_world'); // 'Hello-World'
646
+ * snakeToTrain({ first_name: 'John' }); // { 'First-Name': 'John' }
647
+ * ```
648
+ */
649
+ function snakeToTrain(input) {
650
+ return converter(input, "SnakeToTrain");
651
+ }
652
+ /**
653
+ * Converts a string, or the keys of an object/array (deeply), from snake_case to dot.case.
654
+ *
655
+ * @example
656
+ * ```ts
657
+ * snakeToDot('hello_world'); // 'hello.world'
658
+ * snakeToDot({ first_name: 'John' }); // { 'first.name': 'John' }
659
+ * ```
660
+ */
661
+ function snakeToDot(input) {
662
+ return converter(input, "SnakeToDot");
663
+ }
664
+ /**
665
+ * Converts a string, or the keys of an object/array (deeply), from snake_case to Title Case.
666
+ *
667
+ * @example
668
+ * ```ts
669
+ * snakeToTitle('hello_world'); // 'Hello World'
670
+ * snakeToTitle({ first_name: 'John' }); // { 'First Name': 'John' }
671
+ * ```
672
+ */
673
+ function snakeToTitle(input) {
674
+ return converter(input, "SnakeToTitle");
675
+ }
676
+ /**
677
+ * Converts a string, or the keys of an object/array (deeply), from snake_case to Sentence case.
678
+ *
679
+ * @example
680
+ * ```ts
681
+ * snakeToSentence('hello_world'); // 'Hello world'
682
+ * snakeToSentence({ first_name: 'John' }); // { 'First name': 'John' }
683
+ * ```
684
+ */
685
+ function snakeToSentence(input) {
686
+ return converter(input, "SnakeToSentence");
687
+ }
688
+ //#endregion
689
+ //#region src/trainCase/trainCase.ts
690
+ /**
691
+ * Converts a string, or the keys of an object/array (deeply), from Train-Case to camelCase.
692
+ *
693
+ * @example
694
+ * ```ts
695
+ * trainToCamel('Hello-World'); // 'helloWorld'
696
+ * trainToCamel({ 'First-Name': 'John' }); // { firstName: 'John' }
697
+ * ```
698
+ */
699
+ function trainToCamel(input) {
700
+ return converter(input, "TrainToCamel");
701
+ }
702
+ /**
703
+ * Converts a string, or the keys of an object/array (deeply), from Train-Case to PascalCase.
704
+ *
705
+ * @example
706
+ * ```ts
707
+ * trainToPascal('Hello-World'); // 'HelloWorld'
708
+ * trainToPascal({ 'First-Name': 'John' }); // { FirstName: 'John' }
709
+ * ```
710
+ */
711
+ function trainToPascal(input) {
712
+ return converter(input, "TrainToPascal");
713
+ }
714
+ /**
715
+ * Converts a string, or the keys of an object/array (deeply), from Train-Case to snake_case.
716
+ *
717
+ * @example
718
+ * ```ts
719
+ * trainToSnake('Hello-World'); // 'hello_world'
720
+ * trainToSnake({ 'First-Name': 'John' }); // { first_name: 'John' }
721
+ * ```
722
+ */
723
+ function trainToSnake(input) {
724
+ return converter(input, "TrainToSnake");
725
+ }
726
+ /**
727
+ * Converts a string, or the keys of an object/array (deeply), from Train-Case to dash-case.
728
+ *
729
+ * @example
730
+ * ```ts
731
+ * trainToDash('Hello-World'); // 'hello-world'
732
+ * trainToDash({ 'First-Name': 'John' }); // { 'first-name': 'John' }
733
+ * ```
734
+ */
735
+ function trainToDash(input) {
736
+ return converter(input, "TrainToDash");
737
+ }
738
+ /**
739
+ * Converts a string, or the keys of an object/array (deeply), from Train-Case to UPPER_SNAKE_CASE.
740
+ *
741
+ * @example
742
+ * ```ts
743
+ * trainToUpperSnake('Hello-World'); // 'HELLO_WORLD'
744
+ * trainToUpperSnake({ 'First-Name': 'John' }); // { FIRST_NAME: 'John' }
745
+ * ```
746
+ */
747
+ function trainToUpperSnake(input) {
748
+ return converter(input, "TrainToUpperSnake");
749
+ }
750
+ /**
751
+ * Converts a string, or the keys of an object/array (deeply), from Train-Case to UPPER-DASH-CASE.
752
+ *
753
+ * @example
754
+ * ```ts
755
+ * trainToUpperDash('Hello-World'); // 'HELLO-WORLD'
756
+ * trainToUpperDash({ 'First-Name': 'John' }); // { 'FIRST-NAME': 'John' }
757
+ * ```
758
+ */
759
+ function trainToUpperDash(input) {
760
+ return converter(input, "TrainToUpperDash");
761
+ }
762
+ /**
763
+ * Converts a string, or the keys of an object/array (deeply), from Train-Case to dot.case.
764
+ *
765
+ * @example
766
+ * ```ts
767
+ * trainToDot('Hello-World'); // 'hello.world'
768
+ * trainToDot({ 'First-Name': 'John' }); // { 'first.name': 'John' }
769
+ * ```
770
+ */
771
+ function trainToDot(input) {
772
+ return converter(input, "TrainToDot");
773
+ }
774
+ /**
775
+ * Converts a string, or the keys of an object/array (deeply), from Train-Case to Title Case.
776
+ *
777
+ * @example
778
+ * ```ts
779
+ * trainToTitle('Hello-World'); // 'Hello World'
780
+ * trainToTitle({ 'First-Name': 'John' }); // { 'First Name': 'John' }
781
+ * ```
782
+ */
783
+ function trainToTitle(input) {
784
+ return converter(input, "TrainToTitle");
785
+ }
786
+ /**
787
+ * Converts a string, or the keys of an object/array (deeply), from Train-Case to Sentence case.
788
+ *
789
+ * @example
790
+ * ```ts
791
+ * trainToSentence('Hello-World'); // 'Hello world'
792
+ * trainToSentence({ 'First-Name': 'John' }); // { 'First name': 'John' }
793
+ * ```
794
+ */
795
+ function trainToSentence(input) {
796
+ return converter(input, "TrainToSentence");
797
+ }
798
+ //#endregion
799
+ //#region src/dotCase/dotCase.ts
800
+ /**
801
+ * Converts a string, or the keys of an object/array (deeply), from dot.case to camelCase.
802
+ *
803
+ * @example
804
+ * ```ts
805
+ * dotToCamel('hello.world'); // 'helloWorld'
806
+ * dotToCamel({ 'first.name': 'John' }); // { firstName: 'John' }
807
+ * ```
808
+ */
809
+ function dotToCamel(input) {
810
+ return converter(input, "DotToCamel");
811
+ }
812
+ /**
813
+ * Converts a string, or the keys of an object/array (deeply), from dot.case to PascalCase.
814
+ *
815
+ * @example
816
+ * ```ts
817
+ * dotToPascal('hello.world'); // 'HelloWorld'
818
+ * dotToPascal({ 'first.name': 'John' }); // { FirstName: 'John' }
819
+ * ```
820
+ */
821
+ function dotToPascal(input) {
822
+ return converter(input, "DotToPascal");
823
+ }
824
+ /**
825
+ * Converts a string, or the keys of an object/array (deeply), from dot.case to snake_case.
826
+ *
827
+ * @example
828
+ * ```ts
829
+ * dotToSnake('hello.world'); // 'hello_world'
830
+ * dotToSnake({ 'first.name': 'John' }); // { first_name: 'John' }
831
+ * ```
832
+ */
833
+ function dotToSnake(input) {
834
+ return converter(input, "DotToSnake");
835
+ }
836
+ /**
837
+ * Converts a string, or the keys of an object/array (deeply), from dot.case to dash-case.
838
+ *
839
+ * @example
840
+ * ```ts
841
+ * dotToDash('hello.world'); // 'hello-world'
842
+ * dotToDash({ 'first.name': 'John' }); // { 'first-name': 'John' }
843
+ * ```
844
+ */
845
+ function dotToDash(input) {
846
+ return converter(input, "DotToDash");
847
+ }
848
+ /**
849
+ * Converts a string, or the keys of an object/array (deeply), from dot.case to UPPER_SNAKE_CASE.
850
+ *
851
+ * @example
852
+ * ```ts
853
+ * dotToUpperSnake('hello.world'); // 'HELLO_WORLD'
854
+ * dotToUpperSnake({ 'first.name': 'John' }); // { FIRST_NAME: 'John' }
855
+ * ```
856
+ */
857
+ function dotToUpperSnake(input) {
858
+ return converter(input, "DotToUpperSnake");
859
+ }
860
+ /**
861
+ * Converts a string, or the keys of an object/array (deeply), from dot.case to UPPER-DASH-CASE.
862
+ *
863
+ * @example
864
+ * ```ts
865
+ * dotToUpperDash('hello.world'); // 'HELLO-WORLD'
866
+ * dotToUpperDash({ 'first.name': 'John' }); // { 'FIRST-NAME': 'John' }
867
+ * ```
868
+ */
869
+ function dotToUpperDash(input) {
870
+ return converter(input, "DotToUpperDash");
871
+ }
872
+ /**
873
+ * Converts a string, or the keys of an object/array (deeply), from dot.case to Train-Case.
874
+ *
875
+ * @example
876
+ * ```ts
877
+ * dotToTrain('hello.world'); // 'Hello-World'
878
+ * dotToTrain({ 'first.name': 'John' }); // { 'First-Name': 'John' }
879
+ * ```
880
+ */
881
+ function dotToTrain(input) {
882
+ return converter(input, "DotToTrain");
883
+ }
884
+ /**
885
+ * Converts a string, or the keys of an object/array (deeply), from dot.case to Title Case.
886
+ *
887
+ * @example
888
+ * ```ts
889
+ * dotToTitle('hello.world'); // 'Hello World'
890
+ * dotToTitle({ 'first.name': 'John' }); // { 'First Name': 'John' }
891
+ * ```
892
+ */
893
+ function dotToTitle(input) {
894
+ return converter(input, "DotToTitle");
895
+ }
896
+ /**
897
+ * Converts a string, or the keys of an object/array (deeply), from dot.case to Sentence case.
898
+ *
899
+ * @example
900
+ * ```ts
901
+ * dotToSentence('hello.world'); // 'Hello world'
902
+ * dotToSentence({ 'first.name': 'John' }); // { 'First name': 'John' }
903
+ * ```
904
+ */
905
+ function dotToSentence(input) {
906
+ return converter(input, "DotToSentence");
907
+ }
908
+ //#endregion
909
+ //#region src/titleCase/titleCase.ts
910
+ /**
911
+ * Converts a string, or the keys of an object/array (deeply), from Title Case to camelCase.
912
+ *
913
+ * @example
914
+ * ```ts
915
+ * titleToCamel('Hello World'); // 'helloWorld'
916
+ * titleToCamel({ 'First Name': 'John' }); // { firstName: 'John' }
917
+ * ```
918
+ */
919
+ function titleToCamel(input) {
920
+ return converter(input, "TitleToCamel");
921
+ }
922
+ /**
923
+ * Converts a string, or the keys of an object/array (deeply), from Title Case to PascalCase.
924
+ *
925
+ * @example
926
+ * ```ts
927
+ * titleToPascal('Hello World'); // 'HelloWorld'
928
+ * titleToPascal({ 'First Name': 'John' }); // { FirstName: 'John' }
929
+ * ```
930
+ */
931
+ function titleToPascal(input) {
932
+ return converter(input, "TitleToPascal");
933
+ }
934
+ /**
935
+ * Converts a string, or the keys of an object/array (deeply), from Title Case to snake_case.
936
+ *
937
+ * @example
938
+ * ```ts
939
+ * titleToSnake('Hello World'); // 'hello_world'
940
+ * titleToSnake({ 'First Name': 'John' }); // { first_name: 'John' }
941
+ * ```
942
+ */
943
+ function titleToSnake(input) {
944
+ return converter(input, "TitleToSnake");
945
+ }
946
+ /**
947
+ * Converts a string, or the keys of an object/array (deeply), from Title Case to dash-case.
948
+ *
949
+ * @example
950
+ * ```ts
951
+ * titleToDash('Hello World'); // 'hello-world'
952
+ * titleToDash({ 'First Name': 'John' }); // { 'first-name': 'John' }
953
+ * ```
954
+ */
955
+ function titleToDash(input) {
956
+ return converter(input, "TitleToDash");
957
+ }
958
+ /**
959
+ * Converts a string, or the keys of an object/array (deeply), from Title Case to UPPER_SNAKE_CASE.
960
+ *
961
+ * @example
962
+ * ```ts
963
+ * titleToUpperSnake('Hello World'); // 'HELLO_WORLD'
964
+ * titleToUpperSnake({ 'First Name': 'John' }); // { FIRST_NAME: 'John' }
965
+ * ```
966
+ */
967
+ function titleToUpperSnake(input) {
968
+ return converter(input, "TitleToUpperSnake");
969
+ }
970
+ /**
971
+ * Converts a string, or the keys of an object/array (deeply), from Title Case to UPPER-DASH-CASE.
972
+ *
973
+ * @example
974
+ * ```ts
975
+ * titleToUpperDash('Hello World'); // 'HELLO-WORLD'
976
+ * titleToUpperDash({ 'First Name': 'John' }); // { 'FIRST-NAME': 'John' }
977
+ * ```
978
+ */
979
+ function titleToUpperDash(input) {
980
+ return converter(input, "TitleToUpperDash");
981
+ }
982
+ /**
983
+ * Converts a string, or the keys of an object/array (deeply), from Title Case to Train-Case.
984
+ *
985
+ * @example
986
+ * ```ts
987
+ * titleToTrain('Hello World'); // 'Hello-World'
988
+ * titleToTrain({ 'First Name': 'John' }); // { 'First-Name': 'John' }
989
+ * ```
990
+ */
991
+ function titleToTrain(input) {
992
+ return converter(input, "TitleToTrain");
993
+ }
994
+ /**
995
+ * Converts a string, or the keys of an object/array (deeply), from Title Case to dot.case.
996
+ *
997
+ * @example
998
+ * ```ts
999
+ * titleToDot('Hello World'); // 'hello.world'
1000
+ * titleToDot({ 'First Name': 'John' }); // { 'first.name': 'John' }
1001
+ * ```
1002
+ */
1003
+ function titleToDot(input) {
1004
+ return converter(input, "TitleToDot");
1005
+ }
1006
+ /**
1007
+ * Converts a string, or the keys of an object/array (deeply), from Title Case to Sentence case.
1008
+ *
1009
+ * @example
1010
+ * ```ts
1011
+ * titleToSentence('Hello World'); // 'Hello world'
1012
+ * titleToSentence({ 'First Name': 'John' }); // { 'First name': 'John' }
1013
+ * ```
1014
+ */
1015
+ function titleToSentence(input) {
1016
+ return converter(input, "TitleToSentence");
1017
+ }
1018
+ //#endregion
1019
+ //#region src/sentenceCase/sentenceCase.ts
1020
+ /**
1021
+ * Converts a string, or the keys of an object/array (deeply), from Sentence case to camelCase.
1022
+ *
1023
+ * @example
1024
+ * ```ts
1025
+ * sentenceToCamel('Hello world'); // 'helloWorld'
1026
+ * sentenceToCamel({ 'First name': 'John' }); // { firstName: 'John' }
1027
+ * ```
1028
+ */
1029
+ function sentenceToCamel(input) {
1030
+ return converter(input, "SentenceToCamel");
1031
+ }
1032
+ /**
1033
+ * Converts a string, or the keys of an object/array (deeply), from Sentence case to PascalCase.
1034
+ *
1035
+ * @example
1036
+ * ```ts
1037
+ * sentenceToPascal('Hello world'); // 'HelloWorld'
1038
+ * sentenceToPascal({ 'First name': 'John' }); // { FirstName: 'John' }
1039
+ * ```
1040
+ */
1041
+ function sentenceToPascal(input) {
1042
+ return converter(input, "SentenceToPascal");
1043
+ }
1044
+ /**
1045
+ * Converts a string, or the keys of an object/array (deeply), from Sentence case to snake_case.
1046
+ *
1047
+ * @example
1048
+ * ```ts
1049
+ * sentenceToSnake('Hello world'); // 'hello_world'
1050
+ * sentenceToSnake({ 'First name': 'John' }); // { first_name: 'John' }
1051
+ * ```
1052
+ */
1053
+ function sentenceToSnake(input) {
1054
+ return converter(input, "SentenceToSnake");
1055
+ }
1056
+ /**
1057
+ * Converts a string, or the keys of an object/array (deeply), from Sentence case to dash-case.
1058
+ *
1059
+ * @example
1060
+ * ```ts
1061
+ * sentenceToDash('Hello world'); // 'hello-world'
1062
+ * sentenceToDash({ 'First name': 'John' }); // { 'first-name': 'John' }
1063
+ * ```
1064
+ */
1065
+ function sentenceToDash(input) {
1066
+ return converter(input, "SentenceToDash");
1067
+ }
1068
+ /**
1069
+ * Converts a string, or the keys of an object/array (deeply), from Sentence case to UPPER_SNAKE_CASE.
1070
+ *
1071
+ * @example
1072
+ * ```ts
1073
+ * sentenceToUpperSnake('Hello world'); // 'HELLO_WORLD'
1074
+ * sentenceToUpperSnake({ 'First name': 'John' }); // { FIRST_NAME: 'John' }
1075
+ * ```
1076
+ */
1077
+ function sentenceToUpperSnake(input) {
1078
+ return converter(input, "SentenceToUpperSnake");
1079
+ }
1080
+ /**
1081
+ * Converts a string, or the keys of an object/array (deeply), from Sentence case to UPPER-DASH-CASE.
1082
+ *
1083
+ * @example
1084
+ * ```ts
1085
+ * sentenceToUpperDash('Hello world'); // 'HELLO-WORLD'
1086
+ * sentenceToUpperDash({ 'First name': 'John' }); // { 'FIRST-NAME': 'John' }
1087
+ * ```
1088
+ */
1089
+ function sentenceToUpperDash(input) {
1090
+ return converter(input, "SentenceToUpperDash");
1091
+ }
1092
+ /**
1093
+ * Converts a string, or the keys of an object/array (deeply), from Sentence case to Train-Case.
1094
+ *
1095
+ * @example
1096
+ * ```ts
1097
+ * sentenceToTrain('Hello world'); // 'Hello-World'
1098
+ * sentenceToTrain({ 'First name': 'John' }); // { 'First-Name': 'John' }
1099
+ * ```
1100
+ */
1101
+ function sentenceToTrain(input) {
1102
+ return converter(input, "SentenceToTrain");
1103
+ }
1104
+ /**
1105
+ * Converts a string, or the keys of an object/array (deeply), from Sentence case to dot.case.
1106
+ *
1107
+ * @example
1108
+ * ```ts
1109
+ * sentenceToDot('Hello world'); // 'hello.world'
1110
+ * sentenceToDot({ 'First name': 'John' }); // { 'first.name': 'John' }
1111
+ * ```
1112
+ */
1113
+ function sentenceToDot(input) {
1114
+ return converter(input, "SentenceToDot");
1115
+ }
1116
+ /**
1117
+ * Converts a string, or the keys of an object/array (deeply), from Sentence case to Title Case.
1118
+ *
1119
+ * @example
1120
+ * ```ts
1121
+ * sentenceToTitle('Hello world'); // 'Hello World'
1122
+ * sentenceToTitle({ 'First name': 'John' }); // { 'First Name': 'John' }
1123
+ * ```
1124
+ */
1125
+ function sentenceToTitle(input) {
1126
+ return converter(input, "SentenceToTitle");
1127
+ }
376
1128
  //#endregion
377
1129
  //#region src/upperDashCase/upperDashCase.ts
378
1130
  /**
@@ -435,6 +1187,54 @@ function upperDashToPascal(input) {
435
1187
  function upperDashToUpperSnake(input) {
436
1188
  return converter(input, "UpperDashToUpperSnake");
437
1189
  }
1190
+ /**
1191
+ * Converts a string, or the keys of an object/array (deeply), from UPPER-DASH-CASE to Train-Case.
1192
+ *
1193
+ * @example
1194
+ * ```ts
1195
+ * upperDashToTrain('HELLO-WORLD'); // 'Hello-World'
1196
+ * upperDashToTrain({ 'FIRST-NAME': 'John' }); // { 'First-Name': 'John' }
1197
+ * ```
1198
+ */
1199
+ function upperDashToTrain(input) {
1200
+ return converter(input, "UpperDashToTrain");
1201
+ }
1202
+ /**
1203
+ * Converts a string, or the keys of an object/array (deeply), from UPPER-DASH-CASE to dot.case.
1204
+ *
1205
+ * @example
1206
+ * ```ts
1207
+ * upperDashToDot('HELLO-WORLD'); // 'hello.world'
1208
+ * upperDashToDot({ 'FIRST-NAME': 'John' }); // { 'first.name': 'John' }
1209
+ * ```
1210
+ */
1211
+ function upperDashToDot(input) {
1212
+ return converter(input, "UpperDashToDot");
1213
+ }
1214
+ /**
1215
+ * Converts a string, or the keys of an object/array (deeply), from UPPER-DASH-CASE to Title Case.
1216
+ *
1217
+ * @example
1218
+ * ```ts
1219
+ * upperDashToTitle('HELLO-WORLD'); // 'Hello World'
1220
+ * upperDashToTitle({ 'FIRST-NAME': 'John' }); // { 'First Name': 'John' }
1221
+ * ```
1222
+ */
1223
+ function upperDashToTitle(input) {
1224
+ return converter(input, "UpperDashToTitle");
1225
+ }
1226
+ /**
1227
+ * Converts a string, or the keys of an object/array (deeply), from UPPER-DASH-CASE to Sentence case.
1228
+ *
1229
+ * @example
1230
+ * ```ts
1231
+ * upperDashToSentence('HELLO-WORLD'); // 'Hello world'
1232
+ * upperDashToSentence({ 'FIRST-NAME': 'John' }); // { 'First name': 'John' }
1233
+ * ```
1234
+ */
1235
+ function upperDashToSentence(input) {
1236
+ return converter(input, "UpperDashToSentence");
1237
+ }
438
1238
  //#endregion
439
1239
  //#region src/upperSnakeCase/upperSnakeCase.ts
440
1240
  /**
@@ -497,34 +1297,142 @@ function upperSnakeToPascal(input) {
497
1297
  function upperSnakeToUpperDash(input) {
498
1298
  return converter(input, "UpperSnakeToUpperDash");
499
1299
  }
1300
+ /**
1301
+ * Converts a string, or the keys of an object/array (deeply), from UPPER_SNAKE_CASE to Train-Case.
1302
+ *
1303
+ * @example
1304
+ * ```ts
1305
+ * upperSnakeToTrain('HELLO_WORLD'); // 'Hello-World'
1306
+ * upperSnakeToTrain({ FIRST_NAME: 'John' }); // { 'First-Name': 'John' }
1307
+ * ```
1308
+ */
1309
+ function upperSnakeToTrain(input) {
1310
+ return converter(input, "UpperSnakeToTrain");
1311
+ }
1312
+ /**
1313
+ * Converts a string, or the keys of an object/array (deeply), from UPPER_SNAKE_CASE to dot.case.
1314
+ *
1315
+ * @example
1316
+ * ```ts
1317
+ * upperSnakeToDot('HELLO_WORLD'); // 'hello.world'
1318
+ * upperSnakeToDot({ FIRST_NAME: 'John' }); // { 'first.name': 'John' }
1319
+ * ```
1320
+ */
1321
+ function upperSnakeToDot(input) {
1322
+ return converter(input, "UpperSnakeToDot");
1323
+ }
1324
+ /**
1325
+ * Converts a string, or the keys of an object/array (deeply), from UPPER_SNAKE_CASE to Title Case.
1326
+ *
1327
+ * @example
1328
+ * ```ts
1329
+ * upperSnakeToTitle('HELLO_WORLD'); // 'Hello World'
1330
+ * upperSnakeToTitle({ FIRST_NAME: 'John' }); // { 'First Name': 'John' }
1331
+ * ```
1332
+ */
1333
+ function upperSnakeToTitle(input) {
1334
+ return converter(input, "UpperSnakeToTitle");
1335
+ }
1336
+ /**
1337
+ * Converts a string, or the keys of an object/array (deeply), from UPPER_SNAKE_CASE to Sentence case.
1338
+ *
1339
+ * @example
1340
+ * ```ts
1341
+ * upperSnakeToSentence('HELLO_WORLD'); // 'Hello world'
1342
+ * upperSnakeToSentence({ FIRST_NAME: 'John' }); // { 'First name': 'John' }
1343
+ * ```
1344
+ */
1345
+ function upperSnakeToSentence(input) {
1346
+ return converter(input, "UpperSnakeToSentence");
1347
+ }
500
1348
  //#endregion
501
1349
  exports.camelToDash = camelToDash;
1350
+ exports.camelToDot = camelToDot;
502
1351
  exports.camelToPascal = camelToPascal;
1352
+ exports.camelToSentence = camelToSentence;
503
1353
  exports.camelToSnake = camelToSnake;
1354
+ exports.camelToTitle = camelToTitle;
1355
+ exports.camelToTrain = camelToTrain;
504
1356
  exports.camelToUpperDash = camelToUpperDash;
505
1357
  exports.camelToUpperSnake = camelToUpperSnake;
506
1358
  exports.dashToCamel = dashToCamel;
1359
+ exports.dashToDot = dashToDot;
507
1360
  exports.dashToPascal = dashToPascal;
1361
+ exports.dashToSentence = dashToSentence;
508
1362
  exports.dashToSnake = dashToSnake;
1363
+ exports.dashToTitle = dashToTitle;
1364
+ exports.dashToTrain = dashToTrain;
509
1365
  exports.dashToUpperDash = dashToUpperDash;
510
1366
  exports.dashToUpperSnake = dashToUpperSnake;
1367
+ exports.dotToCamel = dotToCamel;
1368
+ exports.dotToDash = dotToDash;
1369
+ exports.dotToPascal = dotToPascal;
1370
+ exports.dotToSentence = dotToSentence;
1371
+ exports.dotToSnake = dotToSnake;
1372
+ exports.dotToTitle = dotToTitle;
1373
+ exports.dotToTrain = dotToTrain;
1374
+ exports.dotToUpperDash = dotToUpperDash;
1375
+ exports.dotToUpperSnake = dotToUpperSnake;
511
1376
  exports.pascalToCamel = pascalToCamel;
512
1377
  exports.pascalToDash = pascalToDash;
1378
+ exports.pascalToDot = pascalToDot;
1379
+ exports.pascalToSentence = pascalToSentence;
513
1380
  exports.pascalToSnake = pascalToSnake;
1381
+ exports.pascalToTitle = pascalToTitle;
1382
+ exports.pascalToTrain = pascalToTrain;
514
1383
  exports.pascalToUpperDash = pascalToUpperDash;
515
1384
  exports.pascalToUpperSnake = pascalToUpperSnake;
1385
+ exports.sentenceToCamel = sentenceToCamel;
1386
+ exports.sentenceToDash = sentenceToDash;
1387
+ exports.sentenceToDot = sentenceToDot;
1388
+ exports.sentenceToPascal = sentenceToPascal;
1389
+ exports.sentenceToSnake = sentenceToSnake;
1390
+ exports.sentenceToTitle = sentenceToTitle;
1391
+ exports.sentenceToTrain = sentenceToTrain;
1392
+ exports.sentenceToUpperDash = sentenceToUpperDash;
1393
+ exports.sentenceToUpperSnake = sentenceToUpperSnake;
516
1394
  exports.snakeToCamel = snakeToCamel;
517
1395
  exports.snakeToDash = snakeToDash;
1396
+ exports.snakeToDot = snakeToDot;
518
1397
  exports.snakeToPascal = snakeToPascal;
1398
+ exports.snakeToSentence = snakeToSentence;
1399
+ exports.snakeToTitle = snakeToTitle;
1400
+ exports.snakeToTrain = snakeToTrain;
519
1401
  exports.snakeToUpperDash = snakeToUpperDash;
520
1402
  exports.snakeToUpperSnake = snakeToUpperSnake;
1403
+ exports.titleToCamel = titleToCamel;
1404
+ exports.titleToDash = titleToDash;
1405
+ exports.titleToDot = titleToDot;
1406
+ exports.titleToPascal = titleToPascal;
1407
+ exports.titleToSentence = titleToSentence;
1408
+ exports.titleToSnake = titleToSnake;
1409
+ exports.titleToTrain = titleToTrain;
1410
+ exports.titleToUpperDash = titleToUpperDash;
1411
+ exports.titleToUpperSnake = titleToUpperSnake;
1412
+ exports.trainToCamel = trainToCamel;
1413
+ exports.trainToDash = trainToDash;
1414
+ exports.trainToDot = trainToDot;
1415
+ exports.trainToPascal = trainToPascal;
1416
+ exports.trainToSentence = trainToSentence;
1417
+ exports.trainToSnake = trainToSnake;
1418
+ exports.trainToTitle = trainToTitle;
1419
+ exports.trainToUpperDash = trainToUpperDash;
1420
+ exports.trainToUpperSnake = trainToUpperSnake;
521
1421
  exports.upperDashToCamel = upperDashToCamel;
522
1422
  exports.upperDashToDash = upperDashToDash;
1423
+ exports.upperDashToDot = upperDashToDot;
523
1424
  exports.upperDashToPascal = upperDashToPascal;
1425
+ exports.upperDashToSentence = upperDashToSentence;
524
1426
  exports.upperDashToSnake = upperDashToSnake;
1427
+ exports.upperDashToTitle = upperDashToTitle;
1428
+ exports.upperDashToTrain = upperDashToTrain;
525
1429
  exports.upperDashToUpperSnake = upperDashToUpperSnake;
526
1430
  exports.upperSnakeToCamel = upperSnakeToCamel;
527
1431
  exports.upperSnakeToDash = upperSnakeToDash;
1432
+ exports.upperSnakeToDot = upperSnakeToDot;
528
1433
  exports.upperSnakeToPascal = upperSnakeToPascal;
1434
+ exports.upperSnakeToSentence = upperSnakeToSentence;
529
1435
  exports.upperSnakeToSnake = upperSnakeToSnake;
1436
+ exports.upperSnakeToTitle = upperSnakeToTitle;
1437
+ exports.upperSnakeToTrain = upperSnakeToTrain;
530
1438
  exports.upperSnakeToUpperDash = upperSnakeToUpperDash;