caseparser 4.1.0 → 4.3.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/README.md +76 -21
- package/dist/index.cjs +996 -35
- package/dist/index.d.cts +788 -11
- package/dist/index.d.ts +788 -11
- package/dist/index.js +953 -36
- package/package.json +6 -2
package/dist/index.cjs
CHANGED
|
@@ -22,6 +22,35 @@ function Uncapitalize(str) {
|
|
|
22
22
|
return str.charAt(0).toLowerCase() + str.slice(1);
|
|
23
23
|
}
|
|
24
24
|
//#endregion
|
|
25
|
+
//#region src/parser/objectParser.ts
|
|
26
|
+
function objectParser(input, convertKey) {
|
|
27
|
+
const result = {};
|
|
28
|
+
for (const property of Object.keys(input)) {
|
|
29
|
+
const parsedKey = convertKey(property);
|
|
30
|
+
const value = input[property];
|
|
31
|
+
let parsedValue;
|
|
32
|
+
if (isArray(value)) parsedValue = arrayParser(value, convertKey);
|
|
33
|
+
else if (isObject(value)) parsedValue = objectParser(value, convertKey);
|
|
34
|
+
else parsedValue = value;
|
|
35
|
+
Object.defineProperty(result, parsedKey, {
|
|
36
|
+
value: parsedValue,
|
|
37
|
+
enumerable: true,
|
|
38
|
+
writable: true,
|
|
39
|
+
configurable: true
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/parser/arrayParser.ts
|
|
46
|
+
function arrayParser(input, convertKey) {
|
|
47
|
+
return input.map((item) => {
|
|
48
|
+
if (isArray(item)) return arrayParser(item, convertKey);
|
|
49
|
+
if (isObject(item)) return objectParser(item, convertKey);
|
|
50
|
+
return item;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
25
54
|
//#region src/parser/stringParser.ts
|
|
26
55
|
const CamelToDash = (str) => str.replace(/([A-Z])/g, (g) => "-" + g[0].toLowerCase());
|
|
27
56
|
const CamelToPascal = (str) => Capitalize(str);
|
|
@@ -79,6 +108,40 @@ const DotToSnake = (str) => DashToSnake(DotToDash(str));
|
|
|
79
108
|
const DotToTrain = (str) => DashToTrain(DotToDash(str));
|
|
80
109
|
const DotToUpperDash = (str) => Uppercase(DotToDash(str));
|
|
81
110
|
const DotToUpperSnake = (str) => DashToUpperSnake(DotToDash(str));
|
|
111
|
+
const DashToTitle = (str) => str.split("-").map(Capitalize).join(" ");
|
|
112
|
+
const DashToSentence = (str) => Capitalize(str.replace(/(\-)/g, " "));
|
|
113
|
+
const CamelToTitle = (str) => DashToTitle(CamelToDash(str));
|
|
114
|
+
const CamelToSentence = (str) => DashToSentence(CamelToDash(str));
|
|
115
|
+
const PascalToTitle = (str) => DashToTitle(PascalToDash(str));
|
|
116
|
+
const PascalToSentence = (str) => DashToSentence(PascalToDash(str));
|
|
117
|
+
const SnakeToTitle = (str) => DashToTitle(SnakeToDash(str));
|
|
118
|
+
const SnakeToSentence = (str) => DashToSentence(SnakeToDash(str));
|
|
119
|
+
const UpperSnakeToTitle = (str) => DashToTitle(UpperSnakeToDash(str));
|
|
120
|
+
const UpperSnakeToSentence = (str) => DashToSentence(UpperSnakeToDash(str));
|
|
121
|
+
const UpperDashToTitle = (str) => DashToTitle(UpperDashToDash(str));
|
|
122
|
+
const UpperDashToSentence = (str) => DashToSentence(UpperDashToDash(str));
|
|
123
|
+
const TrainToTitle = (str) => DashToTitle(TrainToDash(str));
|
|
124
|
+
const TrainToSentence = (str) => DashToSentence(TrainToDash(str));
|
|
125
|
+
const DotToTitle = (str) => DashToTitle(DotToDash(str));
|
|
126
|
+
const DotToSentence = (str) => DashToSentence(DotToDash(str));
|
|
127
|
+
const TitleToDash = (str) => Lowercase(str).replace(/( )/g, "-");
|
|
128
|
+
const TitleToCamel = (str) => DashToCamel(TitleToDash(str));
|
|
129
|
+
const TitleToPascal = (str) => DashToPascal(TitleToDash(str));
|
|
130
|
+
const TitleToSnake = (str) => DashToSnake(TitleToDash(str));
|
|
131
|
+
const TitleToUpperSnake = (str) => DashToUpperSnake(TitleToDash(str));
|
|
132
|
+
const TitleToUpperDash = (str) => DashToUpperDash(TitleToDash(str));
|
|
133
|
+
const TitleToTrain = (str) => DashToTrain(TitleToDash(str));
|
|
134
|
+
const TitleToDot = (str) => DashToDot(TitleToDash(str));
|
|
135
|
+
const TitleToSentence = (str) => DashToSentence(TitleToDash(str));
|
|
136
|
+
const SentenceToDash = (str) => Lowercase(str).replace(/( )/g, "-");
|
|
137
|
+
const SentenceToCamel = (str) => DashToCamel(SentenceToDash(str));
|
|
138
|
+
const SentenceToPascal = (str) => DashToPascal(SentenceToDash(str));
|
|
139
|
+
const SentenceToSnake = (str) => DashToSnake(SentenceToDash(str));
|
|
140
|
+
const SentenceToUpperSnake = (str) => DashToUpperSnake(SentenceToDash(str));
|
|
141
|
+
const SentenceToUpperDash = (str) => DashToUpperDash(SentenceToDash(str));
|
|
142
|
+
const SentenceToTrain = (str) => DashToTrain(SentenceToDash(str));
|
|
143
|
+
const SentenceToDot = (str) => DashToDot(SentenceToDash(str));
|
|
144
|
+
const SentenceToTitle = (str) => DashToTitle(SentenceToDash(str));
|
|
82
145
|
function parse(input, type) {
|
|
83
146
|
return {
|
|
84
147
|
CamelToDash,
|
|
@@ -136,46 +199,53 @@ function parse(input, type) {
|
|
|
136
199
|
DotToDash,
|
|
137
200
|
DotToUpperSnake,
|
|
138
201
|
DotToUpperDash,
|
|
139
|
-
DotToTrain
|
|
202
|
+
DotToTrain,
|
|
203
|
+
CamelToTitle,
|
|
204
|
+
CamelToSentence,
|
|
205
|
+
PascalToTitle,
|
|
206
|
+
PascalToSentence,
|
|
207
|
+
SnakeToTitle,
|
|
208
|
+
SnakeToSentence,
|
|
209
|
+
DashToTitle,
|
|
210
|
+
DashToSentence,
|
|
211
|
+
UpperSnakeToTitle,
|
|
212
|
+
UpperSnakeToSentence,
|
|
213
|
+
UpperDashToTitle,
|
|
214
|
+
UpperDashToSentence,
|
|
215
|
+
TrainToTitle,
|
|
216
|
+
TrainToSentence,
|
|
217
|
+
DotToTitle,
|
|
218
|
+
DotToSentence,
|
|
219
|
+
TitleToCamel,
|
|
220
|
+
TitleToPascal,
|
|
221
|
+
TitleToSnake,
|
|
222
|
+
TitleToDash,
|
|
223
|
+
TitleToUpperSnake,
|
|
224
|
+
TitleToUpperDash,
|
|
225
|
+
TitleToTrain,
|
|
226
|
+
TitleToDot,
|
|
227
|
+
TitleToSentence,
|
|
228
|
+
SentenceToCamel,
|
|
229
|
+
SentenceToPascal,
|
|
230
|
+
SentenceToSnake,
|
|
231
|
+
SentenceToDash,
|
|
232
|
+
SentenceToUpperSnake,
|
|
233
|
+
SentenceToUpperDash,
|
|
234
|
+
SentenceToTrain,
|
|
235
|
+
SentenceToDot,
|
|
236
|
+
SentenceToTitle
|
|
140
237
|
}[type](input);
|
|
141
238
|
}
|
|
142
239
|
//#endregion
|
|
143
|
-
//#region src/parser/objectParser.ts
|
|
144
|
-
function objectParser(input, type) {
|
|
145
|
-
const result = {};
|
|
146
|
-
for (const property of Object.keys(input)) {
|
|
147
|
-
const parsedKey = parse(property, type);
|
|
148
|
-
const value = input[property];
|
|
149
|
-
let parsedValue;
|
|
150
|
-
if (isArray(value)) parsedValue = arrayParser(value, type);
|
|
151
|
-
else if (isObject(value)) parsedValue = objectParser(value, type);
|
|
152
|
-
else parsedValue = value;
|
|
153
|
-
Object.defineProperty(result, parsedKey, {
|
|
154
|
-
value: parsedValue,
|
|
155
|
-
enumerable: true,
|
|
156
|
-
writable: true,
|
|
157
|
-
configurable: true
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
return result;
|
|
161
|
-
}
|
|
162
|
-
//#endregion
|
|
163
|
-
//#region src/parser/arrayParser.ts
|
|
164
|
-
function arrayParser(input, type) {
|
|
165
|
-
return input.map((item) => {
|
|
166
|
-
if (isArray(item)) return arrayParser(item, type);
|
|
167
|
-
if (isObject(item)) return objectParser(item, type);
|
|
168
|
-
return item;
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
//#endregion
|
|
172
240
|
//#region src/parser/parser.ts
|
|
241
|
+
/** Converts a string, or the keys of an object/array (deeply), with `convertKey`. */
|
|
242
|
+
function convert(input, convertKey) {
|
|
243
|
+
if (isString(input)) return convertKey(input);
|
|
244
|
+
if (isArray(input)) return arrayParser(input, convertKey);
|
|
245
|
+
if (isObject(input)) return objectParser(input, convertKey);
|
|
246
|
+
}
|
|
173
247
|
function converter(input, type) {
|
|
174
|
-
|
|
175
|
-
if (isString(input)) result = parse(input, type);
|
|
176
|
-
if (isArray(input)) result = arrayParser(input, type);
|
|
177
|
-
if (isObject(input)) result = objectParser(input, type);
|
|
178
|
-
return result;
|
|
248
|
+
return convert(input, (key) => parse(key, type));
|
|
179
249
|
}
|
|
180
250
|
//#endregion
|
|
181
251
|
//#region src/camelCase/camelCase.ts
|
|
@@ -187,6 +257,9 @@ function converter(input, type) {
|
|
|
187
257
|
* camelToDash('helloWorld'); // 'hello-world'
|
|
188
258
|
* camelToDash({ firstName: 'John' }); // { 'first-name': 'John' }
|
|
189
259
|
* ```
|
|
260
|
+
*
|
|
261
|
+
* @deprecated Use `toDash` instead, which converts from any case. It keeps acronyms together,
|
|
262
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
190
263
|
*/
|
|
191
264
|
function camelToDash(input) {
|
|
192
265
|
return converter(input, "CamelToDash");
|
|
@@ -199,6 +272,9 @@ function camelToDash(input) {
|
|
|
199
272
|
* camelToSnake('helloWorld'); // 'hello_world'
|
|
200
273
|
* camelToSnake({ firstName: 'John' }); // { first_name: 'John' }
|
|
201
274
|
* ```
|
|
275
|
+
*
|
|
276
|
+
* @deprecated Use `toSnake` instead, which converts from any case. It keeps acronyms together,
|
|
277
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
202
278
|
*/
|
|
203
279
|
function camelToSnake(input) {
|
|
204
280
|
return converter(input, "CamelToSnake");
|
|
@@ -211,6 +287,9 @@ function camelToSnake(input) {
|
|
|
211
287
|
* camelToPascal('helloWorld'); // 'HelloWorld'
|
|
212
288
|
* camelToPascal({ firstName: 'John' }); // { FirstName: 'John' }
|
|
213
289
|
* ```
|
|
290
|
+
*
|
|
291
|
+
* @deprecated Use `toPascal` instead, which converts from any case. It keeps acronyms together,
|
|
292
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
214
293
|
*/
|
|
215
294
|
function camelToPascal(input) {
|
|
216
295
|
return converter(input, "CamelToPascal");
|
|
@@ -223,6 +302,9 @@ function camelToPascal(input) {
|
|
|
223
302
|
* camelToUpperSnake('helloWorld'); // 'HELLO_WORLD'
|
|
224
303
|
* camelToUpperSnake({ firstName: 'John' }); // { FIRST_NAME: 'John' }
|
|
225
304
|
* ```
|
|
305
|
+
*
|
|
306
|
+
* @deprecated Use `toUpperSnake` instead, which converts from any case. It keeps acronyms together,
|
|
307
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
226
308
|
*/
|
|
227
309
|
function camelToUpperSnake(input) {
|
|
228
310
|
return converter(input, "CamelToUpperSnake");
|
|
@@ -235,6 +317,9 @@ function camelToUpperSnake(input) {
|
|
|
235
317
|
* camelToUpperDash('helloWorld'); // 'HELLO-WORLD'
|
|
236
318
|
* camelToUpperDash({ firstName: 'John' }); // { 'FIRST-NAME': 'John' }
|
|
237
319
|
* ```
|
|
320
|
+
*
|
|
321
|
+
* @deprecated Use `toUpperDash` instead, which converts from any case. It keeps acronyms together,
|
|
322
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
238
323
|
*/
|
|
239
324
|
function camelToUpperDash(input) {
|
|
240
325
|
return converter(input, "CamelToUpperDash");
|
|
@@ -247,6 +332,9 @@ function camelToUpperDash(input) {
|
|
|
247
332
|
* camelToTrain('helloWorld'); // 'Hello-World'
|
|
248
333
|
* camelToTrain({ firstName: 'John' }); // { 'First-Name': 'John' }
|
|
249
334
|
* ```
|
|
335
|
+
*
|
|
336
|
+
* @deprecated Use `toTrain` instead, which converts from any case. It keeps acronyms together,
|
|
337
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
250
338
|
*/
|
|
251
339
|
function camelToTrain(input) {
|
|
252
340
|
return converter(input, "CamelToTrain");
|
|
@@ -259,10 +347,43 @@ function camelToTrain(input) {
|
|
|
259
347
|
* camelToDot('helloWorld'); // 'hello.world'
|
|
260
348
|
* camelToDot({ firstName: 'John' }); // { 'first.name': 'John' }
|
|
261
349
|
* ```
|
|
350
|
+
*
|
|
351
|
+
* @deprecated Use `toDot` instead, which converts from any case. It keeps acronyms together,
|
|
352
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
262
353
|
*/
|
|
263
354
|
function camelToDot(input) {
|
|
264
355
|
return converter(input, "CamelToDot");
|
|
265
356
|
}
|
|
357
|
+
/**
|
|
358
|
+
* Converts a string, or the keys of an object/array (deeply), from camelCase to Title Case.
|
|
359
|
+
*
|
|
360
|
+
* @example
|
|
361
|
+
* ```ts
|
|
362
|
+
* camelToTitle('helloWorld'); // 'Hello World'
|
|
363
|
+
* camelToTitle({ firstName: 'John' }); // { 'First Name': 'John' }
|
|
364
|
+
* ```
|
|
365
|
+
*
|
|
366
|
+
* @deprecated Use `toTitle` instead, which converts from any case. It keeps acronyms together,
|
|
367
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
368
|
+
*/
|
|
369
|
+
function camelToTitle(input) {
|
|
370
|
+
return converter(input, "CamelToTitle");
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Converts a string, or the keys of an object/array (deeply), from camelCase to Sentence case.
|
|
374
|
+
*
|
|
375
|
+
* @example
|
|
376
|
+
* ```ts
|
|
377
|
+
* camelToSentence('helloWorld'); // 'Hello world'
|
|
378
|
+
* camelToSentence({ firstName: 'John' }); // { 'First name': 'John' }
|
|
379
|
+
* ```
|
|
380
|
+
*
|
|
381
|
+
* @deprecated Use `toSentence` instead, which converts from any case. It keeps acronyms together,
|
|
382
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
383
|
+
*/
|
|
384
|
+
function camelToSentence(input) {
|
|
385
|
+
return converter(input, "CamelToSentence");
|
|
386
|
+
}
|
|
266
387
|
//#endregion
|
|
267
388
|
//#region src/dashCase/dashCase.ts
|
|
268
389
|
/**
|
|
@@ -273,6 +394,9 @@ function camelToDot(input) {
|
|
|
273
394
|
* dashToSnake('hello-world'); // 'hello_world'
|
|
274
395
|
* dashToSnake({ 'first-name': 'John' }); // { first_name: 'John' }
|
|
275
396
|
* ```
|
|
397
|
+
*
|
|
398
|
+
* @deprecated Use `toSnake` instead, which converts from any case. It keeps acronyms together,
|
|
399
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
276
400
|
*/
|
|
277
401
|
function dashToSnake(input) {
|
|
278
402
|
return converter(input, "DashToSnake");
|
|
@@ -285,6 +409,9 @@ function dashToSnake(input) {
|
|
|
285
409
|
* dashToCamel('hello-world'); // 'helloWorld'
|
|
286
410
|
* dashToCamel({ 'first-name': 'John' }); // { firstName: 'John' }
|
|
287
411
|
* ```
|
|
412
|
+
*
|
|
413
|
+
* @deprecated Use `toCamel` instead, which converts from any case. It keeps acronyms together,
|
|
414
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
288
415
|
*/
|
|
289
416
|
function dashToCamel(input) {
|
|
290
417
|
return converter(input, "DashToCamel");
|
|
@@ -297,6 +424,9 @@ function dashToCamel(input) {
|
|
|
297
424
|
* dashToPascal('hello-world'); // 'HelloWorld'
|
|
298
425
|
* dashToPascal({ 'first-name': 'John' }); // { FirstName: 'John' }
|
|
299
426
|
* ```
|
|
427
|
+
*
|
|
428
|
+
* @deprecated Use `toPascal` instead, which converts from any case. It keeps acronyms together,
|
|
429
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
300
430
|
*/
|
|
301
431
|
function dashToPascal(input) {
|
|
302
432
|
return converter(input, "DashToPascal");
|
|
@@ -309,6 +439,9 @@ function dashToPascal(input) {
|
|
|
309
439
|
* dashToUpperSnake('hello-world'); // 'HELLO_WORLD'
|
|
310
440
|
* dashToUpperSnake({ 'first-name': 'John' }); // { FIRST_NAME: 'John' }
|
|
311
441
|
* ```
|
|
442
|
+
*
|
|
443
|
+
* @deprecated Use `toUpperSnake` instead, which converts from any case. It keeps acronyms together,
|
|
444
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
312
445
|
*/
|
|
313
446
|
function dashToUpperSnake(input) {
|
|
314
447
|
return converter(input, "DashToUpperSnake");
|
|
@@ -321,6 +454,9 @@ function dashToUpperSnake(input) {
|
|
|
321
454
|
* dashToUpperDash('hello-world'); // 'HELLO-WORLD'
|
|
322
455
|
* dashToUpperDash({ 'first-name': 'John' }); // { 'FIRST-NAME': 'John' }
|
|
323
456
|
* ```
|
|
457
|
+
*
|
|
458
|
+
* @deprecated Use `toUpperDash` instead, which converts from any case. It keeps acronyms together,
|
|
459
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
324
460
|
*/
|
|
325
461
|
function dashToUpperDash(input) {
|
|
326
462
|
return converter(input, "DashToUpperDash");
|
|
@@ -333,6 +469,9 @@ function dashToUpperDash(input) {
|
|
|
333
469
|
* dashToTrain('hello-world'); // 'Hello-World'
|
|
334
470
|
* dashToTrain({ 'first-name': 'John' }); // { 'First-Name': 'John' }
|
|
335
471
|
* ```
|
|
472
|
+
*
|
|
473
|
+
* @deprecated Use `toTrain` instead, which converts from any case. It keeps acronyms together,
|
|
474
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
336
475
|
*/
|
|
337
476
|
function dashToTrain(input) {
|
|
338
477
|
return converter(input, "DashToTrain");
|
|
@@ -345,10 +484,43 @@ function dashToTrain(input) {
|
|
|
345
484
|
* dashToDot('hello-world'); // 'hello.world'
|
|
346
485
|
* dashToDot({ 'first-name': 'John' }); // { 'first.name': 'John' }
|
|
347
486
|
* ```
|
|
487
|
+
*
|
|
488
|
+
* @deprecated Use `toDot` instead, which converts from any case. It keeps acronyms together,
|
|
489
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
348
490
|
*/
|
|
349
491
|
function dashToDot(input) {
|
|
350
492
|
return converter(input, "DashToDot");
|
|
351
493
|
}
|
|
494
|
+
/**
|
|
495
|
+
* Converts a string, or the keys of an object/array (deeply), from dash-case to Title Case.
|
|
496
|
+
*
|
|
497
|
+
* @example
|
|
498
|
+
* ```ts
|
|
499
|
+
* dashToTitle('hello-world'); // 'Hello World'
|
|
500
|
+
* dashToTitle({ 'first-name': 'John' }); // { 'First Name': 'John' }
|
|
501
|
+
* ```
|
|
502
|
+
*
|
|
503
|
+
* @deprecated Use `toTitle` instead, which converts from any case. It keeps acronyms together,
|
|
504
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
505
|
+
*/
|
|
506
|
+
function dashToTitle(input) {
|
|
507
|
+
return converter(input, "DashToTitle");
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* Converts a string, or the keys of an object/array (deeply), from dash-case to Sentence case.
|
|
511
|
+
*
|
|
512
|
+
* @example
|
|
513
|
+
* ```ts
|
|
514
|
+
* dashToSentence('hello-world'); // 'Hello world'
|
|
515
|
+
* dashToSentence({ 'first-name': 'John' }); // { 'First name': 'John' }
|
|
516
|
+
* ```
|
|
517
|
+
*
|
|
518
|
+
* @deprecated Use `toSentence` instead, which converts from any case. It keeps acronyms together,
|
|
519
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
520
|
+
*/
|
|
521
|
+
function dashToSentence(input) {
|
|
522
|
+
return converter(input, "DashToSentence");
|
|
523
|
+
}
|
|
352
524
|
//#endregion
|
|
353
525
|
//#region src/pascalCase/pascalCase.ts
|
|
354
526
|
/**
|
|
@@ -359,6 +531,9 @@ function dashToDot(input) {
|
|
|
359
531
|
* pascalToCamel('HelloWorld'); // 'helloWorld'
|
|
360
532
|
* pascalToCamel({ FirstName: 'John' }); // { firstName: 'John' }
|
|
361
533
|
* ```
|
|
534
|
+
*
|
|
535
|
+
* @deprecated Use `toCamel` instead, which converts from any case. It keeps acronyms together,
|
|
536
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
362
537
|
*/
|
|
363
538
|
function pascalToCamel(input) {
|
|
364
539
|
return converter(input, "PascalToCamel");
|
|
@@ -371,6 +546,9 @@ function pascalToCamel(input) {
|
|
|
371
546
|
* pascalToSnake('HelloWorld'); // 'hello_world'
|
|
372
547
|
* pascalToSnake({ FirstName: 'John' }); // { first_name: 'John' }
|
|
373
548
|
* ```
|
|
549
|
+
*
|
|
550
|
+
* @deprecated Use `toSnake` instead, which converts from any case. It keeps acronyms together,
|
|
551
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
374
552
|
*/
|
|
375
553
|
function pascalToSnake(input) {
|
|
376
554
|
return converter(input, "PascalToSnake");
|
|
@@ -383,6 +561,9 @@ function pascalToSnake(input) {
|
|
|
383
561
|
* pascalToDash('HelloWorld'); // 'hello-world'
|
|
384
562
|
* pascalToDash({ FirstName: 'John' }); // { 'first-name': 'John' }
|
|
385
563
|
* ```
|
|
564
|
+
*
|
|
565
|
+
* @deprecated Use `toDash` instead, which converts from any case. It keeps acronyms together,
|
|
566
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
386
567
|
*/
|
|
387
568
|
function pascalToDash(input) {
|
|
388
569
|
return converter(input, "PascalToDash");
|
|
@@ -395,6 +576,9 @@ function pascalToDash(input) {
|
|
|
395
576
|
* pascalToUpperSnake('HelloWorld'); // 'HELLO_WORLD'
|
|
396
577
|
* pascalToUpperSnake({ FirstName: 'John' }); // { FIRST_NAME: 'John' }
|
|
397
578
|
* ```
|
|
579
|
+
*
|
|
580
|
+
* @deprecated Use `toUpperSnake` instead, which converts from any case. It keeps acronyms together,
|
|
581
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
398
582
|
*/
|
|
399
583
|
function pascalToUpperSnake(input) {
|
|
400
584
|
return converter(input, "PascalToUpperSnake");
|
|
@@ -407,6 +591,9 @@ function pascalToUpperSnake(input) {
|
|
|
407
591
|
* pascalToUpperDash('HelloWorld'); // 'HELLO-WORLD'
|
|
408
592
|
* pascalToUpperDash({ FirstName: 'John' }); // { 'FIRST-NAME': 'John' }
|
|
409
593
|
* ```
|
|
594
|
+
*
|
|
595
|
+
* @deprecated Use `toUpperDash` instead, which converts from any case. It keeps acronyms together,
|
|
596
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
410
597
|
*/
|
|
411
598
|
function pascalToUpperDash(input) {
|
|
412
599
|
return converter(input, "PascalToUpperDash");
|
|
@@ -419,6 +606,9 @@ function pascalToUpperDash(input) {
|
|
|
419
606
|
* pascalToTrain('HelloWorld'); // 'Hello-World'
|
|
420
607
|
* pascalToTrain({ FirstName: 'John' }); // { 'First-Name': 'John' }
|
|
421
608
|
* ```
|
|
609
|
+
*
|
|
610
|
+
* @deprecated Use `toTrain` instead, which converts from any case. It keeps acronyms together,
|
|
611
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
422
612
|
*/
|
|
423
613
|
function pascalToTrain(input) {
|
|
424
614
|
return converter(input, "PascalToTrain");
|
|
@@ -431,10 +621,43 @@ function pascalToTrain(input) {
|
|
|
431
621
|
* pascalToDot('HelloWorld'); // 'hello.world'
|
|
432
622
|
* pascalToDot({ FirstName: 'John' }); // { 'first.name': 'John' }
|
|
433
623
|
* ```
|
|
624
|
+
*
|
|
625
|
+
* @deprecated Use `toDot` instead, which converts from any case. It keeps acronyms together,
|
|
626
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
434
627
|
*/
|
|
435
628
|
function pascalToDot(input) {
|
|
436
629
|
return converter(input, "PascalToDot");
|
|
437
630
|
}
|
|
631
|
+
/**
|
|
632
|
+
* Converts a string, or the keys of an object/array (deeply), from PascalCase to Title Case.
|
|
633
|
+
*
|
|
634
|
+
* @example
|
|
635
|
+
* ```ts
|
|
636
|
+
* pascalToTitle('HelloWorld'); // 'Hello World'
|
|
637
|
+
* pascalToTitle({ FirstName: 'John' }); // { 'First Name': 'John' }
|
|
638
|
+
* ```
|
|
639
|
+
*
|
|
640
|
+
* @deprecated Use `toTitle` instead, which converts from any case. It keeps acronyms together,
|
|
641
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
642
|
+
*/
|
|
643
|
+
function pascalToTitle(input) {
|
|
644
|
+
return converter(input, "PascalToTitle");
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* Converts a string, or the keys of an object/array (deeply), from PascalCase to Sentence case.
|
|
648
|
+
*
|
|
649
|
+
* @example
|
|
650
|
+
* ```ts
|
|
651
|
+
* pascalToSentence('HelloWorld'); // 'Hello world'
|
|
652
|
+
* pascalToSentence({ FirstName: 'John' }); // { 'First name': 'John' }
|
|
653
|
+
* ```
|
|
654
|
+
*
|
|
655
|
+
* @deprecated Use `toSentence` instead, which converts from any case. It keeps acronyms together,
|
|
656
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
657
|
+
*/
|
|
658
|
+
function pascalToSentence(input) {
|
|
659
|
+
return converter(input, "PascalToSentence");
|
|
660
|
+
}
|
|
438
661
|
//#endregion
|
|
439
662
|
//#region src/snakeCase/snakeCase.ts
|
|
440
663
|
/**
|
|
@@ -445,6 +668,9 @@ function pascalToDot(input) {
|
|
|
445
668
|
* snakeToCamel('hello_world'); // 'helloWorld'
|
|
446
669
|
* snakeToCamel({ first_name: 'John' }); // { firstName: 'John' }
|
|
447
670
|
* ```
|
|
671
|
+
*
|
|
672
|
+
* @deprecated Use `toCamel` instead, which converts from any case. It keeps acronyms together,
|
|
673
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
448
674
|
*/
|
|
449
675
|
function snakeToCamel(input) {
|
|
450
676
|
return converter(input, "SnakeToCamel");
|
|
@@ -457,6 +683,9 @@ function snakeToCamel(input) {
|
|
|
457
683
|
* snakeToDash('hello_world'); // 'hello-world'
|
|
458
684
|
* snakeToDash({ first_name: 'John' }); // { 'first-name': 'John' }
|
|
459
685
|
* ```
|
|
686
|
+
*
|
|
687
|
+
* @deprecated Use `toDash` instead, which converts from any case. It keeps acronyms together,
|
|
688
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
460
689
|
*/
|
|
461
690
|
function snakeToDash(input) {
|
|
462
691
|
return converter(input, "SnakeToDash");
|
|
@@ -469,6 +698,9 @@ function snakeToDash(input) {
|
|
|
469
698
|
* snakeToPascal('hello_world'); // 'HelloWorld'
|
|
470
699
|
* snakeToPascal({ first_name: 'John' }); // { FirstName: 'John' }
|
|
471
700
|
* ```
|
|
701
|
+
*
|
|
702
|
+
* @deprecated Use `toPascal` instead, which converts from any case. It keeps acronyms together,
|
|
703
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
472
704
|
*/
|
|
473
705
|
function snakeToPascal(input) {
|
|
474
706
|
return converter(input, "SnakeToPascal");
|
|
@@ -481,6 +713,9 @@ function snakeToPascal(input) {
|
|
|
481
713
|
* snakeToUpperSnake('hello_world'); // 'HELLO_WORLD'
|
|
482
714
|
* snakeToUpperSnake({ first_name: 'John' }); // { FIRST_NAME: 'John' }
|
|
483
715
|
* ```
|
|
716
|
+
*
|
|
717
|
+
* @deprecated Use `toUpperSnake` instead, which converts from any case. It keeps acronyms together,
|
|
718
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
484
719
|
*/
|
|
485
720
|
function snakeToUpperSnake(input) {
|
|
486
721
|
return converter(input, "SnakeToUpperSnake");
|
|
@@ -493,6 +728,9 @@ function snakeToUpperSnake(input) {
|
|
|
493
728
|
* snakeToUpperDash('hello_world'); // 'HELLO-WORLD'
|
|
494
729
|
* snakeToUpperDash({ first_name: 'John' }); // { 'FIRST-NAME': 'John' }
|
|
495
730
|
* ```
|
|
731
|
+
*
|
|
732
|
+
* @deprecated Use `toUpperDash` instead, which converts from any case. It keeps acronyms together,
|
|
733
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
496
734
|
*/
|
|
497
735
|
function snakeToUpperDash(input) {
|
|
498
736
|
return converter(input, "SnakeToUpperDash");
|
|
@@ -505,6 +743,9 @@ function snakeToUpperDash(input) {
|
|
|
505
743
|
* snakeToTrain('hello_world'); // 'Hello-World'
|
|
506
744
|
* snakeToTrain({ first_name: 'John' }); // { 'First-Name': 'John' }
|
|
507
745
|
* ```
|
|
746
|
+
*
|
|
747
|
+
* @deprecated Use `toTrain` instead, which converts from any case. It keeps acronyms together,
|
|
748
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
508
749
|
*/
|
|
509
750
|
function snakeToTrain(input) {
|
|
510
751
|
return converter(input, "SnakeToTrain");
|
|
@@ -517,10 +758,43 @@ function snakeToTrain(input) {
|
|
|
517
758
|
* snakeToDot('hello_world'); // 'hello.world'
|
|
518
759
|
* snakeToDot({ first_name: 'John' }); // { 'first.name': 'John' }
|
|
519
760
|
* ```
|
|
761
|
+
*
|
|
762
|
+
* @deprecated Use `toDot` instead, which converts from any case. It keeps acronyms together,
|
|
763
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
520
764
|
*/
|
|
521
765
|
function snakeToDot(input) {
|
|
522
766
|
return converter(input, "SnakeToDot");
|
|
523
767
|
}
|
|
768
|
+
/**
|
|
769
|
+
* Converts a string, or the keys of an object/array (deeply), from snake_case to Title Case.
|
|
770
|
+
*
|
|
771
|
+
* @example
|
|
772
|
+
* ```ts
|
|
773
|
+
* snakeToTitle('hello_world'); // 'Hello World'
|
|
774
|
+
* snakeToTitle({ first_name: 'John' }); // { 'First Name': 'John' }
|
|
775
|
+
* ```
|
|
776
|
+
*
|
|
777
|
+
* @deprecated Use `toTitle` instead, which converts from any case. It keeps acronyms together,
|
|
778
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
779
|
+
*/
|
|
780
|
+
function snakeToTitle(input) {
|
|
781
|
+
return converter(input, "SnakeToTitle");
|
|
782
|
+
}
|
|
783
|
+
/**
|
|
784
|
+
* Converts a string, or the keys of an object/array (deeply), from snake_case to Sentence case.
|
|
785
|
+
*
|
|
786
|
+
* @example
|
|
787
|
+
* ```ts
|
|
788
|
+
* snakeToSentence('hello_world'); // 'Hello world'
|
|
789
|
+
* snakeToSentence({ first_name: 'John' }); // { 'First name': 'John' }
|
|
790
|
+
* ```
|
|
791
|
+
*
|
|
792
|
+
* @deprecated Use `toSentence` instead, which converts from any case. It keeps acronyms together,
|
|
793
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
794
|
+
*/
|
|
795
|
+
function snakeToSentence(input) {
|
|
796
|
+
return converter(input, "SnakeToSentence");
|
|
797
|
+
}
|
|
524
798
|
//#endregion
|
|
525
799
|
//#region src/trainCase/trainCase.ts
|
|
526
800
|
/**
|
|
@@ -531,6 +805,9 @@ function snakeToDot(input) {
|
|
|
531
805
|
* trainToCamel('Hello-World'); // 'helloWorld'
|
|
532
806
|
* trainToCamel({ 'First-Name': 'John' }); // { firstName: 'John' }
|
|
533
807
|
* ```
|
|
808
|
+
*
|
|
809
|
+
* @deprecated Use `toCamel` instead, which converts from any case. It keeps acronyms together,
|
|
810
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
534
811
|
*/
|
|
535
812
|
function trainToCamel(input) {
|
|
536
813
|
return converter(input, "TrainToCamel");
|
|
@@ -543,6 +820,9 @@ function trainToCamel(input) {
|
|
|
543
820
|
* trainToPascal('Hello-World'); // 'HelloWorld'
|
|
544
821
|
* trainToPascal({ 'First-Name': 'John' }); // { FirstName: 'John' }
|
|
545
822
|
* ```
|
|
823
|
+
*
|
|
824
|
+
* @deprecated Use `toPascal` instead, which converts from any case. It keeps acronyms together,
|
|
825
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
546
826
|
*/
|
|
547
827
|
function trainToPascal(input) {
|
|
548
828
|
return converter(input, "TrainToPascal");
|
|
@@ -555,6 +835,9 @@ function trainToPascal(input) {
|
|
|
555
835
|
* trainToSnake('Hello-World'); // 'hello_world'
|
|
556
836
|
* trainToSnake({ 'First-Name': 'John' }); // { first_name: 'John' }
|
|
557
837
|
* ```
|
|
838
|
+
*
|
|
839
|
+
* @deprecated Use `toSnake` instead, which converts from any case. It keeps acronyms together,
|
|
840
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
558
841
|
*/
|
|
559
842
|
function trainToSnake(input) {
|
|
560
843
|
return converter(input, "TrainToSnake");
|
|
@@ -567,6 +850,9 @@ function trainToSnake(input) {
|
|
|
567
850
|
* trainToDash('Hello-World'); // 'hello-world'
|
|
568
851
|
* trainToDash({ 'First-Name': 'John' }); // { 'first-name': 'John' }
|
|
569
852
|
* ```
|
|
853
|
+
*
|
|
854
|
+
* @deprecated Use `toDash` instead, which converts from any case. It keeps acronyms together,
|
|
855
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
570
856
|
*/
|
|
571
857
|
function trainToDash(input) {
|
|
572
858
|
return converter(input, "TrainToDash");
|
|
@@ -579,6 +865,9 @@ function trainToDash(input) {
|
|
|
579
865
|
* trainToUpperSnake('Hello-World'); // 'HELLO_WORLD'
|
|
580
866
|
* trainToUpperSnake({ 'First-Name': 'John' }); // { FIRST_NAME: 'John' }
|
|
581
867
|
* ```
|
|
868
|
+
*
|
|
869
|
+
* @deprecated Use `toUpperSnake` instead, which converts from any case. It keeps acronyms together,
|
|
870
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
582
871
|
*/
|
|
583
872
|
function trainToUpperSnake(input) {
|
|
584
873
|
return converter(input, "TrainToUpperSnake");
|
|
@@ -591,6 +880,9 @@ function trainToUpperSnake(input) {
|
|
|
591
880
|
* trainToUpperDash('Hello-World'); // 'HELLO-WORLD'
|
|
592
881
|
* trainToUpperDash({ 'First-Name': 'John' }); // { 'FIRST-NAME': 'John' }
|
|
593
882
|
* ```
|
|
883
|
+
*
|
|
884
|
+
* @deprecated Use `toUpperDash` instead, which converts from any case. It keeps acronyms together,
|
|
885
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
594
886
|
*/
|
|
595
887
|
function trainToUpperDash(input) {
|
|
596
888
|
return converter(input, "TrainToUpperDash");
|
|
@@ -603,10 +895,43 @@ function trainToUpperDash(input) {
|
|
|
603
895
|
* trainToDot('Hello-World'); // 'hello.world'
|
|
604
896
|
* trainToDot({ 'First-Name': 'John' }); // { 'first.name': 'John' }
|
|
605
897
|
* ```
|
|
898
|
+
*
|
|
899
|
+
* @deprecated Use `toDot` instead, which converts from any case. It keeps acronyms together,
|
|
900
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
606
901
|
*/
|
|
607
902
|
function trainToDot(input) {
|
|
608
903
|
return converter(input, "TrainToDot");
|
|
609
904
|
}
|
|
905
|
+
/**
|
|
906
|
+
* Converts a string, or the keys of an object/array (deeply), from Train-Case to Title Case.
|
|
907
|
+
*
|
|
908
|
+
* @example
|
|
909
|
+
* ```ts
|
|
910
|
+
* trainToTitle('Hello-World'); // 'Hello World'
|
|
911
|
+
* trainToTitle({ 'First-Name': 'John' }); // { 'First Name': 'John' }
|
|
912
|
+
* ```
|
|
913
|
+
*
|
|
914
|
+
* @deprecated Use `toTitle` instead, which converts from any case. It keeps acronyms together,
|
|
915
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
916
|
+
*/
|
|
917
|
+
function trainToTitle(input) {
|
|
918
|
+
return converter(input, "TrainToTitle");
|
|
919
|
+
}
|
|
920
|
+
/**
|
|
921
|
+
* Converts a string, or the keys of an object/array (deeply), from Train-Case to Sentence case.
|
|
922
|
+
*
|
|
923
|
+
* @example
|
|
924
|
+
* ```ts
|
|
925
|
+
* trainToSentence('Hello-World'); // 'Hello world'
|
|
926
|
+
* trainToSentence({ 'First-Name': 'John' }); // { 'First name': 'John' }
|
|
927
|
+
* ```
|
|
928
|
+
*
|
|
929
|
+
* @deprecated Use `toSentence` instead, which converts from any case. It keeps acronyms together,
|
|
930
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
931
|
+
*/
|
|
932
|
+
function trainToSentence(input) {
|
|
933
|
+
return converter(input, "TrainToSentence");
|
|
934
|
+
}
|
|
610
935
|
//#endregion
|
|
611
936
|
//#region src/dotCase/dotCase.ts
|
|
612
937
|
/**
|
|
@@ -617,6 +942,9 @@ function trainToDot(input) {
|
|
|
617
942
|
* dotToCamel('hello.world'); // 'helloWorld'
|
|
618
943
|
* dotToCamel({ 'first.name': 'John' }); // { firstName: 'John' }
|
|
619
944
|
* ```
|
|
945
|
+
*
|
|
946
|
+
* @deprecated Use `toCamel` instead, which converts from any case. It keeps acronyms together,
|
|
947
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
620
948
|
*/
|
|
621
949
|
function dotToCamel(input) {
|
|
622
950
|
return converter(input, "DotToCamel");
|
|
@@ -629,6 +957,9 @@ function dotToCamel(input) {
|
|
|
629
957
|
* dotToPascal('hello.world'); // 'HelloWorld'
|
|
630
958
|
* dotToPascal({ 'first.name': 'John' }); // { FirstName: 'John' }
|
|
631
959
|
* ```
|
|
960
|
+
*
|
|
961
|
+
* @deprecated Use `toPascal` instead, which converts from any case. It keeps acronyms together,
|
|
962
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
632
963
|
*/
|
|
633
964
|
function dotToPascal(input) {
|
|
634
965
|
return converter(input, "DotToPascal");
|
|
@@ -641,6 +972,9 @@ function dotToPascal(input) {
|
|
|
641
972
|
* dotToSnake('hello.world'); // 'hello_world'
|
|
642
973
|
* dotToSnake({ 'first.name': 'John' }); // { first_name: 'John' }
|
|
643
974
|
* ```
|
|
975
|
+
*
|
|
976
|
+
* @deprecated Use `toSnake` instead, which converts from any case. It keeps acronyms together,
|
|
977
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
644
978
|
*/
|
|
645
979
|
function dotToSnake(input) {
|
|
646
980
|
return converter(input, "DotToSnake");
|
|
@@ -653,6 +987,9 @@ function dotToSnake(input) {
|
|
|
653
987
|
* dotToDash('hello.world'); // 'hello-world'
|
|
654
988
|
* dotToDash({ 'first.name': 'John' }); // { 'first-name': 'John' }
|
|
655
989
|
* ```
|
|
990
|
+
*
|
|
991
|
+
* @deprecated Use `toDash` instead, which converts from any case. It keeps acronyms together,
|
|
992
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
656
993
|
*/
|
|
657
994
|
function dotToDash(input) {
|
|
658
995
|
return converter(input, "DotToDash");
|
|
@@ -665,6 +1002,9 @@ function dotToDash(input) {
|
|
|
665
1002
|
* dotToUpperSnake('hello.world'); // 'HELLO_WORLD'
|
|
666
1003
|
* dotToUpperSnake({ 'first.name': 'John' }); // { FIRST_NAME: 'John' }
|
|
667
1004
|
* ```
|
|
1005
|
+
*
|
|
1006
|
+
* @deprecated Use `toUpperSnake` instead, which converts from any case. It keeps acronyms together,
|
|
1007
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
668
1008
|
*/
|
|
669
1009
|
function dotToUpperSnake(input) {
|
|
670
1010
|
return converter(input, "DotToUpperSnake");
|
|
@@ -677,6 +1017,9 @@ function dotToUpperSnake(input) {
|
|
|
677
1017
|
* dotToUpperDash('hello.world'); // 'HELLO-WORLD'
|
|
678
1018
|
* dotToUpperDash({ 'first.name': 'John' }); // { 'FIRST-NAME': 'John' }
|
|
679
1019
|
* ```
|
|
1020
|
+
*
|
|
1021
|
+
* @deprecated Use `toUpperDash` instead, which converts from any case. It keeps acronyms together,
|
|
1022
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
680
1023
|
*/
|
|
681
1024
|
function dotToUpperDash(input) {
|
|
682
1025
|
return converter(input, "DotToUpperDash");
|
|
@@ -689,10 +1032,317 @@ function dotToUpperDash(input) {
|
|
|
689
1032
|
* dotToTrain('hello.world'); // 'Hello-World'
|
|
690
1033
|
* dotToTrain({ 'first.name': 'John' }); // { 'First-Name': 'John' }
|
|
691
1034
|
* ```
|
|
1035
|
+
*
|
|
1036
|
+
* @deprecated Use `toTrain` instead, which converts from any case. It keeps acronyms together,
|
|
1037
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
692
1038
|
*/
|
|
693
1039
|
function dotToTrain(input) {
|
|
694
1040
|
return converter(input, "DotToTrain");
|
|
695
1041
|
}
|
|
1042
|
+
/**
|
|
1043
|
+
* Converts a string, or the keys of an object/array (deeply), from dot.case to Title Case.
|
|
1044
|
+
*
|
|
1045
|
+
* @example
|
|
1046
|
+
* ```ts
|
|
1047
|
+
* dotToTitle('hello.world'); // 'Hello World'
|
|
1048
|
+
* dotToTitle({ 'first.name': 'John' }); // { 'First Name': 'John' }
|
|
1049
|
+
* ```
|
|
1050
|
+
*
|
|
1051
|
+
* @deprecated Use `toTitle` instead, which converts from any case. It keeps acronyms together,
|
|
1052
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
1053
|
+
*/
|
|
1054
|
+
function dotToTitle(input) {
|
|
1055
|
+
return converter(input, "DotToTitle");
|
|
1056
|
+
}
|
|
1057
|
+
/**
|
|
1058
|
+
* Converts a string, or the keys of an object/array (deeply), from dot.case to Sentence case.
|
|
1059
|
+
*
|
|
1060
|
+
* @example
|
|
1061
|
+
* ```ts
|
|
1062
|
+
* dotToSentence('hello.world'); // 'Hello world'
|
|
1063
|
+
* dotToSentence({ 'first.name': 'John' }); // { 'First name': 'John' }
|
|
1064
|
+
* ```
|
|
1065
|
+
*
|
|
1066
|
+
* @deprecated Use `toSentence` instead, which converts from any case. It keeps acronyms together,
|
|
1067
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
1068
|
+
*/
|
|
1069
|
+
function dotToSentence(input) {
|
|
1070
|
+
return converter(input, "DotToSentence");
|
|
1071
|
+
}
|
|
1072
|
+
//#endregion
|
|
1073
|
+
//#region src/titleCase/titleCase.ts
|
|
1074
|
+
/**
|
|
1075
|
+
* Converts a string, or the keys of an object/array (deeply), from Title Case to camelCase.
|
|
1076
|
+
*
|
|
1077
|
+
* @example
|
|
1078
|
+
* ```ts
|
|
1079
|
+
* titleToCamel('Hello World'); // 'helloWorld'
|
|
1080
|
+
* titleToCamel({ 'First Name': 'John' }); // { firstName: 'John' }
|
|
1081
|
+
* ```
|
|
1082
|
+
*
|
|
1083
|
+
* @deprecated Use `toCamel` instead, which converts from any case. It keeps acronyms together,
|
|
1084
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
1085
|
+
*/
|
|
1086
|
+
function titleToCamel(input) {
|
|
1087
|
+
return converter(input, "TitleToCamel");
|
|
1088
|
+
}
|
|
1089
|
+
/**
|
|
1090
|
+
* Converts a string, or the keys of an object/array (deeply), from Title Case to PascalCase.
|
|
1091
|
+
*
|
|
1092
|
+
* @example
|
|
1093
|
+
* ```ts
|
|
1094
|
+
* titleToPascal('Hello World'); // 'HelloWorld'
|
|
1095
|
+
* titleToPascal({ 'First Name': 'John' }); // { FirstName: 'John' }
|
|
1096
|
+
* ```
|
|
1097
|
+
*
|
|
1098
|
+
* @deprecated Use `toPascal` instead, which converts from any case. It keeps acronyms together,
|
|
1099
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
1100
|
+
*/
|
|
1101
|
+
function titleToPascal(input) {
|
|
1102
|
+
return converter(input, "TitleToPascal");
|
|
1103
|
+
}
|
|
1104
|
+
/**
|
|
1105
|
+
* Converts a string, or the keys of an object/array (deeply), from Title Case to snake_case.
|
|
1106
|
+
*
|
|
1107
|
+
* @example
|
|
1108
|
+
* ```ts
|
|
1109
|
+
* titleToSnake('Hello World'); // 'hello_world'
|
|
1110
|
+
* titleToSnake({ 'First Name': 'John' }); // { first_name: 'John' }
|
|
1111
|
+
* ```
|
|
1112
|
+
*
|
|
1113
|
+
* @deprecated Use `toSnake` instead, which converts from any case. It keeps acronyms together,
|
|
1114
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
1115
|
+
*/
|
|
1116
|
+
function titleToSnake(input) {
|
|
1117
|
+
return converter(input, "TitleToSnake");
|
|
1118
|
+
}
|
|
1119
|
+
/**
|
|
1120
|
+
* Converts a string, or the keys of an object/array (deeply), from Title Case to dash-case.
|
|
1121
|
+
*
|
|
1122
|
+
* @example
|
|
1123
|
+
* ```ts
|
|
1124
|
+
* titleToDash('Hello World'); // 'hello-world'
|
|
1125
|
+
* titleToDash({ 'First Name': 'John' }); // { 'first-name': 'John' }
|
|
1126
|
+
* ```
|
|
1127
|
+
*
|
|
1128
|
+
* @deprecated Use `toDash` instead, which converts from any case. It keeps acronyms together,
|
|
1129
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
1130
|
+
*/
|
|
1131
|
+
function titleToDash(input) {
|
|
1132
|
+
return converter(input, "TitleToDash");
|
|
1133
|
+
}
|
|
1134
|
+
/**
|
|
1135
|
+
* Converts a string, or the keys of an object/array (deeply), from Title Case to UPPER_SNAKE_CASE.
|
|
1136
|
+
*
|
|
1137
|
+
* @example
|
|
1138
|
+
* ```ts
|
|
1139
|
+
* titleToUpperSnake('Hello World'); // 'HELLO_WORLD'
|
|
1140
|
+
* titleToUpperSnake({ 'First Name': 'John' }); // { FIRST_NAME: 'John' }
|
|
1141
|
+
* ```
|
|
1142
|
+
*
|
|
1143
|
+
* @deprecated Use `toUpperSnake` instead, which converts from any case. It keeps acronyms together,
|
|
1144
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
1145
|
+
*/
|
|
1146
|
+
function titleToUpperSnake(input) {
|
|
1147
|
+
return converter(input, "TitleToUpperSnake");
|
|
1148
|
+
}
|
|
1149
|
+
/**
|
|
1150
|
+
* Converts a string, or the keys of an object/array (deeply), from Title Case to UPPER-DASH-CASE.
|
|
1151
|
+
*
|
|
1152
|
+
* @example
|
|
1153
|
+
* ```ts
|
|
1154
|
+
* titleToUpperDash('Hello World'); // 'HELLO-WORLD'
|
|
1155
|
+
* titleToUpperDash({ 'First Name': 'John' }); // { 'FIRST-NAME': 'John' }
|
|
1156
|
+
* ```
|
|
1157
|
+
*
|
|
1158
|
+
* @deprecated Use `toUpperDash` instead, which converts from any case. It keeps acronyms together,
|
|
1159
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
1160
|
+
*/
|
|
1161
|
+
function titleToUpperDash(input) {
|
|
1162
|
+
return converter(input, "TitleToUpperDash");
|
|
1163
|
+
}
|
|
1164
|
+
/**
|
|
1165
|
+
* Converts a string, or the keys of an object/array (deeply), from Title Case to Train-Case.
|
|
1166
|
+
*
|
|
1167
|
+
* @example
|
|
1168
|
+
* ```ts
|
|
1169
|
+
* titleToTrain('Hello World'); // 'Hello-World'
|
|
1170
|
+
* titleToTrain({ 'First Name': 'John' }); // { 'First-Name': 'John' }
|
|
1171
|
+
* ```
|
|
1172
|
+
*
|
|
1173
|
+
* @deprecated Use `toTrain` instead, which converts from any case. It keeps acronyms together,
|
|
1174
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
1175
|
+
*/
|
|
1176
|
+
function titleToTrain(input) {
|
|
1177
|
+
return converter(input, "TitleToTrain");
|
|
1178
|
+
}
|
|
1179
|
+
/**
|
|
1180
|
+
* Converts a string, or the keys of an object/array (deeply), from Title Case to dot.case.
|
|
1181
|
+
*
|
|
1182
|
+
* @example
|
|
1183
|
+
* ```ts
|
|
1184
|
+
* titleToDot('Hello World'); // 'hello.world'
|
|
1185
|
+
* titleToDot({ 'First Name': 'John' }); // { 'first.name': 'John' }
|
|
1186
|
+
* ```
|
|
1187
|
+
*
|
|
1188
|
+
* @deprecated Use `toDot` instead, which converts from any case. It keeps acronyms together,
|
|
1189
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
1190
|
+
*/
|
|
1191
|
+
function titleToDot(input) {
|
|
1192
|
+
return converter(input, "TitleToDot");
|
|
1193
|
+
}
|
|
1194
|
+
/**
|
|
1195
|
+
* Converts a string, or the keys of an object/array (deeply), from Title Case to Sentence case.
|
|
1196
|
+
*
|
|
1197
|
+
* @example
|
|
1198
|
+
* ```ts
|
|
1199
|
+
* titleToSentence('Hello World'); // 'Hello world'
|
|
1200
|
+
* titleToSentence({ 'First Name': 'John' }); // { 'First name': 'John' }
|
|
1201
|
+
* ```
|
|
1202
|
+
*
|
|
1203
|
+
* @deprecated Use `toSentence` instead, which converts from any case. It keeps acronyms together,
|
|
1204
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
1205
|
+
*/
|
|
1206
|
+
function titleToSentence(input) {
|
|
1207
|
+
return converter(input, "TitleToSentence");
|
|
1208
|
+
}
|
|
1209
|
+
//#endregion
|
|
1210
|
+
//#region src/sentenceCase/sentenceCase.ts
|
|
1211
|
+
/**
|
|
1212
|
+
* Converts a string, or the keys of an object/array (deeply), from Sentence case to camelCase.
|
|
1213
|
+
*
|
|
1214
|
+
* @example
|
|
1215
|
+
* ```ts
|
|
1216
|
+
* sentenceToCamel('Hello world'); // 'helloWorld'
|
|
1217
|
+
* sentenceToCamel({ 'First name': 'John' }); // { firstName: 'John' }
|
|
1218
|
+
* ```
|
|
1219
|
+
*
|
|
1220
|
+
* @deprecated Use `toCamel` instead, which converts from any case. It keeps acronyms together,
|
|
1221
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
1222
|
+
*/
|
|
1223
|
+
function sentenceToCamel(input) {
|
|
1224
|
+
return converter(input, "SentenceToCamel");
|
|
1225
|
+
}
|
|
1226
|
+
/**
|
|
1227
|
+
* Converts a string, or the keys of an object/array (deeply), from Sentence case to PascalCase.
|
|
1228
|
+
*
|
|
1229
|
+
* @example
|
|
1230
|
+
* ```ts
|
|
1231
|
+
* sentenceToPascal('Hello world'); // 'HelloWorld'
|
|
1232
|
+
* sentenceToPascal({ 'First name': 'John' }); // { FirstName: 'John' }
|
|
1233
|
+
* ```
|
|
1234
|
+
*
|
|
1235
|
+
* @deprecated Use `toPascal` instead, which converts from any case. It keeps acronyms together,
|
|
1236
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
1237
|
+
*/
|
|
1238
|
+
function sentenceToPascal(input) {
|
|
1239
|
+
return converter(input, "SentenceToPascal");
|
|
1240
|
+
}
|
|
1241
|
+
/**
|
|
1242
|
+
* Converts a string, or the keys of an object/array (deeply), from Sentence case to snake_case.
|
|
1243
|
+
*
|
|
1244
|
+
* @example
|
|
1245
|
+
* ```ts
|
|
1246
|
+
* sentenceToSnake('Hello world'); // 'hello_world'
|
|
1247
|
+
* sentenceToSnake({ 'First name': 'John' }); // { first_name: 'John' }
|
|
1248
|
+
* ```
|
|
1249
|
+
*
|
|
1250
|
+
* @deprecated Use `toSnake` instead, which converts from any case. It keeps acronyms together,
|
|
1251
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
1252
|
+
*/
|
|
1253
|
+
function sentenceToSnake(input) {
|
|
1254
|
+
return converter(input, "SentenceToSnake");
|
|
1255
|
+
}
|
|
1256
|
+
/**
|
|
1257
|
+
* Converts a string, or the keys of an object/array (deeply), from Sentence case to dash-case.
|
|
1258
|
+
*
|
|
1259
|
+
* @example
|
|
1260
|
+
* ```ts
|
|
1261
|
+
* sentenceToDash('Hello world'); // 'hello-world'
|
|
1262
|
+
* sentenceToDash({ 'First name': 'John' }); // { 'first-name': 'John' }
|
|
1263
|
+
* ```
|
|
1264
|
+
*
|
|
1265
|
+
* @deprecated Use `toDash` instead, which converts from any case. It keeps acronyms together,
|
|
1266
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
1267
|
+
*/
|
|
1268
|
+
function sentenceToDash(input) {
|
|
1269
|
+
return converter(input, "SentenceToDash");
|
|
1270
|
+
}
|
|
1271
|
+
/**
|
|
1272
|
+
* Converts a string, or the keys of an object/array (deeply), from Sentence case to UPPER_SNAKE_CASE.
|
|
1273
|
+
*
|
|
1274
|
+
* @example
|
|
1275
|
+
* ```ts
|
|
1276
|
+
* sentenceToUpperSnake('Hello world'); // 'HELLO_WORLD'
|
|
1277
|
+
* sentenceToUpperSnake({ 'First name': 'John' }); // { FIRST_NAME: 'John' }
|
|
1278
|
+
* ```
|
|
1279
|
+
*
|
|
1280
|
+
* @deprecated Use `toUpperSnake` instead, which converts from any case. It keeps acronyms together,
|
|
1281
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
1282
|
+
*/
|
|
1283
|
+
function sentenceToUpperSnake(input) {
|
|
1284
|
+
return converter(input, "SentenceToUpperSnake");
|
|
1285
|
+
}
|
|
1286
|
+
/**
|
|
1287
|
+
* Converts a string, or the keys of an object/array (deeply), from Sentence case to UPPER-DASH-CASE.
|
|
1288
|
+
*
|
|
1289
|
+
* @example
|
|
1290
|
+
* ```ts
|
|
1291
|
+
* sentenceToUpperDash('Hello world'); // 'HELLO-WORLD'
|
|
1292
|
+
* sentenceToUpperDash({ 'First name': 'John' }); // { 'FIRST-NAME': 'John' }
|
|
1293
|
+
* ```
|
|
1294
|
+
*
|
|
1295
|
+
* @deprecated Use `toUpperDash` instead, which converts from any case. It keeps acronyms together,
|
|
1296
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
1297
|
+
*/
|
|
1298
|
+
function sentenceToUpperDash(input) {
|
|
1299
|
+
return converter(input, "SentenceToUpperDash");
|
|
1300
|
+
}
|
|
1301
|
+
/**
|
|
1302
|
+
* Converts a string, or the keys of an object/array (deeply), from Sentence case to Train-Case.
|
|
1303
|
+
*
|
|
1304
|
+
* @example
|
|
1305
|
+
* ```ts
|
|
1306
|
+
* sentenceToTrain('Hello world'); // 'Hello-World'
|
|
1307
|
+
* sentenceToTrain({ 'First name': 'John' }); // { 'First-Name': 'John' }
|
|
1308
|
+
* ```
|
|
1309
|
+
*
|
|
1310
|
+
* @deprecated Use `toTrain` instead, which converts from any case. It keeps acronyms together,
|
|
1311
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
1312
|
+
*/
|
|
1313
|
+
function sentenceToTrain(input) {
|
|
1314
|
+
return converter(input, "SentenceToTrain");
|
|
1315
|
+
}
|
|
1316
|
+
/**
|
|
1317
|
+
* Converts a string, or the keys of an object/array (deeply), from Sentence case to dot.case.
|
|
1318
|
+
*
|
|
1319
|
+
* @example
|
|
1320
|
+
* ```ts
|
|
1321
|
+
* sentenceToDot('Hello world'); // 'hello.world'
|
|
1322
|
+
* sentenceToDot({ 'First name': 'John' }); // { 'first.name': 'John' }
|
|
1323
|
+
* ```
|
|
1324
|
+
*
|
|
1325
|
+
* @deprecated Use `toDot` instead, which converts from any case. It keeps acronyms together,
|
|
1326
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
1327
|
+
*/
|
|
1328
|
+
function sentenceToDot(input) {
|
|
1329
|
+
return converter(input, "SentenceToDot");
|
|
1330
|
+
}
|
|
1331
|
+
/**
|
|
1332
|
+
* Converts a string, or the keys of an object/array (deeply), from Sentence case to Title Case.
|
|
1333
|
+
*
|
|
1334
|
+
* @example
|
|
1335
|
+
* ```ts
|
|
1336
|
+
* sentenceToTitle('Hello world'); // 'Hello World'
|
|
1337
|
+
* sentenceToTitle({ 'First name': 'John' }); // { 'First Name': 'John' }
|
|
1338
|
+
* ```
|
|
1339
|
+
*
|
|
1340
|
+
* @deprecated Use `toTitle` instead, which converts from any case. It keeps acronyms together,
|
|
1341
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
1342
|
+
*/
|
|
1343
|
+
function sentenceToTitle(input) {
|
|
1344
|
+
return converter(input, "SentenceToTitle");
|
|
1345
|
+
}
|
|
696
1346
|
//#endregion
|
|
697
1347
|
//#region src/upperDashCase/upperDashCase.ts
|
|
698
1348
|
/**
|
|
@@ -703,6 +1353,9 @@ function dotToTrain(input) {
|
|
|
703
1353
|
* upperDashToCamel('HELLO-WORLD'); // 'helloWorld'
|
|
704
1354
|
* upperDashToCamel({ 'FIRST-NAME': 'John' }); // { firstName: 'John' }
|
|
705
1355
|
* ```
|
|
1356
|
+
*
|
|
1357
|
+
* @deprecated Use `toCamel` instead, which converts from any case. It keeps acronyms together,
|
|
1358
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
706
1359
|
*/
|
|
707
1360
|
function upperDashToCamel(input) {
|
|
708
1361
|
return converter(input, "UpperDashToCamel");
|
|
@@ -715,6 +1368,9 @@ function upperDashToCamel(input) {
|
|
|
715
1368
|
* upperDashToSnake('HELLO-WORLD'); // 'hello_world'
|
|
716
1369
|
* upperDashToSnake({ 'FIRST-NAME': 'John' }); // { first_name: 'John' }
|
|
717
1370
|
* ```
|
|
1371
|
+
*
|
|
1372
|
+
* @deprecated Use `toSnake` instead, which converts from any case. It keeps acronyms together,
|
|
1373
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
718
1374
|
*/
|
|
719
1375
|
function upperDashToSnake(input) {
|
|
720
1376
|
return converter(input, "UpperDashToSnake");
|
|
@@ -727,6 +1383,9 @@ function upperDashToSnake(input) {
|
|
|
727
1383
|
* upperDashToDash('HELLO-WORLD'); // 'hello-world'
|
|
728
1384
|
* upperDashToDash({ 'FIRST-NAME': 'John' }); // { 'first-name': 'John' }
|
|
729
1385
|
* ```
|
|
1386
|
+
*
|
|
1387
|
+
* @deprecated Use `toDash` instead, which converts from any case. It keeps acronyms together,
|
|
1388
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
730
1389
|
*/
|
|
731
1390
|
function upperDashToDash(input) {
|
|
732
1391
|
return converter(input, "UpperDashToDash");
|
|
@@ -739,6 +1398,9 @@ function upperDashToDash(input) {
|
|
|
739
1398
|
* upperDashToPascal('HELLO-WORLD'); // 'HelloWorld'
|
|
740
1399
|
* upperDashToPascal({ 'FIRST-NAME': 'John' }); // { FirstName: 'John' }
|
|
741
1400
|
* ```
|
|
1401
|
+
*
|
|
1402
|
+
* @deprecated Use `toPascal` instead, which converts from any case. It keeps acronyms together,
|
|
1403
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
742
1404
|
*/
|
|
743
1405
|
function upperDashToPascal(input) {
|
|
744
1406
|
return converter(input, "UpperDashToPascal");
|
|
@@ -751,6 +1413,9 @@ function upperDashToPascal(input) {
|
|
|
751
1413
|
* upperDashToUpperSnake('HELLO-WORLD'); // 'HELLO_WORLD'
|
|
752
1414
|
* upperDashToUpperSnake({ 'FIRST-NAME': 'John' }); // { FIRST_NAME: 'John' }
|
|
753
1415
|
* ```
|
|
1416
|
+
*
|
|
1417
|
+
* @deprecated Use `toUpperSnake` instead, which converts from any case. It keeps acronyms together,
|
|
1418
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
754
1419
|
*/
|
|
755
1420
|
function upperDashToUpperSnake(input) {
|
|
756
1421
|
return converter(input, "UpperDashToUpperSnake");
|
|
@@ -763,6 +1428,9 @@ function upperDashToUpperSnake(input) {
|
|
|
763
1428
|
* upperDashToTrain('HELLO-WORLD'); // 'Hello-World'
|
|
764
1429
|
* upperDashToTrain({ 'FIRST-NAME': 'John' }); // { 'First-Name': 'John' }
|
|
765
1430
|
* ```
|
|
1431
|
+
*
|
|
1432
|
+
* @deprecated Use `toTrain` instead, which converts from any case. It keeps acronyms together,
|
|
1433
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
766
1434
|
*/
|
|
767
1435
|
function upperDashToTrain(input) {
|
|
768
1436
|
return converter(input, "UpperDashToTrain");
|
|
@@ -775,10 +1443,43 @@ function upperDashToTrain(input) {
|
|
|
775
1443
|
* upperDashToDot('HELLO-WORLD'); // 'hello.world'
|
|
776
1444
|
* upperDashToDot({ 'FIRST-NAME': 'John' }); // { 'first.name': 'John' }
|
|
777
1445
|
* ```
|
|
1446
|
+
*
|
|
1447
|
+
* @deprecated Use `toDot` instead, which converts from any case. It keeps acronyms together,
|
|
1448
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
778
1449
|
*/
|
|
779
1450
|
function upperDashToDot(input) {
|
|
780
1451
|
return converter(input, "UpperDashToDot");
|
|
781
1452
|
}
|
|
1453
|
+
/**
|
|
1454
|
+
* Converts a string, or the keys of an object/array (deeply), from UPPER-DASH-CASE to Title Case.
|
|
1455
|
+
*
|
|
1456
|
+
* @example
|
|
1457
|
+
* ```ts
|
|
1458
|
+
* upperDashToTitle('HELLO-WORLD'); // 'Hello World'
|
|
1459
|
+
* upperDashToTitle({ 'FIRST-NAME': 'John' }); // { 'First Name': 'John' }
|
|
1460
|
+
* ```
|
|
1461
|
+
*
|
|
1462
|
+
* @deprecated Use `toTitle` instead, which converts from any case. It keeps acronyms together,
|
|
1463
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
1464
|
+
*/
|
|
1465
|
+
function upperDashToTitle(input) {
|
|
1466
|
+
return converter(input, "UpperDashToTitle");
|
|
1467
|
+
}
|
|
1468
|
+
/**
|
|
1469
|
+
* Converts a string, or the keys of an object/array (deeply), from UPPER-DASH-CASE to Sentence case.
|
|
1470
|
+
*
|
|
1471
|
+
* @example
|
|
1472
|
+
* ```ts
|
|
1473
|
+
* upperDashToSentence('HELLO-WORLD'); // 'Hello world'
|
|
1474
|
+
* upperDashToSentence({ 'FIRST-NAME': 'John' }); // { 'First name': 'John' }
|
|
1475
|
+
* ```
|
|
1476
|
+
*
|
|
1477
|
+
* @deprecated Use `toSentence` instead, which converts from any case. It keeps acronyms together,
|
|
1478
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
1479
|
+
*/
|
|
1480
|
+
function upperDashToSentence(input) {
|
|
1481
|
+
return converter(input, "UpperDashToSentence");
|
|
1482
|
+
}
|
|
782
1483
|
//#endregion
|
|
783
1484
|
//#region src/upperSnakeCase/upperSnakeCase.ts
|
|
784
1485
|
/**
|
|
@@ -789,6 +1490,9 @@ function upperDashToDot(input) {
|
|
|
789
1490
|
* upperSnakeToCamel('HELLO_WORLD'); // 'helloWorld'
|
|
790
1491
|
* upperSnakeToCamel({ FIRST_NAME: 'John' }); // { firstName: 'John' }
|
|
791
1492
|
* ```
|
|
1493
|
+
*
|
|
1494
|
+
* @deprecated Use `toCamel` instead, which converts from any case. It keeps acronyms together,
|
|
1495
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
792
1496
|
*/
|
|
793
1497
|
function upperSnakeToCamel(input) {
|
|
794
1498
|
return converter(input, "UpperSnakeToCamel");
|
|
@@ -801,6 +1505,9 @@ function upperSnakeToCamel(input) {
|
|
|
801
1505
|
* upperSnakeToSnake('HELLO_WORLD'); // 'hello_world'
|
|
802
1506
|
* upperSnakeToSnake({ FIRST_NAME: 'John' }); // { first_name: 'John' }
|
|
803
1507
|
* ```
|
|
1508
|
+
*
|
|
1509
|
+
* @deprecated Use `toSnake` instead, which converts from any case. It keeps acronyms together,
|
|
1510
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
804
1511
|
*/
|
|
805
1512
|
function upperSnakeToSnake(input) {
|
|
806
1513
|
return converter(input, "UpperSnakeToSnake");
|
|
@@ -813,6 +1520,9 @@ function upperSnakeToSnake(input) {
|
|
|
813
1520
|
* upperSnakeToDash('HELLO_WORLD'); // 'hello-world'
|
|
814
1521
|
* upperSnakeToDash({ FIRST_NAME: 'John' }); // { 'first-name': 'John' }
|
|
815
1522
|
* ```
|
|
1523
|
+
*
|
|
1524
|
+
* @deprecated Use `toDash` instead, which converts from any case. It keeps acronyms together,
|
|
1525
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
816
1526
|
*/
|
|
817
1527
|
function upperSnakeToDash(input) {
|
|
818
1528
|
return converter(input, "UpperSnakeToDash");
|
|
@@ -825,6 +1535,9 @@ function upperSnakeToDash(input) {
|
|
|
825
1535
|
* upperSnakeToPascal('HELLO_WORLD'); // 'HelloWorld'
|
|
826
1536
|
* upperSnakeToPascal({ FIRST_NAME: 'John' }); // { FirstName: 'John' }
|
|
827
1537
|
* ```
|
|
1538
|
+
*
|
|
1539
|
+
* @deprecated Use `toPascal` instead, which converts from any case. It keeps acronyms together,
|
|
1540
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
828
1541
|
*/
|
|
829
1542
|
function upperSnakeToPascal(input) {
|
|
830
1543
|
return converter(input, "UpperSnakeToPascal");
|
|
@@ -837,6 +1550,9 @@ function upperSnakeToPascal(input) {
|
|
|
837
1550
|
* upperSnakeToUpperDash('HELLO_WORLD'); // 'HELLO-WORLD'
|
|
838
1551
|
* upperSnakeToUpperDash({ FIRST_NAME: 'John' }); // { 'FIRST-NAME': 'John' }
|
|
839
1552
|
* ```
|
|
1553
|
+
*
|
|
1554
|
+
* @deprecated Use `toUpperDash` instead, which converts from any case. It keeps acronyms together,
|
|
1555
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
840
1556
|
*/
|
|
841
1557
|
function upperSnakeToUpperDash(input) {
|
|
842
1558
|
return converter(input, "UpperSnakeToUpperDash");
|
|
@@ -849,6 +1565,9 @@ function upperSnakeToUpperDash(input) {
|
|
|
849
1565
|
* upperSnakeToTrain('HELLO_WORLD'); // 'Hello-World'
|
|
850
1566
|
* upperSnakeToTrain({ FIRST_NAME: 'John' }); // { 'First-Name': 'John' }
|
|
851
1567
|
* ```
|
|
1568
|
+
*
|
|
1569
|
+
* @deprecated Use `toTrain` instead, which converts from any case. It keeps acronyms together,
|
|
1570
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
852
1571
|
*/
|
|
853
1572
|
function upperSnakeToTrain(input) {
|
|
854
1573
|
return converter(input, "UpperSnakeToTrain");
|
|
@@ -861,64 +1580,306 @@ function upperSnakeToTrain(input) {
|
|
|
861
1580
|
* upperSnakeToDot('HELLO_WORLD'); // 'hello.world'
|
|
862
1581
|
* upperSnakeToDot({ FIRST_NAME: 'John' }); // { 'first.name': 'John' }
|
|
863
1582
|
* ```
|
|
1583
|
+
*
|
|
1584
|
+
* @deprecated Use `toDot` instead, which converts from any case. It keeps acronyms together,
|
|
1585
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
864
1586
|
*/
|
|
865
1587
|
function upperSnakeToDot(input) {
|
|
866
1588
|
return converter(input, "UpperSnakeToDot");
|
|
867
1589
|
}
|
|
1590
|
+
/**
|
|
1591
|
+
* Converts a string, or the keys of an object/array (deeply), from UPPER_SNAKE_CASE to Title Case.
|
|
1592
|
+
*
|
|
1593
|
+
* @example
|
|
1594
|
+
* ```ts
|
|
1595
|
+
* upperSnakeToTitle('HELLO_WORLD'); // 'Hello World'
|
|
1596
|
+
* upperSnakeToTitle({ FIRST_NAME: 'John' }); // { 'First Name': 'John' }
|
|
1597
|
+
* ```
|
|
1598
|
+
*
|
|
1599
|
+
* @deprecated Use `toTitle` instead, which converts from any case. It keeps acronyms together,
|
|
1600
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
1601
|
+
*/
|
|
1602
|
+
function upperSnakeToTitle(input) {
|
|
1603
|
+
return converter(input, "UpperSnakeToTitle");
|
|
1604
|
+
}
|
|
1605
|
+
/**
|
|
1606
|
+
* Converts a string, or the keys of an object/array (deeply), from UPPER_SNAKE_CASE to Sentence case.
|
|
1607
|
+
*
|
|
1608
|
+
* @example
|
|
1609
|
+
* ```ts
|
|
1610
|
+
* upperSnakeToSentence('HELLO_WORLD'); // 'Hello world'
|
|
1611
|
+
* upperSnakeToSentence({ FIRST_NAME: 'John' }); // { 'First name': 'John' }
|
|
1612
|
+
* ```
|
|
1613
|
+
*
|
|
1614
|
+
* @deprecated Use `toSentence` instead, which converts from any case. It keeps acronyms together,
|
|
1615
|
+
* so results differ for keys like `userID` (see the migration notes in the README).
|
|
1616
|
+
*/
|
|
1617
|
+
function upperSnakeToSentence(input) {
|
|
1618
|
+
return converter(input, "UpperSnakeToSentence");
|
|
1619
|
+
}
|
|
1620
|
+
//#endregion
|
|
1621
|
+
//#region src/anyCase/words.ts
|
|
1622
|
+
const isSeparator = (c) => c === "_" || c === "-" || c === "." || c === " ";
|
|
1623
|
+
const isUpper = (c) => c !== c.toLowerCase();
|
|
1624
|
+
const isLower = (c) => c !== c.toUpperCase();
|
|
1625
|
+
/**
|
|
1626
|
+
* Splits a string in any case into lowercase words: on `_`, `-`, `.` and spaces,
|
|
1627
|
+
* before an uppercase letter that follows a lowercase letter or a digit (`helloWorld`),
|
|
1628
|
+
* and before the last letter of an acronym (`XMLHttp`). Mirrors the `Words` type.
|
|
1629
|
+
*/
|
|
1630
|
+
function words(str) {
|
|
1631
|
+
const result = [];
|
|
1632
|
+
let word = "";
|
|
1633
|
+
let prev = "";
|
|
1634
|
+
const push = () => {
|
|
1635
|
+
if (word) result.push(word.toLowerCase());
|
|
1636
|
+
word = "";
|
|
1637
|
+
};
|
|
1638
|
+
for (let i = 0; i < str.length; i++) {
|
|
1639
|
+
const c = str[i];
|
|
1640
|
+
if (isSeparator(c)) {
|
|
1641
|
+
push();
|
|
1642
|
+
prev = "";
|
|
1643
|
+
continue;
|
|
1644
|
+
}
|
|
1645
|
+
const next = str.charAt(i + 1);
|
|
1646
|
+
if (isUpper(c) && word && (!isUpper(prev) || next && isLower(next))) push();
|
|
1647
|
+
word += c;
|
|
1648
|
+
prev = c;
|
|
1649
|
+
}
|
|
1650
|
+
push();
|
|
1651
|
+
return result;
|
|
1652
|
+
}
|
|
1653
|
+
const ToCamel = (str) => words(str).map((w, i) => i ? Capitalize(w) : w).join("");
|
|
1654
|
+
const ToPascal = (str) => words(str).map(Capitalize).join("");
|
|
1655
|
+
const ToSnake = (str) => words(str).join("_");
|
|
1656
|
+
const ToDash = (str) => words(str).join("-");
|
|
1657
|
+
const ToUpperSnake = (str) => words(str).join("_").toUpperCase();
|
|
1658
|
+
const ToUpperDash = (str) => words(str).join("-").toUpperCase();
|
|
1659
|
+
const ToTrain = (str) => words(str).map(Capitalize).join("-");
|
|
1660
|
+
const ToDot = (str) => words(str).join(".");
|
|
1661
|
+
const ToTitle = (str) => words(str).map(Capitalize).join(" ");
|
|
1662
|
+
const ToSentence = (str) => Capitalize(words(str).join(" "));
|
|
1663
|
+
//#endregion
|
|
1664
|
+
//#region src/anyCase/anyCase.ts
|
|
1665
|
+
/**
|
|
1666
|
+
* Converts a string, or the keys of an object/array (deeply), from any case to camelCase.
|
|
1667
|
+
*
|
|
1668
|
+
* @example
|
|
1669
|
+
* ```ts
|
|
1670
|
+
* toCamel('hello_world'); // 'helloWorld'
|
|
1671
|
+
* toCamel({ first_name: 'John', userID: 1 }); // { firstName: 'John', userId: 1 }
|
|
1672
|
+
* ```
|
|
1673
|
+
*/
|
|
1674
|
+
function toCamel(input) {
|
|
1675
|
+
return convert(input, ToCamel);
|
|
1676
|
+
}
|
|
1677
|
+
/**
|
|
1678
|
+
* Converts a string, or the keys of an object/array (deeply), from any case to PascalCase.
|
|
1679
|
+
*
|
|
1680
|
+
* @example
|
|
1681
|
+
* ```ts
|
|
1682
|
+
* toPascal('hello-world'); // 'HelloWorld'
|
|
1683
|
+
* toPascal({ 'first-name': 'John', userID: 1 }); // { FirstName: 'John', UserId: 1 }
|
|
1684
|
+
* ```
|
|
1685
|
+
*/
|
|
1686
|
+
function toPascal(input) {
|
|
1687
|
+
return convert(input, ToPascal);
|
|
1688
|
+
}
|
|
1689
|
+
/**
|
|
1690
|
+
* Converts a string, or the keys of an object/array (deeply), from any case to snake_case.
|
|
1691
|
+
*
|
|
1692
|
+
* @example
|
|
1693
|
+
* ```ts
|
|
1694
|
+
* toSnake('helloWorld'); // 'hello_world'
|
|
1695
|
+
* toSnake({ firstName: 'John', userID: 1 }); // { first_name: 'John', user_id: 1 }
|
|
1696
|
+
* ```
|
|
1697
|
+
*/
|
|
1698
|
+
function toSnake(input) {
|
|
1699
|
+
return convert(input, ToSnake);
|
|
1700
|
+
}
|
|
1701
|
+
/**
|
|
1702
|
+
* Converts a string, or the keys of an object/array (deeply), from any case to dash-case.
|
|
1703
|
+
*
|
|
1704
|
+
* @example
|
|
1705
|
+
* ```ts
|
|
1706
|
+
* toDash('HELLO_WORLD'); // 'hello-world'
|
|
1707
|
+
* toDash({ FIRST_NAME: 'John', userID: 1 }); // { 'first-name': 'John', 'user-id': 1 }
|
|
1708
|
+
* ```
|
|
1709
|
+
*/
|
|
1710
|
+
function toDash(input) {
|
|
1711
|
+
return convert(input, ToDash);
|
|
1712
|
+
}
|
|
1713
|
+
/**
|
|
1714
|
+
* Converts a string, or the keys of an object/array (deeply), from any case to UPPER_SNAKE_CASE.
|
|
1715
|
+
*
|
|
1716
|
+
* @example
|
|
1717
|
+
* ```ts
|
|
1718
|
+
* toUpperSnake('hello-world'); // 'HELLO_WORLD'
|
|
1719
|
+
* toUpperSnake({ 'first-name': 'John', userID: 1 }); // { FIRST_NAME: 'John', USER_ID: 1 }
|
|
1720
|
+
* ```
|
|
1721
|
+
*/
|
|
1722
|
+
function toUpperSnake(input) {
|
|
1723
|
+
return convert(input, ToUpperSnake);
|
|
1724
|
+
}
|
|
1725
|
+
/**
|
|
1726
|
+
* Converts a string, or the keys of an object/array (deeply), from any case to UPPER-DASH-CASE.
|
|
1727
|
+
*
|
|
1728
|
+
* @example
|
|
1729
|
+
* ```ts
|
|
1730
|
+
* toUpperDash('helloWorld'); // 'HELLO-WORLD'
|
|
1731
|
+
* toUpperDash({ firstName: 'John', userID: 1 }); // { 'FIRST-NAME': 'John', 'USER-ID': 1 }
|
|
1732
|
+
* ```
|
|
1733
|
+
*/
|
|
1734
|
+
function toUpperDash(input) {
|
|
1735
|
+
return convert(input, ToUpperDash);
|
|
1736
|
+
}
|
|
1737
|
+
/**
|
|
1738
|
+
* Converts a string, or the keys of an object/array (deeply), from any case to Train-Case.
|
|
1739
|
+
*
|
|
1740
|
+
* @example
|
|
1741
|
+
* ```ts
|
|
1742
|
+
* toTrain('hello_world'); // 'Hello-World'
|
|
1743
|
+
* toTrain({ first_name: 'John', userID: 1 }); // { 'First-Name': 'John', 'User-Id': 1 }
|
|
1744
|
+
* ```
|
|
1745
|
+
*/
|
|
1746
|
+
function toTrain(input) {
|
|
1747
|
+
return convert(input, ToTrain);
|
|
1748
|
+
}
|
|
1749
|
+
/**
|
|
1750
|
+
* Converts a string, or the keys of an object/array (deeply), from any case to dot.case.
|
|
1751
|
+
*
|
|
1752
|
+
* @example
|
|
1753
|
+
* ```ts
|
|
1754
|
+
* toDot('HelloWorld'); // 'hello.world'
|
|
1755
|
+
* toDot({ FirstName: 'John', userID: 1 }); // { 'first.name': 'John', 'user.id': 1 }
|
|
1756
|
+
* ```
|
|
1757
|
+
*/
|
|
1758
|
+
function toDot(input) {
|
|
1759
|
+
return convert(input, ToDot);
|
|
1760
|
+
}
|
|
1761
|
+
/**
|
|
1762
|
+
* Converts a string, or the keys of an object/array (deeply), from any case to Title Case.
|
|
1763
|
+
*
|
|
1764
|
+
* @example
|
|
1765
|
+
* ```ts
|
|
1766
|
+
* toTitle('hello_world'); // 'Hello World'
|
|
1767
|
+
* toTitle({ first_name: 'John', userID: 1 }); // { 'First Name': 'John', 'User Id': 1 }
|
|
1768
|
+
* ```
|
|
1769
|
+
*/
|
|
1770
|
+
function toTitle(input) {
|
|
1771
|
+
return convert(input, ToTitle);
|
|
1772
|
+
}
|
|
1773
|
+
/**
|
|
1774
|
+
* Converts a string, or the keys of an object/array (deeply), from any case to Sentence case.
|
|
1775
|
+
*
|
|
1776
|
+
* @example
|
|
1777
|
+
* ```ts
|
|
1778
|
+
* toSentence('helloWorld'); // 'Hello world'
|
|
1779
|
+
* toSentence({ firstName: 'John', userID: 1 }); // { 'First name': 'John', 'User id': 1 }
|
|
1780
|
+
* ```
|
|
1781
|
+
*/
|
|
1782
|
+
function toSentence(input) {
|
|
1783
|
+
return convert(input, ToSentence);
|
|
1784
|
+
}
|
|
868
1785
|
//#endregion
|
|
869
1786
|
exports.camelToDash = camelToDash;
|
|
870
1787
|
exports.camelToDot = camelToDot;
|
|
871
1788
|
exports.camelToPascal = camelToPascal;
|
|
1789
|
+
exports.camelToSentence = camelToSentence;
|
|
872
1790
|
exports.camelToSnake = camelToSnake;
|
|
1791
|
+
exports.camelToTitle = camelToTitle;
|
|
873
1792
|
exports.camelToTrain = camelToTrain;
|
|
874
1793
|
exports.camelToUpperDash = camelToUpperDash;
|
|
875
1794
|
exports.camelToUpperSnake = camelToUpperSnake;
|
|
876
1795
|
exports.dashToCamel = dashToCamel;
|
|
877
1796
|
exports.dashToDot = dashToDot;
|
|
878
1797
|
exports.dashToPascal = dashToPascal;
|
|
1798
|
+
exports.dashToSentence = dashToSentence;
|
|
879
1799
|
exports.dashToSnake = dashToSnake;
|
|
1800
|
+
exports.dashToTitle = dashToTitle;
|
|
880
1801
|
exports.dashToTrain = dashToTrain;
|
|
881
1802
|
exports.dashToUpperDash = dashToUpperDash;
|
|
882
1803
|
exports.dashToUpperSnake = dashToUpperSnake;
|
|
883
1804
|
exports.dotToCamel = dotToCamel;
|
|
884
1805
|
exports.dotToDash = dotToDash;
|
|
885
1806
|
exports.dotToPascal = dotToPascal;
|
|
1807
|
+
exports.dotToSentence = dotToSentence;
|
|
886
1808
|
exports.dotToSnake = dotToSnake;
|
|
1809
|
+
exports.dotToTitle = dotToTitle;
|
|
887
1810
|
exports.dotToTrain = dotToTrain;
|
|
888
1811
|
exports.dotToUpperDash = dotToUpperDash;
|
|
889
1812
|
exports.dotToUpperSnake = dotToUpperSnake;
|
|
890
1813
|
exports.pascalToCamel = pascalToCamel;
|
|
891
1814
|
exports.pascalToDash = pascalToDash;
|
|
892
1815
|
exports.pascalToDot = pascalToDot;
|
|
1816
|
+
exports.pascalToSentence = pascalToSentence;
|
|
893
1817
|
exports.pascalToSnake = pascalToSnake;
|
|
1818
|
+
exports.pascalToTitle = pascalToTitle;
|
|
894
1819
|
exports.pascalToTrain = pascalToTrain;
|
|
895
1820
|
exports.pascalToUpperDash = pascalToUpperDash;
|
|
896
1821
|
exports.pascalToUpperSnake = pascalToUpperSnake;
|
|
1822
|
+
exports.sentenceToCamel = sentenceToCamel;
|
|
1823
|
+
exports.sentenceToDash = sentenceToDash;
|
|
1824
|
+
exports.sentenceToDot = sentenceToDot;
|
|
1825
|
+
exports.sentenceToPascal = sentenceToPascal;
|
|
1826
|
+
exports.sentenceToSnake = sentenceToSnake;
|
|
1827
|
+
exports.sentenceToTitle = sentenceToTitle;
|
|
1828
|
+
exports.sentenceToTrain = sentenceToTrain;
|
|
1829
|
+
exports.sentenceToUpperDash = sentenceToUpperDash;
|
|
1830
|
+
exports.sentenceToUpperSnake = sentenceToUpperSnake;
|
|
897
1831
|
exports.snakeToCamel = snakeToCamel;
|
|
898
1832
|
exports.snakeToDash = snakeToDash;
|
|
899
1833
|
exports.snakeToDot = snakeToDot;
|
|
900
1834
|
exports.snakeToPascal = snakeToPascal;
|
|
1835
|
+
exports.snakeToSentence = snakeToSentence;
|
|
1836
|
+
exports.snakeToTitle = snakeToTitle;
|
|
901
1837
|
exports.snakeToTrain = snakeToTrain;
|
|
902
1838
|
exports.snakeToUpperDash = snakeToUpperDash;
|
|
903
1839
|
exports.snakeToUpperSnake = snakeToUpperSnake;
|
|
1840
|
+
exports.titleToCamel = titleToCamel;
|
|
1841
|
+
exports.titleToDash = titleToDash;
|
|
1842
|
+
exports.titleToDot = titleToDot;
|
|
1843
|
+
exports.titleToPascal = titleToPascal;
|
|
1844
|
+
exports.titleToSentence = titleToSentence;
|
|
1845
|
+
exports.titleToSnake = titleToSnake;
|
|
1846
|
+
exports.titleToTrain = titleToTrain;
|
|
1847
|
+
exports.titleToUpperDash = titleToUpperDash;
|
|
1848
|
+
exports.titleToUpperSnake = titleToUpperSnake;
|
|
1849
|
+
exports.toCamel = toCamel;
|
|
1850
|
+
exports.toDash = toDash;
|
|
1851
|
+
exports.toDot = toDot;
|
|
1852
|
+
exports.toPascal = toPascal;
|
|
1853
|
+
exports.toSentence = toSentence;
|
|
1854
|
+
exports.toSnake = toSnake;
|
|
1855
|
+
exports.toTitle = toTitle;
|
|
1856
|
+
exports.toTrain = toTrain;
|
|
1857
|
+
exports.toUpperDash = toUpperDash;
|
|
1858
|
+
exports.toUpperSnake = toUpperSnake;
|
|
904
1859
|
exports.trainToCamel = trainToCamel;
|
|
905
1860
|
exports.trainToDash = trainToDash;
|
|
906
1861
|
exports.trainToDot = trainToDot;
|
|
907
1862
|
exports.trainToPascal = trainToPascal;
|
|
1863
|
+
exports.trainToSentence = trainToSentence;
|
|
908
1864
|
exports.trainToSnake = trainToSnake;
|
|
1865
|
+
exports.trainToTitle = trainToTitle;
|
|
909
1866
|
exports.trainToUpperDash = trainToUpperDash;
|
|
910
1867
|
exports.trainToUpperSnake = trainToUpperSnake;
|
|
911
1868
|
exports.upperDashToCamel = upperDashToCamel;
|
|
912
1869
|
exports.upperDashToDash = upperDashToDash;
|
|
913
1870
|
exports.upperDashToDot = upperDashToDot;
|
|
914
1871
|
exports.upperDashToPascal = upperDashToPascal;
|
|
1872
|
+
exports.upperDashToSentence = upperDashToSentence;
|
|
915
1873
|
exports.upperDashToSnake = upperDashToSnake;
|
|
1874
|
+
exports.upperDashToTitle = upperDashToTitle;
|
|
916
1875
|
exports.upperDashToTrain = upperDashToTrain;
|
|
917
1876
|
exports.upperDashToUpperSnake = upperDashToUpperSnake;
|
|
918
1877
|
exports.upperSnakeToCamel = upperSnakeToCamel;
|
|
919
1878
|
exports.upperSnakeToDash = upperSnakeToDash;
|
|
920
1879
|
exports.upperSnakeToDot = upperSnakeToDot;
|
|
921
1880
|
exports.upperSnakeToPascal = upperSnakeToPascal;
|
|
1881
|
+
exports.upperSnakeToSentence = upperSnakeToSentence;
|
|
922
1882
|
exports.upperSnakeToSnake = upperSnakeToSnake;
|
|
1883
|
+
exports.upperSnakeToTitle = upperSnakeToTitle;
|
|
923
1884
|
exports.upperSnakeToTrain = upperSnakeToTrain;
|
|
924
1885
|
exports.upperSnakeToUpperDash = upperSnakeToUpperDash;
|