@qodalis/cli-string 0.0.3 → 2.0.0-beta.10

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/public-api.mjs ADDED
@@ -0,0 +1,752 @@
1
+ import { DefaultLibraryAuthor, CliForegroundColor } from '@qodalis/cli-core';
2
+ import * as _ from 'lodash';
3
+
4
+ // src/lib/processors/cli-string-command-processor.ts
5
+
6
+ // src/lib/version.ts
7
+ var LIBRARY_VERSION = "2.0.0-beta.10";
8
+ var API_VERSION = 2;
9
+
10
+ // src/lib/processors/cli-string-command-processor.ts
11
+ var lodash = _.default || _;
12
+ function stringTransform(command, description, transform, options) {
13
+ return {
14
+ command,
15
+ aliases: options?.aliases,
16
+ description,
17
+ acceptsRawInput: true,
18
+ valueRequired: true,
19
+ processCommand: async (cmd, context) => {
20
+ const text = cmd.value || cmd.data || "";
21
+ const result = transform(text);
22
+ context.writer.writeln(
23
+ `${context.writer.wrapInColor("Result: ", CliForegroundColor.Yellow)}${result}`
24
+ );
25
+ context.process.output(result);
26
+ },
27
+ writeDescription: (context) => {
28
+ const { writer } = context;
29
+ writer.writeln(description);
30
+ writer.writeln();
31
+ writer.writeln("\u{1F4CB} Usage:");
32
+ writer.writeln(
33
+ ` ${writer.wrapInColor(`string ${command} <text>`, CliForegroundColor.Cyan)}`
34
+ );
35
+ if (options?.example) {
36
+ writer.writeln();
37
+ writer.writeln("\u{1F4DD} Examples:");
38
+ writer.writeln(
39
+ ` string ${command} ${options.example.input.padEnd(20)} ${writer.wrapInColor(`# \u2192 ${options.example.output}`, CliForegroundColor.Green)}`
40
+ );
41
+ }
42
+ }
43
+ };
44
+ }
45
+ var CliStringCommandProcessor = class {
46
+ constructor() {
47
+ this.command = "string";
48
+ this.aliases = ["str"];
49
+ this.description = "String manipulation commands";
50
+ this.author = DefaultLibraryAuthor;
51
+ this.version = LIBRARY_VERSION;
52
+ this.processors = [];
53
+ this.metadata = {
54
+ icon: "\u{1F524}",
55
+ requiredCoreVersion: ">=2.0.0 <3.0.0",
56
+ requiredCliVersion: ">=2.0.0 <3.0.0"
57
+ };
58
+ this.processors = [
59
+ // -- Case conversions --
60
+ stringTransform(
61
+ "upper",
62
+ "Convert to UPPERCASE",
63
+ (t) => t.toUpperCase(),
64
+ {
65
+ aliases: ["uppercase", "toUpper"],
66
+ example: { input: "hello world", output: "HELLO WORLD" }
67
+ }
68
+ ),
69
+ stringTransform(
70
+ "lower",
71
+ "Convert to lowercase",
72
+ (t) => t.toLowerCase(),
73
+ {
74
+ aliases: ["lowercase", "toLower"],
75
+ example: { input: "HELLO WORLD", output: "hello world" }
76
+ }
77
+ ),
78
+ stringTransform(
79
+ "capitalize",
80
+ "Capitalize the first letter",
81
+ (t) => lodash.capitalize(t),
82
+ {
83
+ aliases: ["cap"],
84
+ example: { input: "hello world", output: "Hello world" }
85
+ }
86
+ ),
87
+ stringTransform(
88
+ "camelCase",
89
+ "Convert to camelCase",
90
+ (t) => lodash.camelCase(t),
91
+ {
92
+ aliases: ["camel"],
93
+ example: { input: "hello world", output: "helloWorld" }
94
+ }
95
+ ),
96
+ stringTransform(
97
+ "kebabCase",
98
+ "Convert to kebab-case",
99
+ (t) => lodash.kebabCase(t),
100
+ {
101
+ aliases: ["kebab"],
102
+ example: { input: "Hello World", output: "hello-world" }
103
+ }
104
+ ),
105
+ stringTransform(
106
+ "snakeCase",
107
+ "Convert to snake_case",
108
+ (t) => lodash.snakeCase(t),
109
+ {
110
+ aliases: ["snake"],
111
+ example: { input: "Hello World", output: "hello_world" }
112
+ }
113
+ ),
114
+ stringTransform(
115
+ "startCase",
116
+ "Convert to Start Case",
117
+ (t) => lodash.startCase(t),
118
+ {
119
+ aliases: ["title", "titleCase"],
120
+ example: { input: "hello-world", output: "Hello World" }
121
+ }
122
+ ),
123
+ // -- Trimming --
124
+ stringTransform(
125
+ "trim",
126
+ "Remove whitespace from both ends",
127
+ (t) => t.trim(),
128
+ {
129
+ example: { input: '" hello "', output: "hello" }
130
+ }
131
+ ),
132
+ stringTransform(
133
+ "trimStart",
134
+ "Remove whitespace from the start",
135
+ (t) => t.trimStart(),
136
+ {
137
+ aliases: ["ltrim"],
138
+ example: { input: '" hello"', output: "hello" }
139
+ }
140
+ ),
141
+ stringTransform(
142
+ "trimEnd",
143
+ "Remove whitespace from the end",
144
+ (t) => t.trimEnd(),
145
+ {
146
+ aliases: ["rtrim"],
147
+ example: { input: '"hello "', output: "hello" }
148
+ }
149
+ ),
150
+ // -- Transform --
151
+ stringTransform(
152
+ "reverse",
153
+ "Reverse a string",
154
+ (t) => [...t].reverse().join(""),
155
+ {
156
+ aliases: ["rev"],
157
+ example: { input: "Hello", output: "olleH" }
158
+ }
159
+ ),
160
+ stringTransform(
161
+ "slug",
162
+ "Convert to URL-friendly slug",
163
+ (t) => t.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, ""),
164
+ {
165
+ aliases: ["slugify"],
166
+ example: { input: '"Hello World!"', output: "hello-world" }
167
+ }
168
+ ),
169
+ stringTransform(
170
+ "escape",
171
+ "Escape HTML entities",
172
+ (t) => lodash.escape(t),
173
+ {
174
+ aliases: ["escapeHtml"],
175
+ example: {
176
+ input: '"<b>hi</b>"',
177
+ output: "&lt;b&gt;hi&lt;/b&gt;"
178
+ }
179
+ }
180
+ ),
181
+ stringTransform(
182
+ "unescape",
183
+ "Unescape HTML entities",
184
+ (t) => lodash.unescape(t),
185
+ {
186
+ aliases: ["unescapeHtml"],
187
+ example: { input: '"&lt;b&gt;"', output: "<b>" }
188
+ }
189
+ ),
190
+ // -- Repeat --
191
+ {
192
+ command: "repeat",
193
+ description: "Repeat a string N times",
194
+ acceptsRawInput: true,
195
+ valueRequired: true,
196
+ parameters: [
197
+ {
198
+ name: "count",
199
+ aliases: ["n"],
200
+ description: "Number of repetitions (default: 2)",
201
+ type: "number",
202
+ required: false
203
+ },
204
+ {
205
+ name: "separator",
206
+ aliases: ["sep"],
207
+ description: "Separator between repetitions (default: none)",
208
+ type: "string",
209
+ required: false
210
+ }
211
+ ],
212
+ processCommand: async (command, context) => {
213
+ const text = command.value || command.data || "";
214
+ const count = Math.min(
215
+ parseInt(command.args["count"] || command.args["n"]) || 2,
216
+ 1e3
217
+ );
218
+ const sep = command.args["separator"] || command.args["sep"] || "";
219
+ const result = Array(count).fill(text).join(sep);
220
+ context.writer.writeln(
221
+ `${context.writer.wrapInColor("Result: ", CliForegroundColor.Yellow)}${result}`
222
+ );
223
+ context.process.output(result);
224
+ },
225
+ writeDescription: (context) => {
226
+ const { writer } = context;
227
+ writer.writeln("Repeat a string multiple times");
228
+ writer.writeln();
229
+ writer.writeln("\u{1F4CB} Usage:");
230
+ writer.writeln(
231
+ ` ${writer.wrapInColor("string repeat <text> [--count=N] [--sep=S]", CliForegroundColor.Cyan)}`
232
+ );
233
+ writer.writeln();
234
+ writer.writeln("\u{1F4DD} Examples:");
235
+ writer.writeln(
236
+ ` string repeat ha --count=3 ${writer.wrapInColor("# \u2192 hahaha", CliForegroundColor.Green)}`
237
+ );
238
+ writer.writeln(
239
+ ` string repeat ab --n=3 --sep=- ${writer.wrapInColor("# \u2192 ab-ab-ab", CliForegroundColor.Green)}`
240
+ );
241
+ }
242
+ },
243
+ // -- Replace --
244
+ {
245
+ command: "replace",
246
+ description: "Replace occurrences in a string",
247
+ acceptsRawInput: true,
248
+ valueRequired: true,
249
+ parameters: [
250
+ {
251
+ name: "find",
252
+ aliases: ["f"],
253
+ description: "Text to find",
254
+ type: "string",
255
+ required: true
256
+ },
257
+ {
258
+ name: "with",
259
+ aliases: ["w"],
260
+ description: "Replacement text",
261
+ type: "string",
262
+ required: true
263
+ }
264
+ ],
265
+ processCommand: async (command, context) => {
266
+ const text = command.value || command.data || "";
267
+ const find = command.args["find"] || command.args["f"] || "";
268
+ const replacement = command.args["with"] || command.args["w"] || "";
269
+ if (!find) {
270
+ context.writer.writeError("--find is required");
271
+ context.process.exit(-1);
272
+ return;
273
+ }
274
+ const result = text.split(find).join(replacement);
275
+ context.writer.writeln(
276
+ `${context.writer.wrapInColor("Result: ", CliForegroundColor.Yellow)}${result}`
277
+ );
278
+ context.process.output(result);
279
+ },
280
+ writeDescription: (context) => {
281
+ const { writer } = context;
282
+ writer.writeln("Replace all occurrences of a substring");
283
+ writer.writeln();
284
+ writer.writeln("\u{1F4CB} Usage:");
285
+ writer.writeln(
286
+ ` ${writer.wrapInColor("string replace <text> --find=<search> --with=<replacement>", CliForegroundColor.Cyan)}`
287
+ );
288
+ writer.writeln();
289
+ writer.writeln("\u{1F4DD} Examples:");
290
+ writer.writeln(
291
+ ` string replace "hello world" --find=world --with=there`
292
+ );
293
+ writer.writeln(
294
+ ` ${writer.wrapInColor("# \u2192 hello there", CliForegroundColor.Green)}`
295
+ );
296
+ }
297
+ },
298
+ // -- Truncate --
299
+ {
300
+ command: "truncate",
301
+ aliases: ["trunc"],
302
+ description: "Truncate a string to a max length",
303
+ acceptsRawInput: true,
304
+ valueRequired: true,
305
+ parameters: [
306
+ {
307
+ name: "length",
308
+ aliases: ["l"],
309
+ description: "Maximum length (default: 30)",
310
+ type: "number",
311
+ required: false
312
+ },
313
+ {
314
+ name: "suffix",
315
+ description: "Omission suffix (default: ...)",
316
+ type: "string",
317
+ required: false
318
+ }
319
+ ],
320
+ processCommand: async (command, context) => {
321
+ const text = command.value || command.data || "";
322
+ const length = parseInt(command.args["length"] || command.args["l"]) || 30;
323
+ const suffix = command.args["suffix"] ?? "...";
324
+ const result = text.length > length ? text.substring(0, length - suffix.length) + suffix : text;
325
+ context.writer.writeln(
326
+ `${context.writer.wrapInColor("Result: ", CliForegroundColor.Yellow)}${result}`
327
+ );
328
+ context.process.output(result);
329
+ },
330
+ writeDescription: (context) => {
331
+ const { writer } = context;
332
+ writer.writeln(
333
+ "Truncate a string to a maximum length with an ellipsis"
334
+ );
335
+ writer.writeln();
336
+ writer.writeln("\u{1F4CB} Usage:");
337
+ writer.writeln(
338
+ ` ${writer.wrapInColor("string truncate <text> [--length=N] [--suffix=S]", CliForegroundColor.Cyan)}`
339
+ );
340
+ }
341
+ },
342
+ // -- Pad --
343
+ {
344
+ command: "pad",
345
+ description: "Pad a string to a target length",
346
+ acceptsRawInput: true,
347
+ valueRequired: true,
348
+ parameters: [
349
+ {
350
+ name: "length",
351
+ aliases: ["l"],
352
+ description: "Target length",
353
+ type: "number",
354
+ required: true
355
+ },
356
+ {
357
+ name: "char",
358
+ aliases: ["c"],
359
+ description: "Padding character (default: space)",
360
+ type: "string",
361
+ required: false
362
+ },
363
+ {
364
+ name: "side",
365
+ description: "Pad side: left, right, both (default: both)",
366
+ type: "string",
367
+ required: false
368
+ }
369
+ ],
370
+ processCommand: async (command, context) => {
371
+ const text = command.value || command.data || "";
372
+ const length = parseInt(
373
+ command.args["length"] || command.args["l"]
374
+ );
375
+ const char = command.args["char"] || command.args["c"] || " ";
376
+ const side = command.args["side"] || "both";
377
+ if (isNaN(length)) {
378
+ context.writer.writeError("--length is required");
379
+ context.process.exit(-1);
380
+ return;
381
+ }
382
+ let result;
383
+ switch (side) {
384
+ case "left":
385
+ case "start":
386
+ result = text.padStart(length, char);
387
+ break;
388
+ case "right":
389
+ case "end":
390
+ result = text.padEnd(length, char);
391
+ break;
392
+ default:
393
+ result = lodash.pad(text, length, char);
394
+ break;
395
+ }
396
+ context.writer.writeln(
397
+ `${context.writer.wrapInColor("Result: ", CliForegroundColor.Yellow)}"${result}"`
398
+ );
399
+ context.process.output(result);
400
+ },
401
+ writeDescription: (context) => {
402
+ const { writer } = context;
403
+ writer.writeln("Pad a string to a target length");
404
+ writer.writeln();
405
+ writer.writeln("\u{1F4CB} Usage:");
406
+ writer.writeln(
407
+ ` ${writer.wrapInColor("string pad <text> --length=N [--char=C] [--side=left|right|both]", CliForegroundColor.Cyan)}`
408
+ );
409
+ writer.writeln();
410
+ writer.writeln("\u{1F4DD} Examples:");
411
+ writer.writeln(
412
+ ` string pad hello --length=10 --char=. --side=right`
413
+ );
414
+ writer.writeln(
415
+ ` ${writer.wrapInColor('# \u2192 "hello....."', CliForegroundColor.Green)}`
416
+ );
417
+ }
418
+ },
419
+ // -- Split --
420
+ {
421
+ command: "split",
422
+ description: "Split a string by a delimiter",
423
+ acceptsRawInput: true,
424
+ valueRequired: true,
425
+ parameters: [
426
+ {
427
+ name: "by",
428
+ aliases: ["d", "delimiter"],
429
+ description: "Delimiter to split by (default: space)",
430
+ type: "string",
431
+ required: false
432
+ }
433
+ ],
434
+ processCommand: async (command, context) => {
435
+ const text = command.value || command.data || "";
436
+ const delimiter = command.args["by"] || command.args["d"] || command.args["delimiter"] || " ";
437
+ const parts = text.split(delimiter);
438
+ const { writer } = context;
439
+ parts.forEach((part, i) => {
440
+ writer.writeln(
441
+ ` ${writer.wrapInColor(String(i).padStart(3), CliForegroundColor.Yellow)} ${part}`
442
+ );
443
+ });
444
+ context.process.output(parts);
445
+ },
446
+ writeDescription: (context) => {
447
+ const { writer } = context;
448
+ writer.writeln("Split a string into parts by a delimiter");
449
+ writer.writeln();
450
+ writer.writeln("\u{1F4CB} Usage:");
451
+ writer.writeln(
452
+ ` ${writer.wrapInColor("string split <text> [--by=<delimiter>]", CliForegroundColor.Cyan)}`
453
+ );
454
+ writer.writeln();
455
+ writer.writeln("\u{1F4DD} Examples:");
456
+ writer.writeln(
457
+ ` string split "a,b,c" --by=, ${writer.wrapInColor("# \u2192 a b c", CliForegroundColor.Green)}`
458
+ );
459
+ }
460
+ },
461
+ // -- Words --
462
+ {
463
+ command: "words",
464
+ description: "Split a string into words",
465
+ acceptsRawInput: true,
466
+ valueRequired: true,
467
+ processCommand: async (command, context) => {
468
+ const text = command.value || command.data || "";
469
+ const words = lodash.words(text);
470
+ const { writer } = context;
471
+ writer.writeln(
472
+ `${writer.wrapInColor(`${words.length} words:`, CliForegroundColor.Yellow)} ${words.join(", ")}`
473
+ );
474
+ context.process.output(words);
475
+ },
476
+ writeDescription: (context) => {
477
+ const { writer } = context;
478
+ writer.writeln("Split a string into its component words");
479
+ writer.writeln();
480
+ writer.writeln("\u{1F4CB} Usage:");
481
+ writer.writeln(
482
+ ` ${writer.wrapInColor("string words <text>", CliForegroundColor.Cyan)}`
483
+ );
484
+ writer.writeln();
485
+ writer.writeln("\u{1F4DD} Examples:");
486
+ writer.writeln(
487
+ ` string words "helloWorld" ${writer.wrapInColor("# \u2192 hello, World", CliForegroundColor.Green)}`
488
+ );
489
+ writer.writeln(
490
+ ` string words "foo-bar_baz" ${writer.wrapInColor("# \u2192 foo, bar, baz", CliForegroundColor.Green)}`
491
+ );
492
+ }
493
+ },
494
+ // -- Analysis --
495
+ {
496
+ command: "length",
497
+ aliases: ["len"],
498
+ description: "Get the length of a string",
499
+ acceptsRawInput: true,
500
+ valueRequired: true,
501
+ processCommand: async (command, context) => {
502
+ const text = command.value || command.data || "";
503
+ context.writer.writeln(
504
+ `${context.writer.wrapInColor("Result: ", CliForegroundColor.Yellow)}${text.length}`
505
+ );
506
+ context.process.output(text.length);
507
+ },
508
+ writeDescription: (context) => {
509
+ const { writer } = context;
510
+ writer.writeln("Get the character count of a string");
511
+ writer.writeln();
512
+ writer.writeln("\u{1F4CB} Usage:");
513
+ writer.writeln(
514
+ ` ${writer.wrapInColor("string length <text>", CliForegroundColor.Cyan)}`
515
+ );
516
+ }
517
+ },
518
+ {
519
+ command: "wc",
520
+ aliases: ["wordcount", "count"],
521
+ description: "Count lines, words, characters, and bytes",
522
+ acceptsRawInput: true,
523
+ valueRequired: true,
524
+ processCommand: async (command, context) => {
525
+ const text = command.value || command.data || "";
526
+ const { writer } = context;
527
+ const lines = text.split(/\r?\n/).length;
528
+ const wordCount = text.trim() ? text.trim().split(/\s+/).length : 0;
529
+ const chars = text.length;
530
+ const bytes = new TextEncoder().encode(text).length;
531
+ writer.writeln(
532
+ ` ${writer.wrapInColor("Lines:", CliForegroundColor.Cyan)} ${lines}`
533
+ );
534
+ writer.writeln(
535
+ ` ${writer.wrapInColor("Words:", CliForegroundColor.Cyan)} ${wordCount}`
536
+ );
537
+ writer.writeln(
538
+ ` ${writer.wrapInColor("Characters:", CliForegroundColor.Cyan)} ${chars}`
539
+ );
540
+ writer.writeln(
541
+ ` ${writer.wrapInColor("Bytes:", CliForegroundColor.Cyan)} ${bytes}`
542
+ );
543
+ context.process.output({
544
+ lines,
545
+ words: wordCount,
546
+ chars,
547
+ bytes
548
+ });
549
+ },
550
+ writeDescription: (context) => {
551
+ const { writer } = context;
552
+ writer.writeln(
553
+ "Count lines, words, characters, and bytes in text"
554
+ );
555
+ writer.writeln();
556
+ writer.writeln("\u{1F4CB} Usage:");
557
+ writer.writeln(
558
+ ` ${writer.wrapInColor("string wc <text>", CliForegroundColor.Cyan)}`
559
+ );
560
+ }
561
+ },
562
+ {
563
+ command: "includes",
564
+ aliases: ["contains", "has"],
565
+ description: "Check if a string contains a substring",
566
+ acceptsRawInput: true,
567
+ valueRequired: true,
568
+ parameters: [
569
+ {
570
+ name: "find",
571
+ aliases: ["f"],
572
+ description: "Substring to search for",
573
+ type: "string",
574
+ required: true
575
+ }
576
+ ],
577
+ processCommand: async (command, context) => {
578
+ const text = command.value || command.data || "";
579
+ const find = command.args["find"] || command.args["f"] || "";
580
+ const result = text.includes(find);
581
+ const { writer } = context;
582
+ if (result) {
583
+ writer.writeSuccess(`"${find}" found in string`);
584
+ } else {
585
+ writer.writeError(`"${find}" not found in string`);
586
+ }
587
+ context.process.output(result);
588
+ },
589
+ writeDescription: (context) => {
590
+ const { writer } = context;
591
+ writer.writeln(
592
+ "Check if a string contains a given substring"
593
+ );
594
+ writer.writeln();
595
+ writer.writeln("\u{1F4CB} Usage:");
596
+ writer.writeln(
597
+ ` ${writer.wrapInColor("string includes <text> --find=<substring>", CliForegroundColor.Cyan)}`
598
+ );
599
+ }
600
+ },
601
+ {
602
+ command: "startsWith",
603
+ description: "Check if a string starts with a prefix",
604
+ acceptsRawInput: true,
605
+ valueRequired: true,
606
+ parameters: [
607
+ {
608
+ name: "find",
609
+ aliases: ["f"],
610
+ description: "Prefix to check",
611
+ type: "string",
612
+ required: true
613
+ }
614
+ ],
615
+ processCommand: async (command, context) => {
616
+ const text = command.value || command.data || "";
617
+ const find = command.args["find"] || command.args["f"] || "";
618
+ const result = text.startsWith(find);
619
+ const { writer } = context;
620
+ writer.writeln(
621
+ `${writer.wrapInColor("Result: ", CliForegroundColor.Yellow)}${result}`
622
+ );
623
+ context.process.output(result);
624
+ },
625
+ writeDescription: (context) => {
626
+ const { writer } = context;
627
+ writer.writeln(
628
+ "Check if a string starts with a given prefix"
629
+ );
630
+ writer.writeln();
631
+ writer.writeln("\u{1F4CB} Usage:");
632
+ writer.writeln(
633
+ ` ${writer.wrapInColor("string startsWith <text> --find=<prefix>", CliForegroundColor.Cyan)}`
634
+ );
635
+ }
636
+ },
637
+ {
638
+ command: "endsWith",
639
+ description: "Check if a string ends with a suffix",
640
+ acceptsRawInput: true,
641
+ valueRequired: true,
642
+ parameters: [
643
+ {
644
+ name: "find",
645
+ aliases: ["f"],
646
+ description: "Suffix to check",
647
+ type: "string",
648
+ required: true
649
+ }
650
+ ],
651
+ processCommand: async (command, context) => {
652
+ const text = command.value || command.data || "";
653
+ const find = command.args["find"] || command.args["f"] || "";
654
+ const result = text.endsWith(find);
655
+ const { writer } = context;
656
+ writer.writeln(
657
+ `${writer.wrapInColor("Result: ", CliForegroundColor.Yellow)}${result}`
658
+ );
659
+ context.process.output(result);
660
+ },
661
+ writeDescription: (context) => {
662
+ const { writer } = context;
663
+ writer.writeln(
664
+ "Check if a string ends with a given suffix"
665
+ );
666
+ writer.writeln();
667
+ writer.writeln("\u{1F4CB} Usage:");
668
+ writer.writeln(
669
+ ` ${writer.wrapInColor("string endsWith <text> --find=<suffix>", CliForegroundColor.Cyan)}`
670
+ );
671
+ }
672
+ }
673
+ ];
674
+ }
675
+ async processCommand(command, context) {
676
+ context.executor.showHelp(command, context);
677
+ }
678
+ writeDescription(context) {
679
+ const { writer } = context;
680
+ writer.writeln("String manipulation and analysis commands");
681
+ writer.writeln();
682
+ writer.writeln(
683
+ writer.wrapInColor(
684
+ "\u{1F520} Case Conversions:",
685
+ CliForegroundColor.Yellow
686
+ )
687
+ );
688
+ writer.writeln(
689
+ ` ${writer.wrapInColor("string upper", CliForegroundColor.Cyan)} / ${writer.wrapInColor("lower", CliForegroundColor.Cyan)} / ${writer.wrapInColor("capitalize", CliForegroundColor.Cyan)}`
690
+ );
691
+ writer.writeln(
692
+ ` ${writer.wrapInColor("string camelCase", CliForegroundColor.Cyan)} / ${writer.wrapInColor("kebabCase", CliForegroundColor.Cyan)} / ${writer.wrapInColor("snakeCase", CliForegroundColor.Cyan)} / ${writer.wrapInColor("startCase", CliForegroundColor.Cyan)}`
693
+ );
694
+ writer.writeln();
695
+ writer.writeln(
696
+ writer.wrapInColor("\u{1F527} Transform:", CliForegroundColor.Yellow)
697
+ );
698
+ writer.writeln(
699
+ ` ${writer.wrapInColor("string reverse", CliForegroundColor.Cyan)} / ${writer.wrapInColor("trim", CliForegroundColor.Cyan)} / ${writer.wrapInColor("slug", CliForegroundColor.Cyan)} / ${writer.wrapInColor("repeat", CliForegroundColor.Cyan)} / ${writer.wrapInColor("replace", CliForegroundColor.Cyan)} / ${writer.wrapInColor("truncate", CliForegroundColor.Cyan)}`
700
+ );
701
+ writer.writeln(
702
+ ` ${writer.wrapInColor("string pad", CliForegroundColor.Cyan)} / ${writer.wrapInColor("escape", CliForegroundColor.Cyan)} / ${writer.wrapInColor("unescape", CliForegroundColor.Cyan)}`
703
+ );
704
+ writer.writeln();
705
+ writer.writeln(
706
+ writer.wrapInColor("\u{1F50D} Analysis:", CliForegroundColor.Yellow)
707
+ );
708
+ writer.writeln(
709
+ ` ${writer.wrapInColor("string length", CliForegroundColor.Cyan)} / ${writer.wrapInColor("wc", CliForegroundColor.Cyan)} / ${writer.wrapInColor("includes", CliForegroundColor.Cyan)} / ${writer.wrapInColor("startsWith", CliForegroundColor.Cyan)} / ${writer.wrapInColor("endsWith", CliForegroundColor.Cyan)}`
710
+ );
711
+ writer.writeln(
712
+ ` ${writer.wrapInColor("string split", CliForegroundColor.Cyan)} / ${writer.wrapInColor("words", CliForegroundColor.Cyan)}`
713
+ );
714
+ writer.writeln();
715
+ writer.writeln("\u{1F4DD} Examples:");
716
+ writer.writeln(
717
+ ` string camelCase "hello world" ${writer.wrapInColor("# \u2192 helloWorld", CliForegroundColor.Green)}`
718
+ );
719
+ writer.writeln(
720
+ ` string reverse Hello ${writer.wrapInColor("# \u2192 olleH", CliForegroundColor.Green)}`
721
+ );
722
+ writer.writeln(
723
+ ` string slug "Hello World!" ${writer.wrapInColor("# \u2192 hello-world", CliForegroundColor.Green)}`
724
+ );
725
+ writer.writeln(
726
+ ` string wc "some text here" ${writer.wrapInColor("# word/char counts", CliForegroundColor.Green)}`
727
+ );
728
+ }
729
+ };
730
+
731
+ // src/public-api.ts
732
+ var stringModule = {
733
+ apiVersion: API_VERSION,
734
+ name: "@qodalis/cli-string",
735
+ processors: [new CliStringCommandProcessor()],
736
+ translations: {
737
+ es: { "cli.string.description": "Utilidades de transformaci\xF3n de cadenas" },
738
+ fr: { "cli.string.description": "Utilitaires de transformation de cha\xEEnes" },
739
+ de: { "cli.string.description": "Zeichenketten-Transformationswerkzeuge" },
740
+ pt: { "cli.string.description": "Utilit\xE1rios de transforma\xE7\xE3o de strings" },
741
+ it: { "cli.string.description": "Utilit\xE0 di trasformazione stringhe" },
742
+ ja: { "cli.string.description": "\u6587\u5B57\u5217\u5909\u63DB\u30E6\u30FC\u30C6\u30A3\u30EA\u30C6\u30A3" },
743
+ ko: { "cli.string.description": "\uBB38\uC790\uC5F4 \uBCC0\uD658 \uC720\uD2F8\uB9AC\uD2F0" },
744
+ zh: { "cli.string.description": "\u5B57\u7B26\u4E32\u8F6C\u6362\u5DE5\u5177" },
745
+ ru: { "cli.string.description": "\u0423\u0442\u0438\u043B\u0438\u0442\u044B \u043F\u0440\u0435\u043E\u0431\u0440\u0430\u0437\u043E\u0432\u0430\u043D\u0438\u044F \u0441\u0442\u0440\u043E\u043A" },
746
+ ro: { "cli.string.description": "Utilitare de transformare a \u0219irurilor de caractere" }
747
+ }
748
+ };
749
+
750
+ export { CliStringCommandProcessor, stringModule };
751
+ //# sourceMappingURL=public-api.mjs.map
752
+ //# sourceMappingURL=public-api.mjs.map