@hichchi/utils 0.0.4 → 0.0.5
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/CHANGELOG.md +4 -0
- package/README.md +115 -237
- package/index.cjs.js +0 -64
- package/index.esm.js +1 -64
- package/package.json +1 -1
- package/src/utils/url.utils.d.ts +0 -43
package/README.md
CHANGED
|
@@ -212,7 +212,6 @@ Complete technical reference for all classes, interfaces, methods, and types in
|
|
|
212
212
|
- [dottedPathObjectToNested()](#dottedpathobjecttonested)
|
|
213
213
|
- [escapeRegExp()](#escaperegexp)
|
|
214
214
|
- [extractEmails()](#extractemails)
|
|
215
|
-
- [extractSubdomain()](#extractsubdomain)
|
|
216
215
|
- [extractUrls()](#extracturls)
|
|
217
216
|
- [filterByObject()](#filterbyobject)
|
|
218
217
|
- [format()](#format)
|
|
@@ -297,7 +296,7 @@ Complete technical reference for all classes, interfaces, methods, and types in
|
|
|
297
296
|
|
|
298
297
|
### TemplateTag
|
|
299
298
|
|
|
300
|
-
Defined in: [enums/template-tag.enum.ts:15](https://github.com/hichchidev/hichchi/blob/
|
|
299
|
+
Defined in: [enums/template-tag.enum.ts:15](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/enums/template-tag.enum.ts#L15)
|
|
301
300
|
|
|
302
301
|
Template tags for string transformations
|
|
303
302
|
|
|
@@ -338,7 +337,7 @@ corresponding transformation to the provided value.
|
|
|
338
337
|
</td>
|
|
339
338
|
<td>
|
|
340
339
|
|
|
341
|
-
[enums/template-tag.enum.ts:22](https://github.com/hichchidev/hichchi/blob/
|
|
340
|
+
[enums/template-tag.enum.ts:22](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/enums/template-tag.enum.ts#L22)
|
|
342
341
|
|
|
343
342
|
</td>
|
|
344
343
|
</tr>
|
|
@@ -355,7 +354,7 @@ corresponding transformation to the provided value.
|
|
|
355
354
|
</td>
|
|
356
355
|
<td>
|
|
357
356
|
|
|
358
|
-
[enums/template-tag.enum.ts:21](https://github.com/hichchidev/hichchi/blob/
|
|
357
|
+
[enums/template-tag.enum.ts:21](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/enums/template-tag.enum.ts#L21)
|
|
359
358
|
|
|
360
359
|
</td>
|
|
361
360
|
</tr>
|
|
@@ -372,7 +371,7 @@ corresponding transformation to the provided value.
|
|
|
372
371
|
</td>
|
|
373
372
|
<td>
|
|
374
373
|
|
|
375
|
-
[enums/template-tag.enum.ts:29](https://github.com/hichchidev/hichchi/blob/
|
|
374
|
+
[enums/template-tag.enum.ts:29](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/enums/template-tag.enum.ts#L29)
|
|
376
375
|
|
|
377
376
|
</td>
|
|
378
377
|
</tr>
|
|
@@ -389,7 +388,7 @@ corresponding transformation to the provided value.
|
|
|
389
388
|
</td>
|
|
390
389
|
<td>
|
|
391
390
|
|
|
392
|
-
[enums/template-tag.enum.ts:32](https://github.com/hichchidev/hichchi/blob/
|
|
391
|
+
[enums/template-tag.enum.ts:32](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/enums/template-tag.enum.ts#L32)
|
|
393
392
|
|
|
394
393
|
</td>
|
|
395
394
|
</tr>
|
|
@@ -406,7 +405,7 @@ corresponding transformation to the provided value.
|
|
|
406
405
|
</td>
|
|
407
406
|
<td>
|
|
408
407
|
|
|
409
|
-
[enums/template-tag.enum.ts:24](https://github.com/hichchidev/hichchi/blob/
|
|
408
|
+
[enums/template-tag.enum.ts:24](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/enums/template-tag.enum.ts#L24)
|
|
410
409
|
|
|
411
410
|
</td>
|
|
412
411
|
</tr>
|
|
@@ -423,7 +422,7 @@ corresponding transformation to the provided value.
|
|
|
423
422
|
</td>
|
|
424
423
|
<td>
|
|
425
424
|
|
|
426
|
-
[enums/template-tag.enum.ts:19](https://github.com/hichchidev/hichchi/blob/
|
|
425
|
+
[enums/template-tag.enum.ts:19](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/enums/template-tag.enum.ts#L19)
|
|
427
426
|
|
|
428
427
|
</td>
|
|
429
428
|
</tr>
|
|
@@ -440,7 +439,7 @@ corresponding transformation to the provided value.
|
|
|
440
439
|
</td>
|
|
441
440
|
<td>
|
|
442
441
|
|
|
443
|
-
[enums/template-tag.enum.ts:27](https://github.com/hichchidev/hichchi/blob/
|
|
442
|
+
[enums/template-tag.enum.ts:27](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/enums/template-tag.enum.ts#L27)
|
|
444
443
|
|
|
445
444
|
</td>
|
|
446
445
|
</tr>
|
|
@@ -457,7 +456,7 @@ corresponding transformation to the provided value.
|
|
|
457
456
|
</td>
|
|
458
457
|
<td>
|
|
459
458
|
|
|
460
|
-
[enums/template-tag.enum.ts:31](https://github.com/hichchidev/hichchi/blob/
|
|
459
|
+
[enums/template-tag.enum.ts:31](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/enums/template-tag.enum.ts#L31)
|
|
461
460
|
|
|
462
461
|
</td>
|
|
463
462
|
</tr>
|
|
@@ -474,7 +473,7 @@ corresponding transformation to the provided value.
|
|
|
474
473
|
</td>
|
|
475
474
|
<td>
|
|
476
475
|
|
|
477
|
-
[enums/template-tag.enum.ts:23](https://github.com/hichchidev/hichchi/blob/
|
|
476
|
+
[enums/template-tag.enum.ts:23](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/enums/template-tag.enum.ts#L23)
|
|
478
477
|
|
|
479
478
|
</td>
|
|
480
479
|
</tr>
|
|
@@ -491,7 +490,7 @@ corresponding transformation to the provided value.
|
|
|
491
490
|
</td>
|
|
492
491
|
<td>
|
|
493
492
|
|
|
494
|
-
[enums/template-tag.enum.ts:20](https://github.com/hichchidev/hichchi/blob/
|
|
493
|
+
[enums/template-tag.enum.ts:20](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/enums/template-tag.enum.ts#L20)
|
|
495
494
|
|
|
496
495
|
</td>
|
|
497
496
|
</tr>
|
|
@@ -508,7 +507,7 @@ corresponding transformation to the provided value.
|
|
|
508
507
|
</td>
|
|
509
508
|
<td>
|
|
510
509
|
|
|
511
|
-
[enums/template-tag.enum.ts:30](https://github.com/hichchidev/hichchi/blob/
|
|
510
|
+
[enums/template-tag.enum.ts:30](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/enums/template-tag.enum.ts#L30)
|
|
512
511
|
|
|
513
512
|
</td>
|
|
514
513
|
</tr>
|
|
@@ -525,7 +524,7 @@ corresponding transformation to the provided value.
|
|
|
525
524
|
</td>
|
|
526
525
|
<td>
|
|
527
526
|
|
|
528
|
-
[enums/template-tag.enum.ts:17](https://github.com/hichchidev/hichchi/blob/
|
|
527
|
+
[enums/template-tag.enum.ts:17](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/enums/template-tag.enum.ts#L17)
|
|
529
528
|
|
|
530
529
|
</td>
|
|
531
530
|
</tr>
|
|
@@ -542,7 +541,7 @@ corresponding transformation to the provided value.
|
|
|
542
541
|
</td>
|
|
543
542
|
<td>
|
|
544
543
|
|
|
545
|
-
[enums/template-tag.enum.ts:26](https://github.com/hichchidev/hichchi/blob/
|
|
544
|
+
[enums/template-tag.enum.ts:26](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/enums/template-tag.enum.ts#L26)
|
|
546
545
|
|
|
547
546
|
</td>
|
|
548
547
|
</tr>
|
|
@@ -559,7 +558,7 @@ corresponding transformation to the provided value.
|
|
|
559
558
|
</td>
|
|
560
559
|
<td>
|
|
561
560
|
|
|
562
|
-
[enums/template-tag.enum.ts:16](https://github.com/hichchidev/hichchi/blob/
|
|
561
|
+
[enums/template-tag.enum.ts:16](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/enums/template-tag.enum.ts#L16)
|
|
563
562
|
|
|
564
563
|
</td>
|
|
565
564
|
</tr>
|
|
@@ -576,7 +575,7 @@ corresponding transformation to the provided value.
|
|
|
576
575
|
</td>
|
|
577
576
|
<td>
|
|
578
577
|
|
|
579
|
-
[enums/template-tag.enum.ts:28](https://github.com/hichchidev/hichchi/blob/
|
|
578
|
+
[enums/template-tag.enum.ts:28](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/enums/template-tag.enum.ts#L28)
|
|
580
579
|
|
|
581
580
|
</td>
|
|
582
581
|
</tr>
|
|
@@ -593,7 +592,7 @@ corresponding transformation to the provided value.
|
|
|
593
592
|
</td>
|
|
594
593
|
<td>
|
|
595
594
|
|
|
596
|
-
[enums/template-tag.enum.ts:25](https://github.com/hichchidev/hichchi/blob/
|
|
595
|
+
[enums/template-tag.enum.ts:25](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/enums/template-tag.enum.ts#L25)
|
|
597
596
|
|
|
598
597
|
</td>
|
|
599
598
|
</tr>
|
|
@@ -610,7 +609,7 @@ corresponding transformation to the provided value.
|
|
|
610
609
|
</td>
|
|
611
610
|
<td>
|
|
612
611
|
|
|
613
|
-
[enums/template-tag.enum.ts:18](https://github.com/hichchidev/hichchi/blob/
|
|
612
|
+
[enums/template-tag.enum.ts:18](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/enums/template-tag.enum.ts#L18)
|
|
614
613
|
|
|
615
614
|
</td>
|
|
616
615
|
</tr>
|
|
@@ -625,7 +624,7 @@ corresponding transformation to the provided value.
|
|
|
625
624
|
function applyTemplate(str, prefix): string;
|
|
626
625
|
```
|
|
627
626
|
|
|
628
|
-
Defined in: [utils/string-template.utils.ts:83](https://github.com/hichchidev/hichchi/blob/
|
|
627
|
+
Defined in: [utils/string-template.utils.ts:83](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string-template.utils.ts#L83)
|
|
629
628
|
|
|
630
629
|
Applies a value to a template string containing transformation tags.
|
|
631
630
|
|
|
@@ -748,7 +747,7 @@ applyTemplate(
|
|
|
748
747
|
function applyTemplates(str, prefixes): string;
|
|
749
748
|
```
|
|
750
749
|
|
|
751
|
-
Defined in: [utils/string-template.utils.ts:211](https://github.com/hichchidev/hichchi/blob/
|
|
750
|
+
Defined in: [utils/string-template.utils.ts:211](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string-template.utils.ts#L211)
|
|
752
751
|
|
|
753
752
|
Applies multiple named template transformations to a string with different values for each prefix.
|
|
754
753
|
|
|
@@ -916,7 +915,7 @@ CREATE INDEX idx_#{table.snakeCase}_#{field.snakeCase} ON #{table.snakeCase}(#{f
|
|
|
916
915
|
function breakToWords(str): string[];
|
|
917
916
|
```
|
|
918
917
|
|
|
919
|
-
Defined in: [utils/string.utils.ts:47](https://github.com/hichchidev/hichchi/blob/
|
|
918
|
+
Defined in: [utils/string.utils.ts:47](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L47)
|
|
920
919
|
|
|
921
920
|
Breaks a string into an array of words based on common separator patterns.
|
|
922
921
|
|
|
@@ -991,7 +990,7 @@ breakToWords("123Test456"); // ['123', 'test', '456']
|
|
|
991
990
|
function breakToWords(str, format): string;
|
|
992
991
|
```
|
|
993
992
|
|
|
994
|
-
Defined in: [utils/string.utils.ts:76](https://github.com/hichchidev/hichchi/blob/
|
|
993
|
+
Defined in: [utils/string.utils.ts:76](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L76)
|
|
995
994
|
|
|
996
995
|
Breaks a string into words and formats them using a provided function.
|
|
997
996
|
|
|
@@ -1079,7 +1078,7 @@ breakToWords("SYSTEM_ERROR", (word) => word.toLowerCase()); // "system error"
|
|
|
1079
1078
|
function countOccurrences(str, searchValue, caseSensitive?): number;
|
|
1080
1079
|
```
|
|
1081
1080
|
|
|
1082
|
-
Defined in: [utils/string.utils.ts:1288](https://github.com/hichchidev/hichchi/blob/
|
|
1081
|
+
Defined in: [utils/string.utils.ts:1288](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L1288)
|
|
1083
1082
|
|
|
1084
1083
|
Counts the occurrences of a substring within a string.
|
|
1085
1084
|
|
|
@@ -1186,7 +1185,7 @@ countOccurrences("Hello hello", "hello", true); // 1
|
|
|
1186
1185
|
function createExcerpt(text, searchTerm, contextLength?, ellipsis?): string;
|
|
1187
1186
|
```
|
|
1188
1187
|
|
|
1189
|
-
Defined in: [utils/string.utils.ts:721](https://github.com/hichchidev/hichchi/blob/
|
|
1188
|
+
Defined in: [utils/string.utils.ts:721](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L721)
|
|
1190
1189
|
|
|
1191
1190
|
Creates an excerpt from a longer text by extracting a portion around a search term.
|
|
1192
1191
|
Useful for search result highlighting or previews.
|
|
@@ -1321,7 +1320,7 @@ createExcerpt(article, "consectetur", 15, "[...]");
|
|
|
1321
1320
|
function deepCopy<T>(obj): T;
|
|
1322
1321
|
```
|
|
1323
1322
|
|
|
1324
|
-
Defined in: [utils/object.utils.ts:23](https://github.com/hichchidev/hichchi/blob/
|
|
1323
|
+
Defined in: [utils/object.utils.ts:23](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/object.utils.ts#L23)
|
|
1325
1324
|
|
|
1326
1325
|
Deep copy an object.
|
|
1327
1326
|
|
|
@@ -1406,7 +1405,7 @@ const copiedObject = deepCopy(object);
|
|
|
1406
1405
|
function dottedPathObjectToNested<R>(pathValueSet): R;
|
|
1407
1406
|
```
|
|
1408
1407
|
|
|
1409
|
-
Defined in: [utils/object.utils.ts:549](https://github.com/hichchidev/hichchi/blob/
|
|
1408
|
+
Defined in: [utils/object.utils.ts:549](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/object.utils.ts#L549)
|
|
1410
1409
|
|
|
1411
1410
|
Converts a flattened DottedPathValueObject back into a nested object structure.
|
|
1412
1411
|
|
|
@@ -1550,7 +1549,7 @@ const userData = dottedPathObjectToNested<User>(flatData);
|
|
|
1550
1549
|
function escapeRegExp(str): string;
|
|
1551
1550
|
```
|
|
1552
1551
|
|
|
1553
|
-
Defined in: [utils/string.utils.ts:1134](https://github.com/hichchidev/hichchi/blob/
|
|
1552
|
+
Defined in: [utils/string.utils.ts:1134](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L1134)
|
|
1554
1553
|
|
|
1555
1554
|
Escapes special characters in a string for use in regular expressions.
|
|
1556
1555
|
|
|
@@ -1609,7 +1608,7 @@ const regex = new RegExp(escapeRegExp(userInput));
|
|
|
1609
1608
|
function extractEmails(str): string[];
|
|
1610
1609
|
```
|
|
1611
1610
|
|
|
1612
|
-
Defined in: [utils/string.utils.ts:456](https://github.com/hichchidev/hichchi/blob/
|
|
1611
|
+
Defined in: [utils/string.utils.ts:456](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L456)
|
|
1613
1612
|
|
|
1614
1613
|
Extracts all email addresses from a string.
|
|
1615
1614
|
|
|
@@ -1659,134 +1658,13 @@ extractEmails("Contact us at support@example.com or sales@example.com");
|
|
|
1659
1658
|
|
|
1660
1659
|
---
|
|
1661
1660
|
|
|
1662
|
-
### extractSubdomain()
|
|
1663
|
-
|
|
1664
|
-
```ts
|
|
1665
|
-
function extractSubdomain(
|
|
1666
|
-
origin,
|
|
1667
|
-
splitDomain?,
|
|
1668
|
-
ifLocalhost?,
|
|
1669
|
-
): string | undefined;
|
|
1670
|
-
```
|
|
1671
|
-
|
|
1672
|
-
Defined in: [utils/url.utils.ts:153](https://github.com/hichchidev/hichchi/blob/4f0350925a950a3a9e81da44097f63463eade88d/libs/utils/src/utils/url.utils.ts#L153)
|
|
1673
|
-
|
|
1674
|
-
Extract a subdomain from an origin URL
|
|
1675
|
-
|
|
1676
|
-
This utility function parses an origin URL and extracts the subdomain portion.
|
|
1677
|
-
It works by splitting the origin string using a regular expression that matches
|
|
1678
|
-
protocol prefixes (http://, https://), dots, and the provided domain name.
|
|
1679
|
-
|
|
1680
|
-
The function handles special cases:
|
|
1681
|
-
|
|
1682
|
-
- If the origin hostname has no domain name (single-label host) or is an IP address, it returns the provided fallback value
|
|
1683
|
-
- If no subdomain is found or the origin is undefined, it returns undefined
|
|
1684
|
-
|
|
1685
|
-
This is particularly useful for multi-tenant applications where different
|
|
1686
|
-
subdomains represent different tenants or environments.
|
|
1687
|
-
|
|
1688
|
-
#### Parameters
|
|
1689
|
-
|
|
1690
|
-
<table>
|
|
1691
|
-
<thead>
|
|
1692
|
-
<tr>
|
|
1693
|
-
<th>Parameter</th>
|
|
1694
|
-
<th>Type</th>
|
|
1695
|
-
<th>Description</th>
|
|
1696
|
-
</tr>
|
|
1697
|
-
</thead>
|
|
1698
|
-
<tbody>
|
|
1699
|
-
<tr>
|
|
1700
|
-
<td>
|
|
1701
|
-
|
|
1702
|
-
`origin`
|
|
1703
|
-
|
|
1704
|
-
</td>
|
|
1705
|
-
<td>
|
|
1706
|
-
|
|
1707
|
-
`string`
|
|
1708
|
-
|
|
1709
|
-
</td>
|
|
1710
|
-
<td>
|
|
1711
|
-
|
|
1712
|
-
The origin URL to extract the subdomain from
|
|
1713
|
-
(e.g., "https://admin.example.com")
|
|
1714
|
-
|
|
1715
|
-
</td>
|
|
1716
|
-
</tr>
|
|
1717
|
-
<tr>
|
|
1718
|
-
<td>
|
|
1719
|
-
|
|
1720
|
-
`splitDomain?`
|
|
1721
|
-
|
|
1722
|
-
</td>
|
|
1723
|
-
<td>
|
|
1724
|
-
|
|
1725
|
-
`string`
|
|
1726
|
-
|
|
1727
|
-
</td>
|
|
1728
|
-
<td>
|
|
1729
|
-
|
|
1730
|
-
The main domain to use as a reference for extraction
|
|
1731
|
-
(e.g., "example.com")
|
|
1732
|
-
|
|
1733
|
-
</td>
|
|
1734
|
-
</tr>
|
|
1735
|
-
<tr>
|
|
1736
|
-
<td>
|
|
1737
|
-
|
|
1738
|
-
`ifLocalhost?`
|
|
1739
|
-
|
|
1740
|
-
</td>
|
|
1741
|
-
<td>
|
|
1742
|
-
|
|
1743
|
-
`string`
|
|
1744
|
-
|
|
1745
|
-
</td>
|
|
1746
|
-
<td>
|
|
1747
|
-
|
|
1748
|
-
Fallback value to return when the origin hostname
|
|
1749
|
-
has no domain name or is an IP address (e.g., "local" or "development")
|
|
1750
|
-
|
|
1751
|
-
</td>
|
|
1752
|
-
</tr>
|
|
1753
|
-
</tbody>
|
|
1754
|
-
</table>
|
|
1755
|
-
|
|
1756
|
-
#### Returns
|
|
1757
|
-
|
|
1758
|
-
`string` | `undefined`
|
|
1759
|
-
|
|
1760
|
-
The extracted subdomain if found, the ifLocalhost value
|
|
1761
|
-
for single-label/IP hostnames, or undefined if no subdomain exists
|
|
1762
|
-
or origin is undefined
|
|
1763
|
-
|
|
1764
|
-
#### Examples
|
|
1765
|
-
|
|
1766
|
-
```TypeScript
|
|
1767
|
-
extractSubdomain("example.com", "admin.example.com", "local")
|
|
1768
|
-
// Returns "admin"
|
|
1769
|
-
```
|
|
1770
|
-
|
|
1771
|
-
```TypeScript
|
|
1772
|
-
extractSubdomain("example.com", "localhost:3000", "local")
|
|
1773
|
-
// Returns "local"
|
|
1774
|
-
```
|
|
1775
|
-
|
|
1776
|
-
```TypeScript
|
|
1777
|
-
extractSubdomain("example.com", "example.com", "local")
|
|
1778
|
-
// Returns undefined (no subdomain)
|
|
1779
|
-
```
|
|
1780
|
-
|
|
1781
|
-
---
|
|
1782
|
-
|
|
1783
1661
|
### extractUrls()
|
|
1784
1662
|
|
|
1785
1663
|
```ts
|
|
1786
1664
|
function extractUrls(str): string[];
|
|
1787
1665
|
```
|
|
1788
1666
|
|
|
1789
|
-
Defined in: [utils/string.utils.ts:475](https://github.com/hichchidev/hichchi/blob/
|
|
1667
|
+
Defined in: [utils/string.utils.ts:475](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L475)
|
|
1790
1668
|
|
|
1791
1669
|
Extracts all URLs from a string.
|
|
1792
1670
|
|
|
@@ -1842,7 +1720,7 @@ extractUrls("Visit https://example.com or http://test.org/page?id=5");
|
|
|
1842
1720
|
function filterByObject<T>(items, filters): T[];
|
|
1843
1721
|
```
|
|
1844
1722
|
|
|
1845
|
-
Defined in: [utils/object.utils.ts:1082](https://github.com/hichchidev/hichchi/blob/
|
|
1723
|
+
Defined in: [utils/object.utils.ts:1082](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/object.utils.ts#L1082)
|
|
1846
1724
|
|
|
1847
1725
|
Filters items by recursively matching nested property values.
|
|
1848
1726
|
|
|
@@ -1918,7 +1796,7 @@ Implementation of the format function that handles both overloads.
|
|
|
1918
1796
|
function format(template, ...values): string;
|
|
1919
1797
|
```
|
|
1920
1798
|
|
|
1921
|
-
Defined in: [utils/string.utils.ts:1220](https://github.com/hichchidev/hichchi/blob/
|
|
1799
|
+
Defined in: [utils/string.utils.ts:1220](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L1220)
|
|
1922
1800
|
|
|
1923
1801
|
Formats a string by replacing indexed placeholders with provided values.
|
|
1924
1802
|
|
|
@@ -1994,7 +1872,7 @@ format("User {0} has {1} points", "John", 100);
|
|
|
1994
1872
|
function format(template, values): string;
|
|
1995
1873
|
```
|
|
1996
1874
|
|
|
1997
|
-
Defined in: [utils/string.utils.ts:1239](https://github.com/hichchidev/hichchi/blob/
|
|
1875
|
+
Defined in: [utils/string.utils.ts:1239](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L1239)
|
|
1998
1876
|
|
|
1999
1877
|
Formats a string by replacing named placeholders with values from an object.
|
|
2000
1878
|
|
|
@@ -2074,7 +1952,7 @@ format("Hello, {name}! You have {count} messages.", {
|
|
|
2074
1952
|
function getEnumValues<T>(e): T[keyof T][];
|
|
2075
1953
|
```
|
|
2076
1954
|
|
|
2077
|
-
Defined in: [utils/object.utils.ts:1070](https://github.com/hichchidev/hichchi/blob/
|
|
1955
|
+
Defined in: [utils/object.utils.ts:1070](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/object.utils.ts#L1070)
|
|
2078
1956
|
|
|
2079
1957
|
Extracts all values from a TypeScript enum, handling both string and numeric enum types correctly.
|
|
2080
1958
|
|
|
@@ -2243,7 +2121,7 @@ Object.values The underlying method used to extract enum entries
|
|
|
2243
2121
|
function getFileExt(mimeType, allowedMimeTypes?): string | undefined;
|
|
2244
2122
|
```
|
|
2245
2123
|
|
|
2246
|
-
Defined in: [utils/file.utils.ts:1265](https://github.com/hichchidev/hichchi/blob/
|
|
2124
|
+
Defined in: [utils/file.utils.ts:1265](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/file.utils.ts#L1265)
|
|
2247
2125
|
|
|
2248
2126
|
Get the file extension of the given mime type.
|
|
2249
2127
|
|
|
@@ -2327,7 +2205,7 @@ const extension = getFileExt('image/jpeg', customMimeTypes);
|
|
|
2327
2205
|
function getFileSize(size, round?): string;
|
|
2328
2206
|
```
|
|
2329
2207
|
|
|
2330
|
-
Defined in: [utils/file.utils.ts:1296](https://github.com/hichchidev/hichchi/blob/
|
|
2208
|
+
Defined in: [utils/file.utils.ts:1296](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/file.utils.ts#L1296)
|
|
2331
2209
|
|
|
2332
2210
|
Get file size in human-readable format.
|
|
2333
2211
|
|
|
@@ -2413,7 +2291,7 @@ const largeFileSize = getFileSize(1073741824);
|
|
|
2413
2291
|
function getMapKey(map, value): string | undefined;
|
|
2414
2292
|
```
|
|
2415
2293
|
|
|
2416
|
-
Defined in: [utils/object.utils.ts:53](https://github.com/hichchidev/hichchi/blob/
|
|
2294
|
+
Defined in: [utils/object.utils.ts:53](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/object.utils.ts#L53)
|
|
2417
2295
|
|
|
2418
2296
|
Get the key of a map by value.
|
|
2419
2297
|
|
|
@@ -2495,7 +2373,7 @@ const key = getMapKey(user, "value2");
|
|
|
2495
2373
|
function getMapKeys(map, partialValue): string[];
|
|
2496
2374
|
```
|
|
2497
2375
|
|
|
2498
|
-
Defined in: [utils/object.utils.ts:122](https://github.com/hichchidev/hichchi/blob/
|
|
2376
|
+
Defined in: [utils/object.utils.ts:122](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/object.utils.ts#L122)
|
|
2499
2377
|
|
|
2500
2378
|
Retrieves all keys from a Map where the corresponding values contain a specified substring.
|
|
2501
2379
|
|
|
@@ -2619,7 +2497,7 @@ const messageKeys = getMapKeys(translations, "message");
|
|
|
2619
2497
|
function getValueByPath<T>(obj, path): T | undefined;
|
|
2620
2498
|
```
|
|
2621
2499
|
|
|
2622
|
-
Defined in: [utils/object.utils.ts:379](https://github.com/hichchidev/hichchi/blob/
|
|
2500
|
+
Defined in: [utils/object.utils.ts:379](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/object.utils.ts#L379)
|
|
2623
2501
|
|
|
2624
2502
|
Gets a value from a nested object using a dot-notation path string.
|
|
2625
2503
|
|
|
@@ -2745,7 +2623,7 @@ const name = getValueByPath<string>(data, "users[1].name");
|
|
|
2745
2623
|
function groupBy<K, V>(list, keyGetter): Map<K, V[]>;
|
|
2746
2624
|
```
|
|
2747
2625
|
|
|
2748
|
-
Defined in: [utils/object.utils.ts:237](https://github.com/hichchidev/hichchi/blob/
|
|
2626
|
+
Defined in: [utils/object.utils.ts:237](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/object.utils.ts#L237)
|
|
2749
2627
|
|
|
2750
2628
|
Groups an array of objects into a Map based on a key extraction function.
|
|
2751
2629
|
|
|
@@ -2944,7 +2822,7 @@ const tasksByStatus = groupBy(tasks, (task) => task.completed);
|
|
|
2944
2822
|
function hashString(str): Promise<string>;
|
|
2945
2823
|
```
|
|
2946
2824
|
|
|
2947
|
-
Defined in: [utils/string.utils.ts:499](https://github.com/hichchidev/hichchi/blob/
|
|
2825
|
+
Defined in: [utils/string.utils.ts:499](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L499)
|
|
2948
2826
|
|
|
2949
2827
|
Converts a string to a secure hash using SHA-256.
|
|
2950
2828
|
|
|
@@ -3004,7 +2882,7 @@ await hashString("password123");
|
|
|
3004
2882
|
function hasOwnAll(obj, props): boolean;
|
|
3005
2883
|
```
|
|
3006
2884
|
|
|
3007
|
-
Defined in: [utils/object.utils.ts:965](https://github.com/hichchidev/hichchi/blob/
|
|
2885
|
+
Defined in: [utils/object.utils.ts:965](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/object.utils.ts#L965)
|
|
3008
2886
|
|
|
3009
2887
|
Checks if an object has all specified properties as its own properties (not inherited).
|
|
3010
2888
|
|
|
@@ -3173,7 +3051,7 @@ Object.hasOwn The underlying method used for property checking
|
|
|
3173
3051
|
function htmlToText(str): string;
|
|
3174
3052
|
```
|
|
3175
3053
|
|
|
3176
|
-
Defined in: [utils/string.utils.ts:1001](https://github.com/hichchidev/hichchi/blob/
|
|
3054
|
+
Defined in: [utils/string.utils.ts:1001](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L1001)
|
|
3177
3055
|
|
|
3178
3056
|
Remove HTML tags from a string and return plain text.
|
|
3179
3057
|
|
|
@@ -3228,7 +3106,7 @@ htmlToText("<h1>Hello World</h1>"); // "Hello World"
|
|
|
3228
3106
|
function isAlphanumeric(str): boolean;
|
|
3229
3107
|
```
|
|
3230
3108
|
|
|
3231
|
-
Defined in: [utils/string.utils.ts:1325](https://github.com/hichchidev/hichchi/blob/
|
|
3109
|
+
Defined in: [utils/string.utils.ts:1325](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L1325)
|
|
3232
3110
|
|
|
3233
3111
|
Checks if a string contains only alphanumeric characters.
|
|
3234
3112
|
|
|
@@ -3284,7 +3162,7 @@ isAlphanumeric("abc-123"); // false
|
|
|
3284
3162
|
function isArray<T>(value): value is T[];
|
|
3285
3163
|
```
|
|
3286
3164
|
|
|
3287
|
-
Defined in: [utils/assertions.utils.ts:42](https://github.com/hichchidev/hichchi/blob/
|
|
3165
|
+
Defined in: [utils/assertions.utils.ts:42](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/assertions.utils.ts#L42)
|
|
3288
3166
|
|
|
3289
3167
|
Type-safe utility to check if a value is an array of a specific type.
|
|
3290
3168
|
|
|
@@ -3393,7 +3271,7 @@ async function createUser(
|
|
|
3393
3271
|
function isObject<T>(value?): value is T;
|
|
3394
3272
|
```
|
|
3395
3273
|
|
|
3396
|
-
Defined in: [utils/assertions.utils.ts:91](https://github.com/hichchidev/hichchi/blob/
|
|
3274
|
+
Defined in: [utils/assertions.utils.ts:91](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/assertions.utils.ts#L91)
|
|
3397
3275
|
|
|
3398
3276
|
Type-safe utility to check if a value is a non-array object of a specific type.
|
|
3399
3277
|
|
|
@@ -3510,7 +3388,7 @@ function formatUserName(user?: User | string): string {
|
|
|
3510
3388
|
function isObjectWith<T>(value, propertyName): value is T;
|
|
3511
3389
|
```
|
|
3512
3390
|
|
|
3513
|
-
Defined in: [utils/assertions.utils.ts:158](https://github.com/hichchidev/hichchi/blob/
|
|
3391
|
+
Defined in: [utils/assertions.utils.ts:158](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/assertions.utils.ts#L158)
|
|
3514
3392
|
|
|
3515
3393
|
Type-safe utility to check if a value is an object with a specific property.
|
|
3516
3394
|
|
|
@@ -3658,7 +3536,7 @@ async function handleResponse(response: unknown): Promise<void> {
|
|
|
3658
3536
|
function isValidRedirectUrl(url, allowedDomains): boolean;
|
|
3659
3537
|
```
|
|
3660
3538
|
|
|
3661
|
-
Defined in: [utils/url.utils.ts:100](https://github.com/hichchidev/hichchi/blob/
|
|
3539
|
+
Defined in: [utils/url.utils.ts:100](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/url.utils.ts#L100)
|
|
3662
3540
|
|
|
3663
3541
|
Validates if a redirect URL is allowed based on a whitelist of permitted domains.
|
|
3664
3542
|
|
|
@@ -3825,7 +3703,7 @@ This function catches all URL parsing errors and returns false instead of throwi
|
|
|
3825
3703
|
function maskString(str, visibleStart?, visibleEnd?, maskChar?): string;
|
|
3826
3704
|
```
|
|
3827
3705
|
|
|
3828
|
-
Defined in: [utils/string.utils.ts:584](https://github.com/hichchidev/hichchi/blob/
|
|
3706
|
+
Defined in: [utils/string.utils.ts:584](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L584)
|
|
3829
3707
|
|
|
3830
3708
|
Masks a portion of a string, useful for displaying sensitive information.
|
|
3831
3709
|
|
|
@@ -3962,7 +3840,7 @@ maskString("+1-555-123-4567", 0, 4);
|
|
|
3962
3840
|
function normalizeString(str): string;
|
|
3963
3841
|
```
|
|
3964
3842
|
|
|
3965
|
-
Defined in: [utils/string.utils.ts:767](https://github.com/hichchidev/hichchi/blob/
|
|
3843
|
+
Defined in: [utils/string.utils.ts:767](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L767)
|
|
3966
3844
|
|
|
3967
3845
|
Normalizes a string by removing accents, diacritics, and converting to lowercase.
|
|
3968
3846
|
|
|
@@ -4020,7 +3898,7 @@ normalizeString("ESPAÑA"); // "espana"
|
|
|
4020
3898
|
function objectToDottedPathValueObject(obj): DottedPathValueObject;
|
|
4021
3899
|
```
|
|
4022
3900
|
|
|
4023
|
-
Defined in: [utils/object.utils.ts:460](https://github.com/hichchidev/hichchi/blob/
|
|
3901
|
+
Defined in: [utils/object.utils.ts:460](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/object.utils.ts#L460)
|
|
4024
3902
|
|
|
4025
3903
|
Converts a nested object into a flattened DottedPathValueObject representation.
|
|
4026
3904
|
|
|
@@ -4119,7 +3997,7 @@ const flattened = objectToDottedPathValueObject(user);
|
|
|
4119
3997
|
function omit<T>(obj, keys?): Partial<T>;
|
|
4120
3998
|
```
|
|
4121
3999
|
|
|
4122
|
-
Defined in: [utils/object.utils.ts:683](https://github.com/hichchidev/hichchi/blob/
|
|
4000
|
+
Defined in: [utils/object.utils.ts:683](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/object.utils.ts#L683)
|
|
4123
4001
|
|
|
4124
4002
|
Creates a new object by omitting specified properties and undefined values from the original object.
|
|
4125
4003
|
|
|
@@ -4299,7 +4177,7 @@ const publicProfile = omit(userProfile, ["password", "internalNotes"]);
|
|
|
4299
4177
|
function padString(str, length, char?, padEnd?): string;
|
|
4300
4178
|
```
|
|
4301
4179
|
|
|
4302
|
-
Defined in: [utils/string.utils.ts:1111](https://github.com/hichchidev/hichchi/blob/
|
|
4180
|
+
Defined in: [utils/string.utils.ts:1111](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L1111)
|
|
4303
4181
|
|
|
4304
4182
|
Pads a string to a specified length with a specified character.
|
|
4305
4183
|
|
|
@@ -4428,7 +4306,7 @@ padString("Hello", 10, "0", false); // "00000Hello"
|
|
|
4428
4306
|
function plural(str): string;
|
|
4429
4307
|
```
|
|
4430
4308
|
|
|
4431
|
-
Defined in: [utils/string.utils.ts:1049](https://github.com/hichchidev/hichchi/blob/
|
|
4309
|
+
Defined in: [utils/string.utils.ts:1049](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L1049)
|
|
4432
4310
|
|
|
4433
4311
|
Converts a singular English word to its plural form.
|
|
4434
4312
|
|
|
@@ -4517,7 +4395,7 @@ plural("analysis"); // "analyses"
|
|
|
4517
4395
|
function prune<T>(obj, omitPrototype?): T;
|
|
4518
4396
|
```
|
|
4519
4397
|
|
|
4520
|
-
Defined in: [utils/object.utils.ts:838](https://github.com/hichchidev/hichchi/blob/
|
|
4398
|
+
Defined in: [utils/object.utils.ts:838](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/object.utils.ts#L838)
|
|
4521
4399
|
|
|
4522
4400
|
Creates a deep copy of an object with all empty, null, undefined, and optionally prototype properties removed.
|
|
4523
4401
|
|
|
@@ -4748,7 +4626,7 @@ const prunedOwnOnly = prune(user, true);
|
|
|
4748
4626
|
function randomString(length, charset?): string;
|
|
4749
4627
|
```
|
|
4750
4628
|
|
|
4751
|
-
Defined in: [utils/string.utils.ts:536](https://github.com/hichchidev/hichchi/blob/
|
|
4629
|
+
Defined in: [utils/string.utils.ts:536](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L536)
|
|
4752
4630
|
|
|
4753
4631
|
Generates a random string with specified length and character set.
|
|
4754
4632
|
|
|
@@ -4830,7 +4708,7 @@ randomString(4, "0123456789");
|
|
|
4830
4708
|
function removeWhitespace(str): string;
|
|
4831
4709
|
```
|
|
4832
4710
|
|
|
4833
|
-
Defined in: [utils/string.utils.ts:1342](https://github.com/hichchidev/hichchi/blob/
|
|
4711
|
+
Defined in: [utils/string.utils.ts:1342](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L1342)
|
|
4834
4712
|
|
|
4835
4713
|
Removes all whitespace from a string.
|
|
4836
4714
|
|
|
@@ -4886,7 +4764,7 @@ removeWhitespace(" spaces tabs "); // "spacestabs"
|
|
|
4886
4764
|
function reverse(str): string;
|
|
4887
4765
|
```
|
|
4888
4766
|
|
|
4889
|
-
Defined in: [utils/string.utils.ts:1308](https://github.com/hichchidev/hichchi/blob/
|
|
4767
|
+
Defined in: [utils/string.utils.ts:1308](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L1308)
|
|
4890
4768
|
|
|
4891
4769
|
Reverses a string.
|
|
4892
4770
|
|
|
@@ -4942,7 +4820,7 @@ reverse("12345"); // "54321"
|
|
|
4942
4820
|
function searchMapValues(map, partialValue): string[];
|
|
4943
4821
|
```
|
|
4944
4822
|
|
|
4945
|
-
Defined in: [utils/object.utils.ts:327](https://github.com/hichchidev/hichchi/blob/
|
|
4823
|
+
Defined in: [utils/object.utils.ts:327](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/object.utils.ts#L327)
|
|
4946
4824
|
|
|
4947
4825
|
Retrieves all values from a Map that contain a specified substring.
|
|
4948
4826
|
|
|
@@ -5079,7 +4957,7 @@ const productionValues = searchMapValues(config, "production");
|
|
|
5079
4957
|
function singular(str): string;
|
|
5080
4958
|
```
|
|
5081
4959
|
|
|
5082
|
-
Defined in: [utils/string.utils.ts:1387](https://github.com/hichchidev/hichchi/blob/
|
|
4960
|
+
Defined in: [utils/string.utils.ts:1387](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L1387)
|
|
5083
4961
|
|
|
5084
4962
|
Converts plural English words to their singular form.
|
|
5085
4963
|
|
|
@@ -5164,7 +5042,7 @@ singular("phenomena"); // "phenomenon"
|
|
|
5164
5042
|
function slugify(str, separator?): string;
|
|
5165
5043
|
```
|
|
5166
5044
|
|
|
5167
|
-
Defined in: [utils/string.utils.ts:430](https://github.com/hichchidev/hichchi/blob/
|
|
5045
|
+
Defined in: [utils/string.utils.ts:430](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L430)
|
|
5168
5046
|
|
|
5169
5047
|
Generates a slug from a string, suitable for URLs or file names.
|
|
5170
5048
|
|
|
@@ -5251,7 +5129,7 @@ slugify("Blog Post", "_"); // "blog_post"
|
|
|
5251
5129
|
function stringSimilarity(str1, str2): number;
|
|
5252
5130
|
```
|
|
5253
5131
|
|
|
5254
|
-
Defined in: [utils/string.utils.ts:380](https://github.com/hichchidev/hichchi/blob/
|
|
5132
|
+
Defined in: [utils/string.utils.ts:380](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L380)
|
|
5255
5133
|
|
|
5256
5134
|
Compares two strings for similarity using Levenshtein distance algorithm.
|
|
5257
5135
|
|
|
@@ -5329,7 +5207,7 @@ stringSimilarity("same", "same"); // 1.0 (identical)
|
|
|
5329
5207
|
function toCamelCase(str?): string;
|
|
5330
5208
|
```
|
|
5331
5209
|
|
|
5332
|
-
Defined in: [utils/string.utils.ts:870](https://github.com/hichchidev/hichchi/blob/
|
|
5210
|
+
Defined in: [utils/string.utils.ts:870](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L870)
|
|
5333
5211
|
|
|
5334
5212
|
Convert a string to camel case.
|
|
5335
5213
|
|
|
@@ -5384,7 +5262,7 @@ toCamelCase("hello world"); // "helloWorld"
|
|
|
5384
5262
|
function toFirstCase(str?): string;
|
|
5385
5263
|
```
|
|
5386
5264
|
|
|
5387
|
-
Defined in: [utils/string.utils.ts:612](https://github.com/hichchidev/hichchi/blob/
|
|
5265
|
+
Defined in: [utils/string.utils.ts:612](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L612)
|
|
5388
5266
|
|
|
5389
5267
|
Convert a string to first case (Capitalize first letter of the string).
|
|
5390
5268
|
|
|
@@ -5439,7 +5317,7 @@ toFirstCase("hello world"); // "Hello world"
|
|
|
5439
5317
|
function toFirstCaseBreak(str?, join?): string;
|
|
5440
5318
|
```
|
|
5441
5319
|
|
|
5442
|
-
Defined in: [utils/string.utils.ts:832](https://github.com/hichchidev/hichchi/blob/
|
|
5320
|
+
Defined in: [utils/string.utils.ts:832](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L832)
|
|
5443
5321
|
|
|
5444
5322
|
Converts a string to Sentence case (first word capitalized, rest lowercase) with customizable word separators.
|
|
5445
5323
|
|
|
@@ -5533,7 +5411,7 @@ toFirstCaseBreak("GET_USER_DATA", "/"); // "Get/user/data"
|
|
|
5533
5411
|
function toKebabCase(str?, caps?): string;
|
|
5534
5412
|
```
|
|
5535
5413
|
|
|
5536
|
-
Defined in: [utils/string.utils.ts:969](https://github.com/hichchidev/hichchi/blob/
|
|
5414
|
+
Defined in: [utils/string.utils.ts:969](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L969)
|
|
5537
5415
|
|
|
5538
5416
|
Convert a string to kebab case.
|
|
5539
5417
|
|
|
@@ -5609,7 +5487,7 @@ toKebabCase("hello world", true); // "HELLO-WORLD"
|
|
|
5609
5487
|
function toLowerCase(str?): string;
|
|
5610
5488
|
```
|
|
5611
5489
|
|
|
5612
|
-
Defined in: [utils/string.utils.ts:163](https://github.com/hichchidev/hichchi/blob/
|
|
5490
|
+
Defined in: [utils/string.utils.ts:163](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L163)
|
|
5613
5491
|
|
|
5614
5492
|
Converts a string to lowercase with safe handling of undefined or null values.
|
|
5615
5493
|
|
|
@@ -5724,7 +5602,7 @@ function validateEmail(email?: string): boolean {
|
|
|
5724
5602
|
function toLowerCaseBreak(str?, join?): string;
|
|
5725
5603
|
```
|
|
5726
5604
|
|
|
5727
|
-
Defined in: [utils/string.utils.ts:262](https://github.com/hichchidev/hichchi/blob/
|
|
5605
|
+
Defined in: [utils/string.utils.ts:262](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L262)
|
|
5728
5606
|
|
|
5729
5607
|
Converts a string to lowercase and breaks it into words, joining them with a specified separator.
|
|
5730
5608
|
|
|
@@ -5875,7 +5753,7 @@ const result3 = toLowerCaseBreak("singleword");
|
|
|
5875
5753
|
function toNumber(str): number | undefined;
|
|
5876
5754
|
```
|
|
5877
5755
|
|
|
5878
|
-
Defined in: [utils/string.utils.ts:987](https://github.com/hichchidev/hichchi/blob/
|
|
5756
|
+
Defined in: [utils/string.utils.ts:987](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L987)
|
|
5879
5757
|
|
|
5880
5758
|
Converts a string to a number.
|
|
5881
5759
|
|
|
@@ -5930,7 +5808,7 @@ toNumber("123"); // 123
|
|
|
5930
5808
|
function toPascalCase(str?): string;
|
|
5931
5809
|
```
|
|
5932
5810
|
|
|
5933
|
-
Defined in: [utils/string.utils.ts:889](https://github.com/hichchidev/hichchi/blob/
|
|
5811
|
+
Defined in: [utils/string.utils.ts:889](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L889)
|
|
5934
5812
|
|
|
5935
5813
|
Convert a string to pascal case.
|
|
5936
5814
|
|
|
@@ -5985,7 +5863,7 @@ toPascalCase("hello world"); // "HelloWorld"
|
|
|
5985
5863
|
function toProperTitleCase(str): string;
|
|
5986
5864
|
```
|
|
5987
5865
|
|
|
5988
|
-
Defined in: [utils/string.utils.ts:1159](https://github.com/hichchidev/hichchi/blob/
|
|
5866
|
+
Defined in: [utils/string.utils.ts:1159](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L1159)
|
|
5989
5867
|
|
|
5990
5868
|
Capitalizes each word in a string according to title case rules.
|
|
5991
5869
|
|
|
@@ -6051,7 +5929,7 @@ toProperTitleCase("a tale of two cities");
|
|
|
6051
5929
|
function toSentenceCase(str?): string;
|
|
6052
5930
|
```
|
|
6053
5931
|
|
|
6054
|
-
Defined in: [utils/string.utils.ts:908](https://github.com/hichchidev/hichchi/blob/
|
|
5932
|
+
Defined in: [utils/string.utils.ts:908](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L908)
|
|
6055
5933
|
|
|
6056
5934
|
Convert a string to sentence case. (Capitalize first letter of every sentence).
|
|
6057
5935
|
|
|
@@ -6106,7 +5984,7 @@ toSentenceCase("hello world. how are you?"); // "Hello world. How are you?"
|
|
|
6106
5984
|
function toSnakeCase(str?, caps?): string;
|
|
6107
5985
|
```
|
|
6108
5986
|
|
|
6109
|
-
Defined in: [utils/string.utils.ts:945](https://github.com/hichchidev/hichchi/blob/
|
|
5987
|
+
Defined in: [utils/string.utils.ts:945](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L945)
|
|
6110
5988
|
|
|
6111
5989
|
Converts a string to snake_case format.
|
|
6112
5990
|
|
|
@@ -6197,7 +6075,7 @@ then joins them with underscores, applying the requested case transformation.
|
|
|
6197
6075
|
function toTitleCase(str?): string;
|
|
6198
6076
|
```
|
|
6199
6077
|
|
|
6200
|
-
Defined in: [utils/string.utils.ts:851](https://github.com/hichchidev/hichchi/blob/
|
|
6078
|
+
Defined in: [utils/string.utils.ts:851](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L851)
|
|
6201
6079
|
|
|
6202
6080
|
Convert a string to title case (Capitalize first letter of each word).
|
|
6203
6081
|
|
|
@@ -6252,7 +6130,7 @@ toTitleCase("hello world"); // "Hello World"
|
|
|
6252
6130
|
function toUpperCase(str?): string;
|
|
6253
6131
|
```
|
|
6254
6132
|
|
|
6255
|
-
Defined in: [utils/string.utils.ts:355](https://github.com/hichchidev/hichchi/blob/
|
|
6133
|
+
Defined in: [utils/string.utils.ts:355](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L355)
|
|
6256
6134
|
|
|
6257
6135
|
Converts a string to uppercase with safe handling of undefined or null values.
|
|
6258
6136
|
|
|
@@ -6379,7 +6257,7 @@ compareIgnoreCase("Test", "test"); // true
|
|
|
6379
6257
|
function toUpperCaseBreak(str?, join?): string;
|
|
6380
6258
|
```
|
|
6381
6259
|
|
|
6382
|
-
Defined in: [utils/string.utils.ts:791](https://github.com/hichchidev/hichchi/blob/
|
|
6260
|
+
Defined in: [utils/string.utils.ts:791](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L791)
|
|
6383
6261
|
|
|
6384
6262
|
Convert a string to upper cases and break into words with optional join or space.
|
|
6385
6263
|
|
|
@@ -6454,7 +6332,7 @@ toUpperCaseBreak("HelloWorld", "! "); // "HELLO! WORLD"
|
|
|
6454
6332
|
function toVariableName(str, pascalCase?): string;
|
|
6455
6333
|
````
|
|
6456
6334
|
|
|
6457
|
-
Defined in: [utils/string.utils.ts:634](https://github.com/hichchidev/hichchi/blob/
|
|
6335
|
+
Defined in: [utils/string.utils.ts:634](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L634)
|
|
6458
6336
|
|
|
6459
6337
|
Converts a string to a camelCase or PascalCase variable name.
|
|
6460
6338
|
|
|
@@ -6540,7 +6418,7 @@ toVariableName("user_id", true); // "UserId"
|
|
|
6540
6418
|
function truncate(str, length, ellipsis?): string;
|
|
6541
6419
|
```
|
|
6542
6420
|
|
|
6543
|
-
Defined in: [utils/string.utils.ts:1089](https://github.com/hichchidev/hichchi/blob/
|
|
6421
|
+
Defined in: [utils/string.utils.ts:1089](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L1089)
|
|
6544
6422
|
|
|
6545
6423
|
Truncates a string to a specified length and adds an ellipsis if needed.
|
|
6546
6424
|
|
|
@@ -6647,7 +6525,7 @@ truncate("Custom ellipsis", 6, " [more]"); // "Custom [more]"
|
|
|
6647
6525
|
function wordWrap(str, lineLength?, breakChar?): string;
|
|
6648
6526
|
```
|
|
6649
6527
|
|
|
6650
|
-
Defined in: [utils/string.utils.ts:672](https://github.com/hichchidev/hichchi/blob/
|
|
6528
|
+
Defined in: [utils/string.utils.ts:672](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/string.utils.ts#L672)
|
|
6651
6529
|
|
|
6652
6530
|
Wraps words in a string to ensure each line is no longer than a specified length.
|
|
6653
6531
|
|
|
@@ -6755,7 +6633,7 @@ wordWrap(text, 30, "<br>");
|
|
|
6755
6633
|
|
|
6756
6634
|
### DottedPathValueObject
|
|
6757
6635
|
|
|
6758
|
-
Defined in: [interfaces/path-value-set.interface.ts:77](https://github.com/hichchidev/hichchi/blob/
|
|
6636
|
+
Defined in: [interfaces/path-value-set.interface.ts:77](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/interfaces/path-value-set.interface.ts#L77)
|
|
6759
6637
|
|
|
6760
6638
|
Represents a flattened object where keys are dot-notation paths and values are primitive types.
|
|
6761
6639
|
|
|
@@ -6849,7 +6727,7 @@ userPathValues["profile.address.city"] = "Boston";
|
|
|
6849
6727
|
|
|
6850
6728
|
### InfiniteObject
|
|
6851
6729
|
|
|
6852
|
-
Defined in: [interfaces/infinite-object.interface.ts:43](https://github.com/hichchidev/hichchi/blob/
|
|
6730
|
+
Defined in: [interfaces/infinite-object.interface.ts:43](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/interfaces/infinite-object.interface.ts#L43)
|
|
6853
6731
|
|
|
6854
6732
|
Represents an object with infinite nesting capability (recursive object type).
|
|
6855
6733
|
|
|
@@ -6907,7 +6785,7 @@ const nestedObj: InfiniteObject = {
|
|
|
6907
6785
|
|
|
6908
6786
|
### InflectionRule
|
|
6909
6787
|
|
|
6910
|
-
Defined in: [interfaces/inflection-rule.interfaces.ts:30](https://github.com/hichchidev/hichchi/blob/
|
|
6788
|
+
Defined in: [interfaces/inflection-rule.interfaces.ts:30](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/interfaces/inflection-rule.interfaces.ts#L30)
|
|
6911
6789
|
|
|
6912
6790
|
Rule type for word inflection transformation
|
|
6913
6791
|
|
|
@@ -6971,7 +6849,7 @@ Regular expression pattern to match words this rule applies to
|
|
|
6971
6849
|
</td>
|
|
6972
6850
|
<td>
|
|
6973
6851
|
|
|
6974
|
-
[interfaces/inflection-rule.interfaces.ts:34](https://github.com/hichchidev/hichchi/blob/
|
|
6852
|
+
[interfaces/inflection-rule.interfaces.ts:34](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/interfaces/inflection-rule.interfaces.ts#L34)
|
|
6975
6853
|
|
|
6976
6854
|
</td>
|
|
6977
6855
|
</tr>
|
|
@@ -6993,7 +6871,7 @@ Replacement string with capture group references or function to transform the ma
|
|
|
6993
6871
|
</td>
|
|
6994
6872
|
<td>
|
|
6995
6873
|
|
|
6996
|
-
[interfaces/inflection-rule.interfaces.ts:39](https://github.com/hichchidev/hichchi/blob/
|
|
6874
|
+
[interfaces/inflection-rule.interfaces.ts:39](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/interfaces/inflection-rule.interfaces.ts#L39)
|
|
6997
6875
|
|
|
6998
6876
|
</td>
|
|
6999
6877
|
</tr>
|
|
@@ -7004,7 +6882,7 @@ Replacement string with capture group references or function to transform the ma
|
|
|
7004
6882
|
|
|
7005
6883
|
### InflectionRuleCategories
|
|
7006
6884
|
|
|
7007
|
-
Defined in: [interfaces/inflection-rule.interfaces.ts:125](https://github.com/hichchidev/hichchi/blob/
|
|
6885
|
+
Defined in: [interfaces/inflection-rule.interfaces.ts:125](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/interfaces/inflection-rule.interfaces.ts#L125)
|
|
7008
6886
|
|
|
7009
6887
|
Categories of English inflection rules
|
|
7010
6888
|
|
|
@@ -7081,7 +6959,7 @@ Default rules for standard transformations
|
|
|
7081
6959
|
</td>
|
|
7082
6960
|
<td>
|
|
7083
6961
|
|
|
7084
|
-
[interfaces/inflection-rule.interfaces.ts:149](https://github.com/hichchidev/hichchi/blob/
|
|
6962
|
+
[interfaces/inflection-rule.interfaces.ts:149](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/interfaces/inflection-rule.interfaces.ts#L149)
|
|
7085
6963
|
|
|
7086
6964
|
</td>
|
|
7087
6965
|
</tr>
|
|
@@ -7103,7 +6981,7 @@ Words that are the same in singular and plural form
|
|
|
7103
6981
|
</td>
|
|
7104
6982
|
<td>
|
|
7105
6983
|
|
|
7106
|
-
[interfaces/inflection-rule.interfaces.ts:129](https://github.com/hichchidev/hichchi/blob/
|
|
6984
|
+
[interfaces/inflection-rule.interfaces.ts:129](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/interfaces/inflection-rule.interfaces.ts#L129)
|
|
7107
6985
|
|
|
7108
6986
|
</td>
|
|
7109
6987
|
</tr>
|
|
@@ -7125,7 +7003,7 @@ Words with irregular plural forms
|
|
|
7125
7003
|
</td>
|
|
7126
7004
|
<td>
|
|
7127
7005
|
|
|
7128
|
-
[interfaces/inflection-rule.interfaces.ts:134](https://github.com/hichchidev/hichchi/blob/
|
|
7006
|
+
[interfaces/inflection-rule.interfaces.ts:134](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/interfaces/inflection-rule.interfaces.ts#L134)
|
|
7129
7007
|
|
|
7130
7008
|
</td>
|
|
7131
7009
|
</tr>
|
|
@@ -7147,7 +7025,7 @@ Words borrowed from Latin and Greek
|
|
|
7147
7025
|
</td>
|
|
7148
7026
|
<td>
|
|
7149
7027
|
|
|
7150
|
-
[interfaces/inflection-rule.interfaces.ts:139](https://github.com/hichchidev/hichchi/blob/
|
|
7028
|
+
[interfaces/inflection-rule.interfaces.ts:139](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/interfaces/inflection-rule.interfaces.ts#L139)
|
|
7151
7029
|
|
|
7152
7030
|
</td>
|
|
7153
7031
|
</tr>
|
|
@@ -7169,7 +7047,7 @@ Words with specific ending patterns
|
|
|
7169
7047
|
</td>
|
|
7170
7048
|
<td>
|
|
7171
7049
|
|
|
7172
|
-
[interfaces/inflection-rule.interfaces.ts:144](https://github.com/hichchidev/hichchi/blob/
|
|
7050
|
+
[interfaces/inflection-rule.interfaces.ts:144](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/interfaces/inflection-rule.interfaces.ts#L144)
|
|
7173
7051
|
|
|
7174
7052
|
</td>
|
|
7175
7053
|
</tr>
|
|
@@ -7180,7 +7058,7 @@ Words with specific ending patterns
|
|
|
7180
7058
|
|
|
7181
7059
|
### LiteralObject
|
|
7182
7060
|
|
|
7183
|
-
Defined in: [types/literal-object.type.ts:48](https://github.com/hichchidev/hichchi/blob/
|
|
7061
|
+
Defined in: [types/literal-object.type.ts:48](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/types/literal-object.type.ts#L48)
|
|
7184
7062
|
|
|
7185
7063
|
Generic interface for objects with string keys and values of a specified type.
|
|
7186
7064
|
|
|
@@ -7271,7 +7149,7 @@ The type of values in the object (defaults to `any`)
|
|
|
7271
7149
|
|
|
7272
7150
|
### PluralSingularRulePair
|
|
7273
7151
|
|
|
7274
|
-
Defined in: [interfaces/inflection-rule.interfaces.ts:70](https://github.com/hichchidev/hichchi/blob/
|
|
7152
|
+
Defined in: [interfaces/inflection-rule.interfaces.ts:70](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/interfaces/inflection-rule.interfaces.ts#L70)
|
|
7275
7153
|
|
|
7276
7154
|
Pair of rule sets for bidirectional singular/plural transformations
|
|
7277
7155
|
|
|
@@ -7334,7 +7212,7 @@ Array of rules for converting singular words to plural form
|
|
|
7334
7212
|
</td>
|
|
7335
7213
|
<td>
|
|
7336
7214
|
|
|
7337
|
-
[interfaces/inflection-rule.interfaces.ts:74](https://github.com/hichchidev/hichchi/blob/
|
|
7215
|
+
[interfaces/inflection-rule.interfaces.ts:74](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/interfaces/inflection-rule.interfaces.ts#L74)
|
|
7338
7216
|
|
|
7339
7217
|
</td>
|
|
7340
7218
|
</tr>
|
|
@@ -7356,7 +7234,7 @@ Array of rules for converting plural words to singular form
|
|
|
7356
7234
|
</td>
|
|
7357
7235
|
<td>
|
|
7358
7236
|
|
|
7359
|
-
[interfaces/inflection-rule.interfaces.ts:79](https://github.com/hichchidev/hichchi/blob/
|
|
7237
|
+
[interfaces/inflection-rule.interfaces.ts:79](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/interfaces/inflection-rule.interfaces.ts#L79)
|
|
7360
7238
|
|
|
7361
7239
|
</td>
|
|
7362
7240
|
</tr>
|
|
@@ -7373,7 +7251,7 @@ type DeepPartial<T> =
|
|
|
7373
7251
|
| T extends infer U[] ? DeepPartial<U>[] : T extends Map<infer K, infer V> ? Map<DeepPartial<K>, DeepPartial<V>> : T extends Set<infer M> ? Set<DeepPartial<M>> : T extends object ? { [K in keyof T]?: DeepPartial<T[K]> } : T;
|
|
7374
7252
|
```
|
|
7375
7253
|
|
|
7376
|
-
Defined in: [types/deep-partial.type.ts:46](https://github.com/hichchidev/hichchi/blob/
|
|
7254
|
+
Defined in: [types/deep-partial.type.ts:46](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/types/deep-partial.type.ts#L46)
|
|
7377
7255
|
|
|
7378
7256
|
A utility type that recursively makes all properties of an object optional.
|
|
7379
7257
|
|
|
@@ -7458,7 +7336,7 @@ type IsAlreadyInPath<T, U> = U extends object
|
|
|
7458
7336
|
: false;
|
|
7459
7337
|
```
|
|
7460
7338
|
|
|
7461
|
-
Defined in: [types/is-already-in-path.type.ts:25](https://github.com/hichchidev/hichchi/blob/
|
|
7339
|
+
Defined in: [types/is-already-in-path.type.ts:25](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/types/is-already-in-path.type.ts#L25)
|
|
7462
7340
|
|
|
7463
7341
|
Type predicate that detects circular references in type paths.
|
|
7464
7342
|
|
|
@@ -7525,7 +7403,7 @@ type RecursivelyProcess<T, Path = never> =
|
|
|
7525
7403
|
type IsEmpty<T> = keyof T extends never ? true : false;
|
|
7526
7404
|
```
|
|
7527
7405
|
|
|
7528
|
-
Defined in: [types/is-empty.type.ts:26](https://github.com/hichchidev/hichchi/blob/
|
|
7406
|
+
Defined in: [types/is-empty.type.ts:26](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/types/is-empty.type.ts#L26)
|
|
7529
7407
|
|
|
7530
7408
|
Type predicate that determines if a type is an empty object type.
|
|
7531
7409
|
|
|
@@ -7583,7 +7461,7 @@ type ProcessedNonEmpty = ProcessObject<{ name: string }>; // { name: string }
|
|
|
7583
7461
|
type IsPrimitive<T> = T extends Primitive ? true : false;
|
|
7584
7462
|
```
|
|
7585
7463
|
|
|
7586
|
-
Defined in: [types/is-primitive.type.ts:31](https://github.com/hichchidev/hichchi/blob/
|
|
7464
|
+
Defined in: [types/is-primitive.type.ts:31](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/types/is-primitive.type.ts#L31)
|
|
7587
7465
|
|
|
7588
7466
|
Type predicate that determines if a type is a primitive JavaScript value.
|
|
7589
7467
|
|
|
@@ -7641,7 +7519,7 @@ type SerializedObject = SerializeValue<{ foo: string }>; // string
|
|
|
7641
7519
|
type LooseAutocomplete<T> = T | Omit<string, T>;
|
|
7642
7520
|
```
|
|
7643
7521
|
|
|
7644
|
-
Defined in: [types/loose-autocomplete.type.ts:32](https://github.com/hichchidev/hichchi/blob/
|
|
7522
|
+
Defined in: [types/loose-autocomplete.type.ts:32](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/types/loose-autocomplete.type.ts#L32)
|
|
7645
7523
|
|
|
7646
7524
|
Represents a type for autocompleting string values.
|
|
7647
7525
|
|
|
@@ -7707,7 +7585,7 @@ Matt Pocock (https://www.totaltypescript.com/tips/create-autocomplete-helper-whi
|
|
|
7707
7585
|
type NonNullPrimitive = string | number | boolean | symbol | bigint;
|
|
7708
7586
|
```
|
|
7709
7587
|
|
|
7710
|
-
Defined in: [types/is-primitive.type.ts:5](https://github.com/hichchidev/hichchi/blob/
|
|
7588
|
+
Defined in: [types/is-primitive.type.ts:5](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/types/is-primitive.type.ts#L5)
|
|
7711
7589
|
|
|
7712
7590
|
---
|
|
7713
7591
|
|
|
@@ -7717,7 +7595,7 @@ Defined in: [types/is-primitive.type.ts:5](https://github.com/hichchidev/hichchi
|
|
|
7717
7595
|
type PartialWithNull<T> = { [p in keyof T]?: T[p] | null };
|
|
7718
7596
|
```
|
|
7719
7597
|
|
|
7720
|
-
Defined in: [types/partial-with-null.type.ts:25](https://github.com/hichchidev/hichchi/blob/
|
|
7598
|
+
Defined in: [types/partial-with-null.type.ts:25](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/types/partial-with-null.type.ts#L25)
|
|
7721
7599
|
|
|
7722
7600
|
Makes all properties of type T optional and allows them to be null.
|
|
7723
7601
|
|
|
@@ -7774,7 +7652,7 @@ const partialUser: PartialWithNull<User> = {
|
|
|
7774
7652
|
type Prettify<T> = { [K in keyof T]: T[K] } & object;
|
|
7775
7653
|
```
|
|
7776
7654
|
|
|
7777
|
-
Defined in: [types/prettify.type.ts:22](https://github.com/hichchidev/hichchi/blob/
|
|
7655
|
+
Defined in: [types/prettify.type.ts:22](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/types/prettify.type.ts#L22)
|
|
7778
7656
|
|
|
7779
7657
|
Utility type for creating a clean object type from a complex type.
|
|
7780
7658
|
|
|
@@ -7829,7 +7707,7 @@ type SimpleType = Prettify<ComplexType>;
|
|
|
7829
7707
|
type Primitive = string | number | boolean | symbol | bigint | null | undefined;
|
|
7830
7708
|
```
|
|
7831
7709
|
|
|
7832
|
-
Defined in: [types/is-primitive.type.ts:3](https://github.com/hichchidev/hichchi/blob/
|
|
7710
|
+
Defined in: [types/is-primitive.type.ts:3](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/types/is-primitive.type.ts#L3)
|
|
7833
7711
|
|
|
7834
7712
|
---
|
|
7835
7713
|
|
|
@@ -7841,7 +7719,7 @@ type SimpleDeepPartial<T> = {
|
|
|
7841
7719
|
};
|
|
7842
7720
|
```
|
|
7843
7721
|
|
|
7844
|
-
Defined in: [types/deep-partial.type.ts:63](https://github.com/hichchidev/hichchi/blob/
|
|
7722
|
+
Defined in: [types/deep-partial.type.ts:63](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/types/deep-partial.type.ts#L63)
|
|
7845
7723
|
|
|
7846
7724
|
Lightweight recursive partial type for plain object filtering/comparison use-cases.
|
|
7847
7725
|
|
|
@@ -7872,7 +7750,7 @@ Lightweight recursive partial type for plain object filtering/comparison use-cas
|
|
|
7872
7750
|
type Type<T> = (...args) => T;
|
|
7873
7751
|
```
|
|
7874
7752
|
|
|
7875
|
-
Defined in: [types/type.type.ts:21](https://github.com/hichchidev/hichchi/blob/
|
|
7753
|
+
Defined in: [types/type.type.ts:21](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/types/type.type.ts#L21)
|
|
7876
7754
|
|
|
7877
7755
|
Generic constructor type for creating class instances.
|
|
7878
7756
|
|
|
@@ -7960,7 +7838,7 @@ const instance = createInstance(MyService);
|
|
|
7960
7838
|
const CHARACTERS_TO_REMOVE: 2 = 2;
|
|
7961
7839
|
```
|
|
7962
7840
|
|
|
7963
|
-
Defined in: [constants/constants.ts:93](https://github.com/hichchidev/hichchi/blob/
|
|
7841
|
+
Defined in: [constants/constants.ts:93](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/constants/constants.ts#L93)
|
|
7964
7842
|
|
|
7965
7843
|
Number of characters to remove in string truncation operations
|
|
7966
7844
|
|
|
@@ -7995,7 +7873,7 @@ if (result.length > 0) {
|
|
|
7995
7873
|
const CONTEXT_MULTIPLIER: 2 = 2;
|
|
7996
7874
|
```
|
|
7997
7875
|
|
|
7998
|
-
Defined in: [constants/constants.ts:231](https://github.com/hichchidev/hichchi/blob/
|
|
7876
|
+
Defined in: [constants/constants.ts:231](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/constants/constants.ts#L231)
|
|
7999
7877
|
|
|
8000
7878
|
Multiplier for adjusting context length in excerpts
|
|
8001
7879
|
|
|
@@ -8035,7 +7913,7 @@ function getFirstPart(text: string): string {
|
|
|
8035
7913
|
const DEFAULT_BREAK_CHAR: "\n" = "\n";
|
|
8036
7914
|
```
|
|
8037
7915
|
|
|
8038
|
-
Defined in: [constants/constants.ts:147](https://github.com/hichchidev/hichchi/blob/
|
|
7916
|
+
Defined in: [constants/constants.ts:147](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/constants/constants.ts#L147)
|
|
8039
7917
|
|
|
8040
7918
|
Default line break character for word wrapping
|
|
8041
7919
|
|
|
@@ -8065,7 +7943,7 @@ const wrappedText =
|
|
|
8065
7943
|
const DEFAULT_CONTEXT_LENGTH: 40 = 40;
|
|
8066
7944
|
```
|
|
8067
7945
|
|
|
8068
|
-
Defined in: [constants/constants.ts:177](https://github.com/hichchidev/hichchi/blob/
|
|
7946
|
+
Defined in: [constants/constants.ts:177](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/constants/constants.ts#L177)
|
|
8069
7947
|
|
|
8070
7948
|
Default context length for text excerpts
|
|
8071
7949
|
|
|
@@ -8109,7 +7987,7 @@ function generateExcerpt(text: string, searchTerm: string): string {
|
|
|
8109
7987
|
const DEFAULT_ELLIPSIS: "..." = "...";
|
|
8110
7988
|
```
|
|
8111
7989
|
|
|
8112
|
-
Defined in: [constants/constants.ts:201](https://github.com/hichchidev/hichchi/blob/
|
|
7990
|
+
Defined in: [constants/constants.ts:201](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/constants/constants.ts#L201)
|
|
8113
7991
|
|
|
8114
7992
|
Default ellipsis string for indicating truncated text
|
|
8115
7993
|
|
|
@@ -8145,7 +8023,7 @@ const truncated = truncate(longText, 20);
|
|
|
8145
8023
|
const DEFAULT_LINE_LENGTH: 80 = 80;
|
|
8146
8024
|
```
|
|
8147
8025
|
|
|
8148
|
-
Defined in: [constants/constants.ts:129](https://github.com/hichchidev/hichchi/blob/
|
|
8026
|
+
Defined in: [constants/constants.ts:129](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/constants/constants.ts#L129)
|
|
8149
8027
|
|
|
8150
8028
|
Default maximum line length for word wrapping
|
|
8151
8029
|
|
|
@@ -8195,7 +8073,7 @@ function wrapText(
|
|
|
8195
8073
|
const EnglishInflectionRules: InflectionRuleCategories;
|
|
8196
8074
|
```
|
|
8197
8075
|
|
|
8198
|
-
Defined in: [constants/english-inflection-rules.ts:55](https://github.com/hichchidev/hichchi/blob/
|
|
8076
|
+
Defined in: [constants/english-inflection-rules.ts:55](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/constants/english-inflection-rules.ts#L55)
|
|
8199
8077
|
|
|
8200
8078
|
Comprehensive rules for English word inflection (singular/plural transformations)
|
|
8201
8079
|
|
|
@@ -8259,7 +8137,7 @@ function plural(word: string): string {
|
|
|
8259
8137
|
const HEX_PADDING_CHAR: "0" = "0";
|
|
8260
8138
|
```
|
|
8261
8139
|
|
|
8262
|
-
Defined in: [constants/constants.ts:66](https://github.com/hichchidev/hichchi/blob/
|
|
8140
|
+
Defined in: [constants/constants.ts:66](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/constants/constants.ts#L66)
|
|
8263
8141
|
|
|
8264
8142
|
Character used for padding hexadecimal strings
|
|
8265
8143
|
|
|
@@ -8292,7 +8170,7 @@ const paddedHex = hexValue.padStart(HEX_PADDING_LENGTH, HEX_PADDING_CHAR);
|
|
|
8292
8170
|
const HEX_PADDING_LENGTH: 2 = 2;
|
|
8293
8171
|
```
|
|
8294
8172
|
|
|
8295
|
-
Defined in: [constants/constants.ts:43](https://github.com/hichchidev/hichchi/blob/
|
|
8173
|
+
Defined in: [constants/constants.ts:43](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/constants/constants.ts#L43)
|
|
8296
8174
|
|
|
8297
8175
|
Minimum length for padded hexadecimal strings
|
|
8298
8176
|
|
|
@@ -8327,7 +8205,7 @@ const hexByte = byteValue
|
|
|
8327
8205
|
const HEX_RADIX: 16 = 16;
|
|
8328
8206
|
```
|
|
8329
8207
|
|
|
8330
|
-
Defined in: [constants/constants.ts:20](https://github.com/hichchidev/hichchi/blob/
|
|
8208
|
+
Defined in: [constants/constants.ts:20](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/constants/constants.ts#L20)
|
|
8331
8209
|
|
|
8332
8210
|
Base for hexadecimal number conversion
|
|
8333
8211
|
|
|
@@ -8358,7 +8236,7 @@ const number = parseInt(hexString, HEX_RADIX);
|
|
|
8358
8236
|
const mimeTypes: Map<string, string>;
|
|
8359
8237
|
```
|
|
8360
8238
|
|
|
8361
|
-
Defined in: [utils/file.utils.ts:38](https://github.com/hichchidev/hichchi/blob/
|
|
8239
|
+
Defined in: [utils/file.utils.ts:38](https://github.com/hichchidev/hichchi/blob/945db660e7bba28e17d58da0bb856736e708db35/libs/utils/src/utils/file.utils.ts#L38)
|
|
8362
8240
|
|
|
8363
8241
|
Comprehensive mapping of file extensions to their corresponding MIME types.
|
|
8364
8242
|
|