@qodalis/cli-string 0.0.2 → 2.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/umd/index.js DELETED
@@ -1,601 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('@qodalis/cli-core'), require('@angular/core'), require('lodash')) :
3
- typeof define === 'function' && define.amd ? define(['@qodalis/cli-core', '@angular/core', 'lodash'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.cliCore, global.ngCore, global._));
5
- })(this, (function (cliCore, core, _) { 'use strict';
6
-
7
- function _interopNamespaceDefault(e) {
8
- var n = Object.create(null);
9
- if (e) {
10
- Object.keys(e).forEach(function (k) {
11
- if (k !== 'default') {
12
- var d = Object.getOwnPropertyDescriptor(e, k);
13
- Object.defineProperty(n, k, d.get ? d : {
14
- enumerable: true,
15
- get: function () { return e[k]; }
16
- });
17
- }
18
- });
19
- }
20
- n.default = e;
21
- return Object.freeze(n);
22
- }
23
-
24
- var ___namespace = /*#__PURE__*/_interopNamespaceDefault(_);
25
-
26
- /******************************************************************************
27
- Copyright (c) Microsoft Corporation.
28
-
29
- Permission to use, copy, modify, and/or distribute this software for any
30
- purpose with or without fee is hereby granted.
31
-
32
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
33
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
34
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
35
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
36
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
37
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
38
- PERFORMANCE OF THIS SOFTWARE.
39
- ***************************************************************************** */
40
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
41
-
42
-
43
- function __decorate(decorators, target, key, desc) {
44
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
45
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
46
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
47
- return c > 3 && r && Object.defineProperty(target, key, r), r;
48
- }
49
-
50
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
51
- var e = new Error(message);
52
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
53
- };
54
-
55
- // Automatically generated during build
56
- const LIBRARY_VERSION = '0.0.2';
57
-
58
- const lodash = ___namespace.default || ___namespace;
59
- /**
60
- * Helper to create a simple string transform subcommand
61
- */
62
- function stringTransform(command, description, transform, options) {
63
- return {
64
- command,
65
- aliases: options?.aliases,
66
- description,
67
- allowUnlistedCommands: true,
68
- valueRequired: true,
69
- processCommand: async (cmd, context) => {
70
- const text = (cmd.value || cmd.data || '');
71
- const result = transform(text);
72
- context.writer.writeln(`${context.writer.wrapInColor('Result: ', cliCore.CliForegroundColor.Yellow)}${result}`);
73
- context.process.output(result);
74
- },
75
- writeDescription: (context) => {
76
- const { writer } = context;
77
- writer.writeln(description);
78
- writer.writeln();
79
- writer.writeln('📋 Usage:');
80
- writer.writeln(` ${writer.wrapInColor(`string ${command} <text>`, cliCore.CliForegroundColor.Cyan)}`);
81
- if (options?.example) {
82
- writer.writeln();
83
- writer.writeln('📝 Examples:');
84
- writer.writeln(` string ${command} ${options.example.input.padEnd(20)} ${writer.wrapInColor(`# → ${options.example.output}`, cliCore.CliForegroundColor.Green)}`);
85
- }
86
- },
87
- };
88
- }
89
- let CliStringCommandProcessor = class CliStringCommandProcessor {
90
- constructor() {
91
- this.command = 'string';
92
- this.aliases = ['str'];
93
- this.description = 'String manipulation commands';
94
- this.author = cliCore.DefaultLibraryAuthor;
95
- this.version = LIBRARY_VERSION;
96
- this.processors = [];
97
- this.metadata = {
98
- icon: '🔤',
99
- };
100
- this.processors = [
101
- // -- Case conversions --
102
- stringTransform('upper', 'Convert to UPPERCASE', (t) => t.toUpperCase(), {
103
- aliases: ['uppercase', 'toUpper'],
104
- example: { input: 'hello world', output: 'HELLO WORLD' },
105
- }),
106
- stringTransform('lower', 'Convert to lowercase', (t) => t.toLowerCase(), {
107
- aliases: ['lowercase', 'toLower'],
108
- example: { input: 'HELLO WORLD', output: 'hello world' },
109
- }),
110
- stringTransform('capitalize', 'Capitalize the first letter', (t) => lodash.capitalize(t), {
111
- aliases: ['cap'],
112
- example: { input: 'hello world', output: 'Hello world' },
113
- }),
114
- stringTransform('camelCase', 'Convert to camelCase', (t) => lodash.camelCase(t), {
115
- aliases: ['camel'],
116
- example: { input: 'hello world', output: 'helloWorld' },
117
- }),
118
- stringTransform('kebabCase', 'Convert to kebab-case', (t) => lodash.kebabCase(t), {
119
- aliases: ['kebab'],
120
- example: { input: 'Hello World', output: 'hello-world' },
121
- }),
122
- stringTransform('snakeCase', 'Convert to snake_case', (t) => lodash.snakeCase(t), {
123
- aliases: ['snake'],
124
- example: { input: 'Hello World', output: 'hello_world' },
125
- }),
126
- stringTransform('startCase', 'Convert to Start Case', (t) => lodash.startCase(t), {
127
- aliases: ['title', 'titleCase'],
128
- example: { input: 'hello-world', output: 'Hello World' },
129
- }),
130
- // -- Trimming --
131
- stringTransform('trim', 'Remove whitespace from both ends', (t) => t.trim(), {
132
- example: { input: '" hello "', output: 'hello' },
133
- }),
134
- stringTransform('trimStart', 'Remove whitespace from the start', (t) => t.trimStart(), {
135
- aliases: ['ltrim'],
136
- example: { input: '" hello"', output: 'hello' },
137
- }),
138
- stringTransform('trimEnd', 'Remove whitespace from the end', (t) => t.trimEnd(), {
139
- aliases: ['rtrim'],
140
- example: { input: '"hello "', output: 'hello' },
141
- }),
142
- // -- Transform --
143
- stringTransform('reverse', 'Reverse a string', (t) => [...t].reverse().join(''), {
144
- aliases: ['rev'],
145
- example: { input: 'Hello', output: 'olleH' },
146
- }),
147
- stringTransform('slug', 'Convert to URL-friendly slug', (t) => t.toLowerCase()
148
- .normalize('NFD')
149
- .replace(/[\u0300-\u036f]/g, '')
150
- .replace(/[^a-z0-9]+/g, '-')
151
- .replace(/^-|-$/g, ''), {
152
- aliases: ['slugify'],
153
- example: { input: '"Hello World!"', output: 'hello-world' },
154
- }),
155
- stringTransform('escape', 'Escape HTML entities', (t) => lodash.escape(t), {
156
- aliases: ['escapeHtml'],
157
- example: { input: '"<b>hi</b>"', output: '&lt;b&gt;hi&lt;/b&gt;' },
158
- }),
159
- stringTransform('unescape', 'Unescape HTML entities', (t) => lodash.unescape(t), {
160
- aliases: ['unescapeHtml'],
161
- example: { input: '"&lt;b&gt;"', output: '<b>' },
162
- }),
163
- // -- Repeat --
164
- {
165
- command: 'repeat',
166
- description: 'Repeat a string N times',
167
- allowUnlistedCommands: true,
168
- valueRequired: true,
169
- parameters: [
170
- {
171
- name: 'count',
172
- aliases: ['n'],
173
- description: 'Number of repetitions (default: 2)',
174
- type: 'number',
175
- required: false,
176
- },
177
- {
178
- name: 'separator',
179
- aliases: ['sep'],
180
- description: 'Separator between repetitions (default: none)',
181
- type: 'string',
182
- required: false,
183
- },
184
- ],
185
- processCommand: async (command, context) => {
186
- const text = (command.value || command.data || '');
187
- const count = Math.min(parseInt(command.args['count'] || command.args['n']) || 2, 1000);
188
- const sep = command.args['separator'] || command.args['sep'] || '';
189
- const result = Array(count).fill(text).join(sep);
190
- context.writer.writeln(`${context.writer.wrapInColor('Result: ', cliCore.CliForegroundColor.Yellow)}${result}`);
191
- context.process.output(result);
192
- },
193
- writeDescription: (context) => {
194
- const { writer } = context;
195
- writer.writeln('Repeat a string multiple times');
196
- writer.writeln();
197
- writer.writeln('📋 Usage:');
198
- writer.writeln(` ${writer.wrapInColor('string repeat <text> [--count=N] [--sep=S]', cliCore.CliForegroundColor.Cyan)}`);
199
- writer.writeln();
200
- writer.writeln('📝 Examples:');
201
- writer.writeln(` string repeat ha --count=3 ${writer.wrapInColor('# → hahaha', cliCore.CliForegroundColor.Green)}`);
202
- writer.writeln(` string repeat ab --n=3 --sep=- ${writer.wrapInColor('# → ab-ab-ab', cliCore.CliForegroundColor.Green)}`);
203
- },
204
- },
205
- // -- Replace --
206
- {
207
- command: 'replace',
208
- description: 'Replace occurrences in a string',
209
- allowUnlistedCommands: true,
210
- valueRequired: true,
211
- parameters: [
212
- {
213
- name: 'find',
214
- aliases: ['f'],
215
- description: 'Text to find',
216
- type: 'string',
217
- required: true,
218
- },
219
- {
220
- name: 'with',
221
- aliases: ['w'],
222
- description: 'Replacement text',
223
- type: 'string',
224
- required: true,
225
- },
226
- ],
227
- processCommand: async (command, context) => {
228
- const text = (command.value || command.data || '');
229
- const find = command.args['find'] || command.args['f'] || '';
230
- const replacement = command.args['with'] || command.args['w'] || '';
231
- if (!find) {
232
- context.writer.writeError('--find is required');
233
- context.process.exit(-1);
234
- return;
235
- }
236
- const result = text.split(find).join(replacement);
237
- context.writer.writeln(`${context.writer.wrapInColor('Result: ', cliCore.CliForegroundColor.Yellow)}${result}`);
238
- context.process.output(result);
239
- },
240
- writeDescription: (context) => {
241
- const { writer } = context;
242
- writer.writeln('Replace all occurrences of a substring');
243
- writer.writeln();
244
- writer.writeln('📋 Usage:');
245
- writer.writeln(` ${writer.wrapInColor('string replace <text> --find=<search> --with=<replacement>', cliCore.CliForegroundColor.Cyan)}`);
246
- writer.writeln();
247
- writer.writeln('📝 Examples:');
248
- writer.writeln(` string replace "hello world" --find=world --with=there`);
249
- writer.writeln(` ${writer.wrapInColor('# → hello there', cliCore.CliForegroundColor.Green)}`);
250
- },
251
- },
252
- // -- Truncate --
253
- {
254
- command: 'truncate',
255
- aliases: ['trunc'],
256
- description: 'Truncate a string to a max length',
257
- allowUnlistedCommands: true,
258
- valueRequired: true,
259
- parameters: [
260
- {
261
- name: 'length',
262
- aliases: ['l'],
263
- description: 'Maximum length (default: 30)',
264
- type: 'number',
265
- required: false,
266
- },
267
- {
268
- name: 'suffix',
269
- description: 'Omission suffix (default: ...)',
270
- type: 'string',
271
- required: false,
272
- },
273
- ],
274
- processCommand: async (command, context) => {
275
- const text = (command.value || command.data || '');
276
- const length = parseInt(command.args['length'] || command.args['l']) || 30;
277
- const suffix = command.args['suffix'] ?? '...';
278
- const result = text.length > length
279
- ? text.substring(0, length - suffix.length) + suffix
280
- : text;
281
- context.writer.writeln(`${context.writer.wrapInColor('Result: ', cliCore.CliForegroundColor.Yellow)}${result}`);
282
- context.process.output(result);
283
- },
284
- writeDescription: (context) => {
285
- const { writer } = context;
286
- writer.writeln('Truncate a string to a maximum length with an ellipsis');
287
- writer.writeln();
288
- writer.writeln('📋 Usage:');
289
- writer.writeln(` ${writer.wrapInColor('string truncate <text> [--length=N] [--suffix=S]', cliCore.CliForegroundColor.Cyan)}`);
290
- },
291
- },
292
- // -- Pad --
293
- {
294
- command: 'pad',
295
- description: 'Pad a string to a target length',
296
- allowUnlistedCommands: true,
297
- valueRequired: true,
298
- parameters: [
299
- {
300
- name: 'length',
301
- aliases: ['l'],
302
- description: 'Target length',
303
- type: 'number',
304
- required: true,
305
- },
306
- {
307
- name: 'char',
308
- aliases: ['c'],
309
- description: 'Padding character (default: space)',
310
- type: 'string',
311
- required: false,
312
- },
313
- {
314
- name: 'side',
315
- description: 'Pad side: left, right, both (default: both)',
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']);
323
- const char = command.args['char'] || command.args['c'] || ' ';
324
- const side = command.args['side'] || 'both';
325
- if (isNaN(length)) {
326
- context.writer.writeError('--length is required');
327
- context.process.exit(-1);
328
- return;
329
- }
330
- let result;
331
- switch (side) {
332
- case 'left':
333
- case 'start':
334
- result = text.padStart(length, char);
335
- break;
336
- case 'right':
337
- case 'end':
338
- result = text.padEnd(length, char);
339
- break;
340
- default:
341
- result = lodash.pad(text, length, char);
342
- break;
343
- }
344
- context.writer.writeln(`${context.writer.wrapInColor('Result: ', cliCore.CliForegroundColor.Yellow)}"${result}"`);
345
- context.process.output(result);
346
- },
347
- writeDescription: (context) => {
348
- const { writer } = context;
349
- writer.writeln('Pad a string to a target length');
350
- writer.writeln();
351
- writer.writeln('📋 Usage:');
352
- writer.writeln(` ${writer.wrapInColor('string pad <text> --length=N [--char=C] [--side=left|right|both]', cliCore.CliForegroundColor.Cyan)}`);
353
- writer.writeln();
354
- writer.writeln('📝 Examples:');
355
- writer.writeln(` string pad hello --length=10 --char=. --side=right`);
356
- writer.writeln(` ${writer.wrapInColor('# → "hello....."', cliCore.CliForegroundColor.Green)}`);
357
- },
358
- },
359
- // -- Split --
360
- {
361
- command: 'split',
362
- description: 'Split a string by a delimiter',
363
- allowUnlistedCommands: true,
364
- valueRequired: true,
365
- parameters: [
366
- {
367
- name: 'by',
368
- aliases: ['d', 'delimiter'],
369
- description: 'Delimiter to split by (default: space)',
370
- type: 'string',
371
- required: false,
372
- },
373
- ],
374
- processCommand: async (command, context) => {
375
- const text = (command.value || command.data || '');
376
- const delimiter = command.args['by'] || command.args['d'] || command.args['delimiter'] || ' ';
377
- const parts = text.split(delimiter);
378
- const { writer } = context;
379
- parts.forEach((part, i) => {
380
- writer.writeln(` ${writer.wrapInColor(String(i).padStart(3), cliCore.CliForegroundColor.Yellow)} ${part}`);
381
- });
382
- context.process.output(parts);
383
- },
384
- writeDescription: (context) => {
385
- const { writer } = context;
386
- writer.writeln('Split a string into parts by a delimiter');
387
- writer.writeln();
388
- writer.writeln('📋 Usage:');
389
- writer.writeln(` ${writer.wrapInColor('string split <text> [--by=<delimiter>]', cliCore.CliForegroundColor.Cyan)}`);
390
- writer.writeln();
391
- writer.writeln('📝 Examples:');
392
- writer.writeln(` string split "a,b,c" --by=, ${writer.wrapInColor('# → a b c', cliCore.CliForegroundColor.Green)}`);
393
- },
394
- },
395
- // -- Words --
396
- {
397
- command: 'words',
398
- description: 'Split a string into words',
399
- allowUnlistedCommands: true,
400
- valueRequired: true,
401
- processCommand: async (command, context) => {
402
- const text = (command.value || command.data || '');
403
- const words = lodash.words(text);
404
- const { writer } = context;
405
- writer.writeln(`${writer.wrapInColor(`${words.length} words:`, cliCore.CliForegroundColor.Yellow)} ${words.join(', ')}`);
406
- context.process.output(words);
407
- },
408
- writeDescription: (context) => {
409
- const { writer } = context;
410
- writer.writeln('Split a string into its component words');
411
- writer.writeln();
412
- writer.writeln('📋 Usage:');
413
- writer.writeln(` ${writer.wrapInColor('string words <text>', cliCore.CliForegroundColor.Cyan)}`);
414
- writer.writeln();
415
- writer.writeln('📝 Examples:');
416
- writer.writeln(` string words "helloWorld" ${writer.wrapInColor('# → hello, World', cliCore.CliForegroundColor.Green)}`);
417
- writer.writeln(` string words "foo-bar_baz" ${writer.wrapInColor('# → foo, bar, baz', cliCore.CliForegroundColor.Green)}`);
418
- },
419
- },
420
- // -- Analysis --
421
- {
422
- command: 'length',
423
- aliases: ['len'],
424
- description: 'Get the length of a string',
425
- allowUnlistedCommands: true,
426
- valueRequired: true,
427
- processCommand: async (command, context) => {
428
- const text = (command.value || command.data || '');
429
- context.writer.writeln(`${context.writer.wrapInColor('Result: ', cliCore.CliForegroundColor.Yellow)}${text.length}`);
430
- context.process.output(text.length);
431
- },
432
- writeDescription: (context) => {
433
- const { writer } = context;
434
- writer.writeln('Get the character count of a string');
435
- writer.writeln();
436
- writer.writeln('📋 Usage:');
437
- writer.writeln(` ${writer.wrapInColor('string length <text>', cliCore.CliForegroundColor.Cyan)}`);
438
- },
439
- },
440
- {
441
- command: 'wc',
442
- aliases: ['wordcount', 'count'],
443
- description: 'Count lines, words, characters, and bytes',
444
- allowUnlistedCommands: true,
445
- valueRequired: true,
446
- processCommand: async (command, context) => {
447
- const text = (command.value || command.data || '');
448
- const { writer } = context;
449
- const lines = text.split(/\r?\n/).length;
450
- const wordCount = text.trim() ? text.trim().split(/\s+/).length : 0;
451
- const chars = text.length;
452
- const bytes = new TextEncoder().encode(text).length;
453
- writer.writeln(` ${writer.wrapInColor('Lines:', cliCore.CliForegroundColor.Cyan)} ${lines}`);
454
- writer.writeln(` ${writer.wrapInColor('Words:', cliCore.CliForegroundColor.Cyan)} ${wordCount}`);
455
- writer.writeln(` ${writer.wrapInColor('Characters:', cliCore.CliForegroundColor.Cyan)} ${chars}`);
456
- writer.writeln(` ${writer.wrapInColor('Bytes:', cliCore.CliForegroundColor.Cyan)} ${bytes}`);
457
- context.process.output({ lines, words: wordCount, chars, bytes });
458
- },
459
- writeDescription: (context) => {
460
- const { writer } = context;
461
- writer.writeln('Count lines, words, characters, and bytes in text');
462
- writer.writeln();
463
- writer.writeln('📋 Usage:');
464
- writer.writeln(` ${writer.wrapInColor('string wc <text>', cliCore.CliForegroundColor.Cyan)}`);
465
- },
466
- },
467
- {
468
- command: 'includes',
469
- aliases: ['contains', 'has'],
470
- description: 'Check if a string contains a substring',
471
- allowUnlistedCommands: true,
472
- valueRequired: true,
473
- parameters: [
474
- {
475
- name: 'find',
476
- aliases: ['f'],
477
- description: 'Substring to search for',
478
- type: 'string',
479
- required: true,
480
- },
481
- ],
482
- processCommand: async (command, context) => {
483
- const text = (command.value || command.data || '');
484
- const find = command.args['find'] || command.args['f'] || '';
485
- const result = text.includes(find);
486
- const { writer } = context;
487
- if (result) {
488
- writer.writeSuccess(`"${find}" found in string`);
489
- }
490
- else {
491
- writer.writeError(`"${find}" not found in string`);
492
- }
493
- context.process.output(result);
494
- },
495
- writeDescription: (context) => {
496
- const { writer } = context;
497
- writer.writeln('Check if a string contains a given substring');
498
- writer.writeln();
499
- writer.writeln('📋 Usage:');
500
- writer.writeln(` ${writer.wrapInColor('string includes <text> --find=<substring>', cliCore.CliForegroundColor.Cyan)}`);
501
- },
502
- },
503
- {
504
- command: 'startsWith',
505
- description: 'Check if a string starts with a prefix',
506
- allowUnlistedCommands: true,
507
- valueRequired: true,
508
- parameters: [
509
- {
510
- name: 'find',
511
- aliases: ['f'],
512
- description: 'Prefix to check',
513
- type: 'string',
514
- required: true,
515
- },
516
- ],
517
- processCommand: async (command, context) => {
518
- const text = (command.value || command.data || '');
519
- const find = command.args['find'] || command.args['f'] || '';
520
- const result = text.startsWith(find);
521
- const { writer } = context;
522
- writer.writeln(`${writer.wrapInColor('Result: ', cliCore.CliForegroundColor.Yellow)}${result}`);
523
- context.process.output(result);
524
- },
525
- writeDescription: (context) => {
526
- const { writer } = context;
527
- writer.writeln('Check if a string starts with a given prefix');
528
- writer.writeln();
529
- writer.writeln('📋 Usage:');
530
- writer.writeln(` ${writer.wrapInColor('string startsWith <text> --find=<prefix>', cliCore.CliForegroundColor.Cyan)}`);
531
- },
532
- },
533
- {
534
- command: 'endsWith',
535
- description: 'Check if a string ends with a suffix',
536
- allowUnlistedCommands: true,
537
- valueRequired: true,
538
- parameters: [
539
- {
540
- name: 'find',
541
- aliases: ['f'],
542
- description: 'Suffix to check',
543
- type: 'string',
544
- required: true,
545
- },
546
- ],
547
- processCommand: async (command, context) => {
548
- const text = (command.value || command.data || '');
549
- const find = command.args['find'] || command.args['f'] || '';
550
- const result = text.endsWith(find);
551
- const { writer } = context;
552
- writer.writeln(`${writer.wrapInColor('Result: ', cliCore.CliForegroundColor.Yellow)}${result}`);
553
- context.process.output(result);
554
- },
555
- writeDescription: (context) => {
556
- const { writer } = context;
557
- writer.writeln('Check if a string ends with a given suffix');
558
- writer.writeln();
559
- writer.writeln('📋 Usage:');
560
- writer.writeln(` ${writer.wrapInColor('string endsWith <text> --find=<suffix>', cliCore.CliForegroundColor.Cyan)}`);
561
- },
562
- },
563
- ];
564
- }
565
- async processCommand(command, context) {
566
- context.executor.showHelp(command, context);
567
- }
568
- writeDescription(context) {
569
- const { writer } = context;
570
- writer.writeln('String manipulation and analysis commands');
571
- writer.writeln();
572
- writer.writeln(writer.wrapInColor('🔠 Case Conversions:', cliCore.CliForegroundColor.Yellow));
573
- writer.writeln(` ${writer.wrapInColor('string upper', cliCore.CliForegroundColor.Cyan)} / ${writer.wrapInColor('lower', cliCore.CliForegroundColor.Cyan)} / ${writer.wrapInColor('capitalize', cliCore.CliForegroundColor.Cyan)}`);
574
- writer.writeln(` ${writer.wrapInColor('string camelCase', cliCore.CliForegroundColor.Cyan)} / ${writer.wrapInColor('kebabCase', cliCore.CliForegroundColor.Cyan)} / ${writer.wrapInColor('snakeCase', cliCore.CliForegroundColor.Cyan)} / ${writer.wrapInColor('startCase', cliCore.CliForegroundColor.Cyan)}`);
575
- writer.writeln();
576
- writer.writeln(writer.wrapInColor('🔧 Transform:', cliCore.CliForegroundColor.Yellow));
577
- writer.writeln(` ${writer.wrapInColor('string reverse', cliCore.CliForegroundColor.Cyan)} / ${writer.wrapInColor('trim', cliCore.CliForegroundColor.Cyan)} / ${writer.wrapInColor('slug', cliCore.CliForegroundColor.Cyan)} / ${writer.wrapInColor('repeat', cliCore.CliForegroundColor.Cyan)} / ${writer.wrapInColor('replace', cliCore.CliForegroundColor.Cyan)} / ${writer.wrapInColor('truncate', cliCore.CliForegroundColor.Cyan)}`);
578
- writer.writeln(` ${writer.wrapInColor('string pad', cliCore.CliForegroundColor.Cyan)} / ${writer.wrapInColor('escape', cliCore.CliForegroundColor.Cyan)} / ${writer.wrapInColor('unescape', cliCore.CliForegroundColor.Cyan)}`);
579
- writer.writeln();
580
- writer.writeln(writer.wrapInColor('🔍 Analysis:', cliCore.CliForegroundColor.Yellow));
581
- writer.writeln(` ${writer.wrapInColor('string length', cliCore.CliForegroundColor.Cyan)} / ${writer.wrapInColor('wc', cliCore.CliForegroundColor.Cyan)} / ${writer.wrapInColor('includes', cliCore.CliForegroundColor.Cyan)} / ${writer.wrapInColor('startsWith', cliCore.CliForegroundColor.Cyan)} / ${writer.wrapInColor('endsWith', cliCore.CliForegroundColor.Cyan)}`);
582
- writer.writeln(` ${writer.wrapInColor('string split', cliCore.CliForegroundColor.Cyan)} / ${writer.wrapInColor('words', cliCore.CliForegroundColor.Cyan)}`);
583
- writer.writeln();
584
- writer.writeln('📝 Examples:');
585
- writer.writeln(` string camelCase "hello world" ${writer.wrapInColor('# → helloWorld', cliCore.CliForegroundColor.Green)}`);
586
- writer.writeln(` string reverse Hello ${writer.wrapInColor('# → olleH', cliCore.CliForegroundColor.Green)}`);
587
- writer.writeln(` string slug "Hello World!" ${writer.wrapInColor('# → hello-world', cliCore.CliForegroundColor.Green)}`);
588
- writer.writeln(` string wc "some text here" ${writer.wrapInColor('# word/char counts', cliCore.CliForegroundColor.Green)}`);
589
- }
590
- };
591
- CliStringCommandProcessor = __decorate([
592
- core.Injectable()
593
- ], CliStringCommandProcessor);
594
-
595
- const module = {
596
- name: '@qodalis/cli-string',
597
- processors: [new CliStringCommandProcessor()],
598
- };
599
- cliCore.bootUmdModule(module);
600
-
601
- }));