topkat-utils 1.2.115 → 1.2.116
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/coverage/clover.xml +80 -74
- package/coverage/coverage-final.json +1 -1
- package/coverage/lcov-report/clean-stack-trace.ts.html +1 -1
- package/coverage/lcov-report/config.ts.html +1 -1
- package/coverage/lcov-report/error-utils.ts.html +1 -1
- package/coverage/lcov-report/index.html +19 -19
- package/coverage/lcov-report/is-empty.ts.html +1 -1
- package/coverage/lcov-report/is-nodejs.ts.html +1 -1
- package/coverage/lcov-report/is-object.ts.html +1 -1
- package/coverage/lcov-report/isset.ts.html +1 -1
- package/coverage/lcov-report/logger-utils.ts.html +65 -47
- package/coverage/lcov-report/loop-utils.ts.html +1 -1
- package/coverage/lcov-report/math-utils.ts.html +1 -1
- package/coverage/lcov-report/object-utils.ts.html +1 -1
- package/coverage/lcov-report/regexp-utils.ts.html +1 -1
- package/coverage/lcov-report/remove-circular-json-stringify.ts.html +1 -1
- package/coverage/lcov-report/string-utils.ts.html +1 -1
- package/coverage/lcov-report/timer-utils.ts.html +1 -1
- package/coverage/lcov-report/transaction-utils.ts.html +1 -1
- package/coverage/lcov.info +121 -87
- package/dist/src/logger-utils.d.ts +2 -1
- package/dist/src/logger-utils.js +8 -2
- package/dist/src/logger-utils.js.map +1 -1
- package/package.json +1 -1
- package/src/logger-utils.ts +8 -2
|
@@ -190,7 +190,7 @@ export function cleanStackTrace(stack) {
|
|
|
190
190
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
191
191
|
Code coverage generated by
|
|
192
192
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
193
|
-
at 2025-03-
|
|
193
|
+
at 2025-03-13T18:42:56.377Z
|
|
194
194
|
</div>
|
|
195
195
|
<script src="prettify.js"></script>
|
|
196
196
|
<script>
|
|
@@ -349,7 +349,7 @@ type RecursivePartial<T> = {
|
|
|
349
349
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
350
350
|
Code coverage generated by
|
|
351
351
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
352
|
-
at 2025-03-
|
|
352
|
+
at 2025-03-13T18:42:56.377Z
|
|
353
353
|
</div>
|
|
354
354
|
<script src="prettify.js"></script>
|
|
355
355
|
<script>
|
|
@@ -715,7 +715,7 @@ export const failSafe = tryCatch // ALIAS
|
|
|
715
715
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
716
716
|
Code coverage generated by
|
|
717
717
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
718
|
-
at 2025-03-
|
|
718
|
+
at 2025-03-13T18:42:56.377Z
|
|
719
719
|
</div>
|
|
720
720
|
<script src="prettify.js"></script>
|
|
721
721
|
<script>
|
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">39.
|
|
26
|
+
<span class="strong">39.46% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>719/1822</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">77.27% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>51/66</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">10.56% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>15/142</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">39.
|
|
47
|
+
<span class="strong">39.46% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>719/1822</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -185,17 +185,17 @@
|
|
|
185
185
|
|
|
186
186
|
<tr>
|
|
187
187
|
<td class="file low" data-value="logger-utils.ts"><a href="logger-utils.ts.html">logger-utils.ts</a></td>
|
|
188
|
-
<td data-value="
|
|
189
|
-
<div class="chart"><div class="cover-fill" style="width:
|
|
188
|
+
<td data-value="42.81" class="pic low">
|
|
189
|
+
<div class="chart"><div class="cover-fill" style="width: 42%"></div><div class="cover-empty" style="width: 58%"></div></div>
|
|
190
190
|
</td>
|
|
191
|
-
<td data-value="
|
|
192
|
-
<td data-value="
|
|
193
|
-
<td data-value="
|
|
194
|
-
<td data-value="
|
|
195
|
-
<td data-value="
|
|
196
|
-
<td data-value="
|
|
197
|
-
<td data-value="
|
|
198
|
-
<td data-value="
|
|
191
|
+
<td data-value="42.81" class="pct low">42.81%</td>
|
|
192
|
+
<td data-value="362" class="abs low">155/362</td>
|
|
193
|
+
<td data-value="78.78" class="pct medium">78.78%</td>
|
|
194
|
+
<td data-value="33" class="abs medium">26/33</td>
|
|
195
|
+
<td data-value="14.58" class="pct low">14.58%</td>
|
|
196
|
+
<td data-value="48" class="abs low">7/48</td>
|
|
197
|
+
<td data-value="42.81" class="pct low">42.81%</td>
|
|
198
|
+
<td data-value="362" class="abs low">155/362</td>
|
|
199
199
|
</tr>
|
|
200
200
|
|
|
201
201
|
<tr>
|
|
@@ -326,7 +326,7 @@
|
|
|
326
326
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
327
327
|
Code coverage generated by
|
|
328
328
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
329
|
-
at 2025-03-
|
|
329
|
+
at 2025-03-13T18:42:56.377Z
|
|
330
330
|
</div>
|
|
331
331
|
<script src="prettify.js"></script>
|
|
332
332
|
<script>
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
89
89
|
Code coverage generated by
|
|
90
90
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
91
|
-
at 2025-03-
|
|
91
|
+
at 2025-03-13T18:42:56.377Z
|
|
92
92
|
</div>
|
|
93
93
|
<script src="prettify.js"></script>
|
|
94
94
|
<script>
|
|
@@ -94,7 +94,7 @@ export function isNodeJs(): boolean {
|
|
|
94
94
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
95
95
|
Code coverage generated by
|
|
96
96
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
97
|
-
at 2025-03-
|
|
97
|
+
at 2025-03-13T18:42:56.377Z
|
|
98
98
|
</div>
|
|
99
99
|
<script src="prettify.js"></script>
|
|
100
100
|
<script>
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
77
77
|
Code coverage generated by
|
|
78
78
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
79
|
-
at 2025-03-
|
|
79
|
+
at 2025-03-13T18:42:56.377Z
|
|
80
80
|
</div>
|
|
81
81
|
<script src="prettify.js"></script>
|
|
82
82
|
<script>
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
77
77
|
Code coverage generated by
|
|
78
78
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
79
|
-
at 2025-03-
|
|
79
|
+
at 2025-03-13T18:42:56.377Z
|
|
80
80
|
</div>
|
|
81
81
|
<script src="prettify.js"></script>
|
|
82
82
|
<script>
|
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">42.81% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>155/362</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">78.78% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>26/33</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">14.58% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>7/48</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">42.81% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>155/362</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -420,7 +420,13 @@
|
|
|
420
420
|
<a name='L355'></a><a href='#L355'>355</a>
|
|
421
421
|
<a name='L356'></a><a href='#L356'>356</a>
|
|
422
422
|
<a name='L357'></a><a href='#L357'>357</a>
|
|
423
|
-
<a name='L358'></a><a href='#L358'>358</a
|
|
423
|
+
<a name='L358'></a><a href='#L358'>358</a>
|
|
424
|
+
<a name='L359'></a><a href='#L359'>359</a>
|
|
425
|
+
<a name='L360'></a><a href='#L360'>360</a>
|
|
426
|
+
<a name='L361'></a><a href='#L361'>361</a>
|
|
427
|
+
<a name='L362'></a><a href='#L362'>362</a>
|
|
428
|
+
<a name='L363'></a><a href='#L363'>363</a>
|
|
429
|
+
<a name='L364'></a><a href='#L364'>364</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">2x</span>
|
|
424
430
|
<span class="cline-any cline-yes">2x</span>
|
|
425
431
|
<span class="cline-any cline-yes">2x</span>
|
|
426
432
|
<span class="cline-any cline-yes">2x</span>
|
|
@@ -606,6 +612,13 @@
|
|
|
606
612
|
<span class="cline-any cline-no"> </span>
|
|
607
613
|
<span class="cline-any cline-yes">2x</span>
|
|
608
614
|
<span class="cline-any cline-yes">2x</span>
|
|
615
|
+
<span class="cline-any cline-yes">1x</span>
|
|
616
|
+
<span class="cline-any cline-no"> </span>
|
|
617
|
+
<span class="cline-any cline-no"> </span>
|
|
618
|
+
<span class="cline-any cline-no"> </span>
|
|
619
|
+
<span class="cline-any cline-no"> </span>
|
|
620
|
+
<span class="cline-any cline-yes">1x</span>
|
|
621
|
+
<span class="cline-any cline-yes">1x</span>
|
|
609
622
|
<span class="cline-any cline-yes">2x</span>
|
|
610
623
|
<span class="cline-any cline-yes">2x</span>
|
|
611
624
|
<span class="cline-any cline-yes">2x</span>
|
|
@@ -621,10 +634,10 @@
|
|
|
621
634
|
<span class="cline-any cline-yes">2x</span>
|
|
622
635
|
<span class="cline-any cline-yes">2x</span>
|
|
623
636
|
<span class="cline-any cline-yes">2x</span>
|
|
624
|
-
<span class="cline-any cline-yes">
|
|
625
|
-
<span class="cline-any cline-yes">
|
|
637
|
+
<span class="cline-any cline-yes">1x</span>
|
|
638
|
+
<span class="cline-any cline-yes">1x</span>
|
|
639
|
+
<span class="cline-any cline-yes">1x</span>
|
|
626
640
|
<span class="cline-any cline-no"> </span>
|
|
627
|
-
<span class="cline-any cline-yes">2x</span>
|
|
628
641
|
<span class="cline-any cline-no"> </span>
|
|
629
642
|
<span class="cline-any cline-no"> </span>
|
|
630
643
|
<span class="cline-any cline-no"> </span>
|
|
@@ -634,15 +647,14 @@
|
|
|
634
647
|
<span class="cline-any cline-no"> </span>
|
|
635
648
|
<span class="cline-any cline-no"> </span>
|
|
636
649
|
<span class="cline-any cline-no"> </span>
|
|
637
|
-
<span class="cline-any cline-
|
|
638
|
-
<span class="cline-any cline-no"> </span>
|
|
639
|
-
<span class="cline-any cline-yes">2x</span>
|
|
650
|
+
<span class="cline-any cline-yes">1x</span>
|
|
640
651
|
<span class="cline-any cline-yes">2x</span>
|
|
641
652
|
<span class="cline-any cline-yes">2x</span>
|
|
642
653
|
<span class="cline-any cline-yes">2x</span>
|
|
643
654
|
<span class="cline-any cline-yes">2x</span>
|
|
655
|
+
<span class="cline-any cline-yes">1x</span>
|
|
644
656
|
<span class="cline-any cline-no"> </span>
|
|
645
|
-
<span class="cline-any cline-
|
|
657
|
+
<span class="cline-any cline-yes">1x</span>
|
|
646
658
|
<span class="cline-any cline-yes">2x</span>
|
|
647
659
|
<span class="cline-any cline-yes">2x</span>
|
|
648
660
|
<span class="cline-any cline-yes">2x</span>
|
|
@@ -669,7 +681,7 @@
|
|
|
669
681
|
<span class="cline-any cline-no"> </span>
|
|
670
682
|
<span class="cline-any cline-no"> </span>
|
|
671
683
|
<span class="cline-any cline-no"> </span>
|
|
672
|
-
<span class="cline-any cline-
|
|
684
|
+
<span class="cline-any cline-yes">1x</span>
|
|
673
685
|
<span class="cline-any cline-yes">2x</span>
|
|
674
686
|
<span class="cline-any cline-no"> </span>
|
|
675
687
|
<span class="cline-any cline-no"> </span>
|
|
@@ -702,26 +714,25 @@
|
|
|
702
714
|
<span class="cline-any cline-no"> </span>
|
|
703
715
|
<span class="cline-any cline-no"> </span>
|
|
704
716
|
<span class="cline-any cline-no"> </span>
|
|
705
|
-
<span class="cline-any cline-
|
|
717
|
+
<span class="cline-any cline-yes">1x</span>
|
|
706
718
|
<span class="cline-any cline-yes">2x</span>
|
|
707
719
|
<span class="cline-any cline-yes">2x</span>
|
|
708
720
|
<span class="cline-any cline-yes">2x</span>
|
|
709
721
|
<span class="cline-any cline-yes">2x</span>
|
|
710
722
|
<span class="cline-any cline-yes">2x</span>
|
|
711
723
|
<span class="cline-any cline-yes">2x</span>
|
|
712
|
-
<span class="cline-any cline-yes">
|
|
713
|
-
<span class="cline-any cline-no"> </span>
|
|
724
|
+
<span class="cline-any cline-yes">1x</span>
|
|
714
725
|
<span class="cline-any cline-no"> </span>
|
|
715
726
|
<span class="cline-any cline-no"> </span>
|
|
716
727
|
<span class="cline-any cline-no"> </span>
|
|
717
728
|
<span class="cline-any cline-no"> </span>
|
|
718
729
|
<span class="cline-any cline-no"> </span>
|
|
719
730
|
<span class="cline-any cline-no"> </span>
|
|
731
|
+
<span class="cline-any cline-yes">1x</span>
|
|
720
732
|
<span class="cline-any cline-yes">2x</span>
|
|
721
733
|
<span class="cline-any cline-yes">2x</span>
|
|
722
734
|
<span class="cline-any cline-yes">2x</span>
|
|
723
|
-
<span class="cline-any cline-yes">
|
|
724
|
-
<span class="cline-any cline-no"> </span>
|
|
735
|
+
<span class="cline-any cline-yes">1x</span>
|
|
725
736
|
<span class="cline-any cline-no"> </span>
|
|
726
737
|
<span class="cline-any cline-no"> </span>
|
|
727
738
|
<span class="cline-any cline-no"> </span>
|
|
@@ -771,11 +782,12 @@
|
|
|
771
782
|
<span class="cline-any cline-no"> </span>
|
|
772
783
|
<span class="cline-any cline-no"> </span>
|
|
773
784
|
<span class="cline-any cline-no"> </span>
|
|
785
|
+
<span class="cline-any cline-yes">1x</span>
|
|
774
786
|
<span class="cline-any cline-yes">2x</span>
|
|
775
787
|
<span class="cline-any cline-yes">2x</span>
|
|
776
788
|
<span class="cline-any cline-no"> </span>
|
|
777
789
|
<span class="cline-any cline-no"> </span>
|
|
778
|
-
<span class="cline-any cline-
|
|
790
|
+
<span class="cline-any cline-yes">1x</span>
|
|
779
791
|
<span class="cline-any cline-neutral"> </span>
|
|
780
792
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">/* eslint-disable no-console */
|
|
781
793
|
/* eslint-disable no-control-regex */
|
|
@@ -962,26 +974,32 @@ export const C = {
|
|
|
962
974
|
<span class="cstat-no" title="statement not covered" > this.logClr('🐞 ' + title, configFn()?.terminal?.theme?.debugModeColor, 0)</span>
|
|
963
975
|
<span class="cstat-no" title="statement not covered" > this.log(this.dimStrSplit(...string))</span>
|
|
964
976
|
},
|
|
965
|
-
|
|
966
|
-
<span class="fstat-no" title="function not covered" >
|
|
977
|
+
<span class="fstat-no" title="function not covered" > /** allow to clear the last lines written to console */</span>
|
|
978
|
+
<span class="fstat-no" title="function not covered" > clearLastLines(n: number = 2) {</span>
|
|
979
|
+
<span class="cstat-no" title="statement not covered" > for (let i = 0; i < n; i++) {</span>
|
|
980
|
+
<span class="cstat-no" title="statement not covered" > process?.stdout?.moveCursor?.(0, -1) // Move up one line</span>
|
|
981
|
+
<span class="cstat-no" title="statement not covered" > process?.stdout?.clearLine?.(0)</span>
|
|
982
|
+
<span class="cstat-no" title="statement not covered" > }</span>
|
|
983
|
+
process?.stdout?.cursorTo?.(0) // Move cursor to beginning of the current line
|
|
984
|
+
}
|
|
967
985
|
}
|
|
968
986
|
|
|
969
987
|
function logErrPrivate(level: NotInfoLogLevel, color: Color, ...errors) {
|
|
970
988
|
const { isProd } = configFn()
|
|
971
989
|
|
|
972
|
-
if (errors.length === 1 && typeof errors[0].log === 'function')
|
|
990
|
+
if (errors.length === 1 && typeof errors[0].log === 'function') return errors[0].log()
|
|
973
991
|
|
|
974
|
-
let stackTrace = (new Error('')).stack
|
|
975
|
-
const displayStack = errors[0] === false
|
|
992
|
+
let stackTrace = (new Error('')).stack ||<span class="branch-0 cbranch-no" title="branch not covered" > ''</span>
|
|
993
|
+
const displayStack = errors[0] === false ? errors.shift() : true
|
|
976
994
|
const symbol = level === 'error' <span class="branch-0 cbranch-no" title="branch not covered" >? '✘ ' </span>: '⚠ '
|
|
977
|
-
if (errors.length > 1
|
|
995
|
+
if (errors.length > 1 && !isset(errors[0])) errors.shift()
|
|
978
996
|
|
|
979
997
|
const getStringFromErr = (err, i) => {
|
|
980
|
-
if (!isset(err))
|
|
998
|
+
if (!isset(err)) return ''
|
|
981
999
|
else if (typeof err === 'string') {
|
|
982
1000
|
if (i === 0) return C.rgb(...color) + symbol + err + C.reset
|
|
983
|
-
|
|
984
|
-
}
|
|
1001
|
+
else return err.split('\n').map(val => C.dim(val)).join('\n')
|
|
1002
|
+
} else if (err instanceof Error) {
|
|
985
1003
|
<span class="cstat-no" title="statement not covered" > const { str, stackTrace: stkTrc } = stringifyInstanceOfError(err, level, color)</span>
|
|
986
1004
|
<span class="cstat-no" title="statement not covered" > if (stkTrc) stackTrace = stkTrc</span>
|
|
987
1005
|
<span class="cstat-no" title="statement not covered" > return str</span>
|
|
@@ -992,25 +1010,25 @@ function logErrPrivate(level: NotInfoLogLevel, color: Color, ...errors) {
|
|
|
992
1010
|
<span class="cstat-no" title="statement not covered" > if (stkTrc) stackTrace = stkTrc</span>
|
|
993
1011
|
<span class="cstat-no" title="statement not covered" > msg += str</span>
|
|
994
1012
|
<span class="cstat-no" title="statement not covered" > return msg</span>
|
|
995
|
-
|
|
1013
|
+
} else return ''
|
|
996
1014
|
}
|
|
997
1015
|
|
|
998
1016
|
if (errors.length && errors[0]) {
|
|
999
1017
|
const messages = errors.map((e, i) => {
|
|
1000
|
-
if (typeof e?.log === 'function')
|
|
1018
|
+
if (typeof e?.log === 'function') {
|
|
1001
1019
|
<span class="cstat-no" title="statement not covered" > e.log()</span>
|
|
1002
|
-
|
|
1020
|
+
return ''
|
|
1003
1021
|
} else return getStringFromErr(e, i)
|
|
1004
1022
|
})
|
|
1005
1023
|
// Stack
|
|
1006
1024
|
if (displayStack) {
|
|
1007
|
-
messages.push(isProd
|
|
1025
|
+
messages.push(isProd ? stackTrace : cleanStackTrace(stackTrace) + '\n')
|
|
1008
1026
|
}
|
|
1009
1027
|
logger.log(messages.join(''), level)
|
|
1010
1028
|
}
|
|
1011
1029
|
}
|
|
1012
1030
|
|
|
1013
|
-
<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >function stringifyInstanceOfError(err, type = 'error', color: Color = [255, 0, 0], level = 0) { // level = keep track of recursions</span></span>
|
|
1031
|
+
<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" ><span class="fstat-no" title="function not covered" >function stringifyInstanceOfError(err, type = 'error', color: Color = [255, 0, 0], level = 0) { // level = keep track of recursions</span></span></span>
|
|
1014
1032
|
<span class="cstat-no" title="statement not covered" > if (level > 5) return { str: '' }</span>
|
|
1015
1033
|
<span class="cstat-no" title="statement not covered" > let str = ''</span>
|
|
1016
1034
|
<span class="cstat-no" title="statement not covered" > let stackTrace</span>
|
|
@@ -1026,9 +1044,9 @@ function logErrPrivate(level: NotInfoLogLevel, color: Color, ...errors) {
|
|
|
1026
1044
|
<span class="cstat-no" title="statement not covered" > str += str2</span>
|
|
1027
1045
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1028
1046
|
<span class="cstat-no" title="statement not covered" > return { str, stackTrace }</span>
|
|
1029
|
-
|
|
1047
|
+
}
|
|
1030
1048
|
|
|
1031
|
-
<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >function stringifyExtraInfos(extraInfoOriginal, type, color, level = 0) {</span></span>
|
|
1049
|
+
<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" ><span class="fstat-no" title="function not covered" >function stringifyExtraInfos(extraInfoOriginal, type, color, level = 0) {</span></span></span>
|
|
1032
1050
|
<span class="cstat-no" title="statement not covered" > let stackTrace</span>
|
|
1033
1051
|
<span class="cstat-no" title="statement not covered" > const originalError = [C.dim(`ORIGINAL ERROR ${'-'.repeat(39)}\n`)]</span>
|
|
1034
1052
|
<span class="cstat-no" title="statement not covered" > if (extraInfoOriginal instanceof Error) { // case where error is passed directly to extraInfos</span>
|
|
@@ -1059,25 +1077,25 @@ function logErrPrivate(level: NotInfoLogLevel, color: Color, ...errors) {
|
|
|
1059
1077
|
<span class="cstat-no" title="statement not covered" > stackTrace</span>
|
|
1060
1078
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1061
1079
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1062
|
-
|
|
1080
|
+
}
|
|
1063
1081
|
|
|
1064
1082
|
/**
|
|
1065
1083
|
* Call this at each steps of your progress and change the step value
|
|
1066
1084
|
* @param {Number} step Number of "char" to output
|
|
1067
1085
|
* @param {String} char Default: '.'
|
|
1068
1086
|
* @param {String} msg String before char. Final output will be `${str}${char.repeat(step)}`
|
|
1069
|
-
|
|
1087
|
+
<span class="fstat-no" title="function not covered" > */</span>
|
|
1070
1088
|
<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >export function cliProgressBar(step: number, char = '.', msg = `\x1b[2mⓘ Waiting response`) {</span></span>
|
|
1071
1089
|
<span class="cstat-no" title="statement not covered" > if (typeof process?.stdout?.clearLine === 'function') {</span>
|
|
1072
1090
|
<span class="cstat-no" title="statement not covered" > process.stdout.clearLine(0)</span>
|
|
1073
1091
|
<span class="cstat-no" title="statement not covered" > process.stdout.cursorTo(0)</span>
|
|
1074
1092
|
<span class="cstat-no" title="statement not covered" > process.stdout.write(`${msg}${char.repeat(step)}\x1b[0m`) // \x1b[0m == reset color</span>
|
|
1075
1093
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1076
|
-
|
|
1094
|
+
}
|
|
1077
1095
|
|
|
1078
1096
|
type loadingSpinnerTypes = 'arrow' | 'dots'
|
|
1079
1097
|
|
|
1080
|
-
|
|
1098
|
+
<span class="fstat-no" title="function not covered" ><span class="branch-0 cbranch-no" title="branch not covered" >/** This allow an intuitive inline loading spinner with a check mark when loading as finished or a red cross for errors */</span></span>
|
|
1081
1099
|
<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" ><span class="branch-0 cbranch-no" title="branch not covered" >export class cliLoadingSpinner {</span></span></span>
|
|
1082
1100
|
<span class="cstat-no" title="statement not covered" > /** Please use it like spinner.start('myStuff') then spinner.end()</span>
|
|
1083
1101
|
<span class="cstat-no" title="statement not covered" > * @param {String} type in: ['arrow', 'dots']</span>
|
|
@@ -1127,12 +1145,12 @@ type loadingSpinnerTypes = 'arrow' | 'dots'
|
|
|
1127
1145
|
<span class="cstat-no" title="statement not covered" > error() {</span>
|
|
1128
1146
|
<span class="cstat-no" title="statement not covered" > return this.end(true)</span>
|
|
1129
1147
|
<span class="cstat-no" title="statement not covered" > }</span>
|
|
1130
|
-
|
|
1148
|
+
}
|
|
1131
1149
|
|
|
1132
1150
|
|
|
1133
|
-
<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >export function dim(str = '') {</span></span>
|
|
1151
|
+
<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" ><span class="fstat-no" title="function not covered" >export function dim(str = '') {</span></span></span>
|
|
1134
1152
|
<span class="cstat-no" title="statement not covered" > return configFn()?.terminal?.noColor ? str : `\x1b[2m${str.toString().split('\n').join('\x1b[0m\n\x1b[2m')}\x1b[0m`</span>
|
|
1135
|
-
|
|
1153
|
+
}
|
|
1136
1154
|
|
|
1137
1155
|
</pre></td></tr></table></pre>
|
|
1138
1156
|
|
|
@@ -1141,7 +1159,7 @@ type loadingSpinnerTypes = 'arrow' | 'dots'
|
|
|
1141
1159
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1142
1160
|
Code coverage generated by
|
|
1143
1161
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
1144
|
-
at 2025-03-
|
|
1162
|
+
at 2025-03-13T18:42:56.377Z
|
|
1145
1163
|
</div>
|
|
1146
1164
|
<script src="prettify.js"></script>
|
|
1147
1165
|
<script>
|
|
@@ -388,7 +388,7 @@ export <span class="fstat-no" title="function not covered" >async function recur
|
|
|
388
388
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
389
389
|
Code coverage generated by
|
|
390
390
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
391
|
-
at 2025-03-
|
|
391
|
+
at 2025-03-13T18:42:56.377Z
|
|
392
392
|
</div>
|
|
393
393
|
<script src="prettify.js"></script>
|
|
394
394
|
<script>
|
|
@@ -217,7 +217,7 @@ import { isset } from './isset'
|
|
|
217
217
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
218
218
|
Code coverage generated by
|
|
219
219
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
220
|
-
at 2025-03-
|
|
220
|
+
at 2025-03-13T18:42:56.377Z
|
|
221
221
|
</div>
|
|
222
222
|
<script src="prettify.js"></script>
|
|
223
223
|
<script>
|
|
@@ -1387,7 +1387,7 @@ export const entries = objEntries</pre></td></tr></table></pre>
|
|
|
1387
1387
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1388
1388
|
Code coverage generated by
|
|
1389
1389
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
1390
|
-
at 2025-03-
|
|
1390
|
+
at 2025-03-13T18:42:56.377Z
|
|
1391
1391
|
</div>
|
|
1392
1392
|
<script src="prettify.js"></script>
|
|
1393
1393
|
<script>
|
|
@@ -190,7 +190,7 @@ import { C } from './logger-utils'
|
|
|
190
190
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
191
191
|
Code coverage generated by
|
|
192
192
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
193
|
-
at 2025-03-
|
|
193
|
+
at 2025-03-13T18:42:56.377Z
|
|
194
194
|
</div>
|
|
195
195
|
<script src="prettify.js"></script>
|
|
196
196
|
<script>
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
125
125
|
Code coverage generated by
|
|
126
126
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
127
|
-
at 2025-03-
|
|
127
|
+
at 2025-03-13T18:42:56.377Z
|
|
128
128
|
</div>
|
|
129
129
|
<script src="prettify.js"></script>
|
|
130
130
|
<script>
|
|
@@ -907,7 +907,7 @@ export type MiniTemplaterOptions = {
|
|
|
907
907
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
908
908
|
Code coverage generated by
|
|
909
909
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
910
|
-
at 2025-03-
|
|
910
|
+
at 2025-03-13T18:42:56.377Z
|
|
911
911
|
</div>
|
|
912
912
|
<script src="prettify.js"></script>
|
|
913
913
|
<script>
|
|
@@ -334,7 +334,7 @@ console.log('Process took ' + time.end())
|
|
|
334
334
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
335
335
|
Code coverage generated by
|
|
336
336
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
337
|
-
at 2025-03-
|
|
337
|
+
at 2025-03-13T18:42:56.377Z
|
|
338
338
|
</div>
|
|
339
339
|
<script src="prettify.js"></script>
|
|
340
340
|
<script>
|
|
@@ -259,7 +259,7 @@ export <span class="fstat-no" title="function not covered" >async function waitF
|
|
|
259
259
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
260
260
|
Code coverage generated by
|
|
261
261
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
262
|
-
at 2025-03-
|
|
262
|
+
at 2025-03-13T18:42:56.377Z
|
|
263
263
|
</div>
|
|
264
264
|
<script src="prettify.js"></script>
|
|
265
265
|
<script>
|