@udt/parser-utils 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -15
- package/dist/extractProperties.d.ts +4 -4
- package/dist/extractProperties.js +3 -3
- package/dist/index.js +2 -0
- package/dist/parseData.d.ts +34 -23
- package/dist/parseData.js +39 -12
- package/package.json +14 -3
- package/CHANGELOG.md +0 -13
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/clover.xml +0 -123
- package/coverage/coverage-final.json +0 -5
- package/coverage/extractProperties.ts.html +0 -277
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -161
- package/coverage/index.ts.html +0 -94
- package/coverage/isJsonObject.ts.html +0 -142
- package/coverage/parseData.ts.html +0 -898
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -196
- package/src/extractProperties.test.ts +0 -33
- package/src/extractProperties.ts +0 -64
- package/src/index.ts +0 -3
- package/src/isJsonObject.test.ts +0 -32
- package/src/isJsonObject.ts +0 -19
- package/src/parseData.test.ts +0 -438
- package/src/parseData.ts +0 -271
- package/tsconfig.build.json +0 -11
- package/tsconfig.json +0 -6
package/coverage/clover.xml
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<coverage generated="1732239781599" clover="3.2.0">
|
|
3
|
-
<project timestamp="1732239781599" name="All files">
|
|
4
|
-
<metrics statements="105" coveredstatements="102" conditionals="28" coveredconditionals="27" methods="7" coveredmethods="6" elements="140" coveredelements="135" complexity="0" loc="105" ncloc="105" packages="1" files="4" classes="4"/>
|
|
5
|
-
<file name="extractProperties.ts" path="/home/runner/work/udt/udt/packages/parser-utils/src/extractProperties.ts">
|
|
6
|
-
<metrics statements="31" coveredstatements="31" conditionals="9" coveredconditionals="9" methods="1" coveredmethods="1"/>
|
|
7
|
-
<line num="20" count="1" type="cond" truecount="1" falsecount="0"/>
|
|
8
|
-
<line num="21" count="38" type="stmt"/>
|
|
9
|
-
<line num="22" count="38" type="stmt"/>
|
|
10
|
-
<line num="35" count="38" type="stmt"/>
|
|
11
|
-
<line num="36" count="38" type="stmt"/>
|
|
12
|
-
<line num="37" count="38" type="cond" truecount="1" falsecount="0"/>
|
|
13
|
-
<line num="38" count="38" type="stmt"/>
|
|
14
|
-
<line num="39" count="38" type="stmt"/>
|
|
15
|
-
<line num="40" count="38" type="cond" truecount="1" falsecount="0"/>
|
|
16
|
-
<line num="41" count="38" type="stmt"/>
|
|
17
|
-
<line num="43" count="38" type="stmt"/>
|
|
18
|
-
<line num="44" count="38" type="stmt"/>
|
|
19
|
-
<line num="45" count="38" type="cond" truecount="1" falsecount="0"/>
|
|
20
|
-
<line num="46" count="67" type="stmt"/>
|
|
21
|
-
<line num="47" count="67" type="stmt"/>
|
|
22
|
-
<line num="48" count="67" type="cond" truecount="1" falsecount="0"/>
|
|
23
|
-
<line num="49" count="67" type="cond" truecount="1" falsecount="0"/>
|
|
24
|
-
<line num="50" count="59" type="cond" truecount="1" falsecount="0"/>
|
|
25
|
-
<line num="51" count="4" type="stmt"/>
|
|
26
|
-
<line num="52" count="59" type="stmt"/>
|
|
27
|
-
<line num="53" count="67" type="cond" truecount="1" falsecount="0"/>
|
|
28
|
-
<line num="54" count="10" type="stmt"/>
|
|
29
|
-
<line num="55" count="67" type="cond" truecount="1" falsecount="0"/>
|
|
30
|
-
<line num="56" count="57" type="stmt"/>
|
|
31
|
-
<line num="57" count="57" type="stmt"/>
|
|
32
|
-
<line num="58" count="38" type="stmt"/>
|
|
33
|
-
<line num="60" count="38" type="stmt"/>
|
|
34
|
-
<line num="61" count="38" type="stmt"/>
|
|
35
|
-
<line num="62" count="38" type="stmt"/>
|
|
36
|
-
<line num="63" count="38" type="stmt"/>
|
|
37
|
-
<line num="64" count="38" type="stmt"/>
|
|
38
|
-
</file>
|
|
39
|
-
<file name="index.ts" path="/home/runner/work/udt/udt/packages/parser-utils/src/index.ts">
|
|
40
|
-
<metrics statements="3" coveredstatements="0" conditionals="1" coveredconditionals="0" methods="1" coveredmethods="0"/>
|
|
41
|
-
<line num="1" count="0" type="cond" truecount="0" falsecount="1"/>
|
|
42
|
-
<line num="2" count="0" type="stmt"/>
|
|
43
|
-
<line num="3" count="0" type="stmt"/>
|
|
44
|
-
</file>
|
|
45
|
-
<file name="isJsonObject.ts" path="/home/runner/work/udt/udt/packages/parser-utils/src/isJsonObject.ts">
|
|
46
|
-
<metrics statements="3" coveredstatements="3" conditionals="3" coveredconditionals="3" methods="1" coveredmethods="1"/>
|
|
47
|
-
<line num="17" count="1" type="cond" truecount="1" falsecount="0"/>
|
|
48
|
-
<line num="18" count="79" type="cond" truecount="2" falsecount="0"/>
|
|
49
|
-
<line num="19" count="79" type="stmt"/>
|
|
50
|
-
</file>
|
|
51
|
-
<file name="parseData.ts" path="/home/runner/work/udt/udt/packages/parser-utils/src/parseData.ts">
|
|
52
|
-
<metrics statements="68" coveredstatements="68" conditionals="15" coveredconditionals="15" methods="4" coveredmethods="4"/>
|
|
53
|
-
<line num="1" count="1" type="stmt"/>
|
|
54
|
-
<line num="152" count="1" type="cond" truecount="1" falsecount="0"/>
|
|
55
|
-
<line num="156" count="3" type="stmt"/>
|
|
56
|
-
<line num="161" count="3" type="stmt"/>
|
|
57
|
-
<line num="163" count="3" type="cond" truecount="1" falsecount="0"/>
|
|
58
|
-
<line num="164" count="3" type="stmt"/>
|
|
59
|
-
<line num="165" count="3" type="stmt"/>
|
|
60
|
-
<line num="166" count="3" type="stmt"/>
|
|
61
|
-
<line num="167" count="3" type="stmt"/>
|
|
62
|
-
<line num="168" count="3" type="stmt"/>
|
|
63
|
-
<line num="169" count="3" type="stmt"/>
|
|
64
|
-
<line num="170" count="3" type="stmt"/>
|
|
65
|
-
<line num="171" count="3" type="stmt"/>
|
|
66
|
-
<line num="172" count="3" type="stmt"/>
|
|
67
|
-
<line num="173" count="3" type="stmt"/>
|
|
68
|
-
<line num="190" count="72" type="cond" truecount="1" falsecount="0"/>
|
|
69
|
-
<line num="191" count="72" type="stmt"/>
|
|
70
|
-
<line num="192" count="72" type="stmt"/>
|
|
71
|
-
<line num="193" count="72" type="stmt"/>
|
|
72
|
-
<line num="194" count="72" type="stmt"/>
|
|
73
|
-
<line num="195" count="72" type="stmt"/>
|
|
74
|
-
<line num="196" count="72" type="stmt"/>
|
|
75
|
-
<line num="197" count="72" type="cond" truecount="1" falsecount="0"/>
|
|
76
|
-
<line num="198" count="3" type="stmt"/>
|
|
77
|
-
<line num="199" count="3" type="cond" truecount="1" falsecount="0"/>
|
|
78
|
-
<line num="201" count="69" type="stmt"/>
|
|
79
|
-
<line num="202" count="69" type="stmt"/>
|
|
80
|
-
<line num="203" count="69" type="stmt"/>
|
|
81
|
-
<line num="204" count="69" type="stmt"/>
|
|
82
|
-
<line num="205" count="69" type="stmt"/>
|
|
83
|
-
<line num="206" count="69" type="stmt"/>
|
|
84
|
-
<line num="208" count="69" type="stmt"/>
|
|
85
|
-
<line num="209" count="72" type="cond" truecount="1" falsecount="0"/>
|
|
86
|
-
<line num="211" count="35" type="stmt"/>
|
|
87
|
-
<line num="212" count="35" type="cond" truecount="2" falsecount="0"/>
|
|
88
|
-
<line num="213" count="8" type="stmt"/>
|
|
89
|
-
<line num="214" count="8" type="stmt"/>
|
|
90
|
-
<line num="215" count="72" type="cond" truecount="1" falsecount="0"/>
|
|
91
|
-
<line num="217" count="34" type="stmt"/>
|
|
92
|
-
<line num="218" count="34" type="stmt"/>
|
|
93
|
-
<line num="219" count="34" type="stmt"/>
|
|
94
|
-
<line num="220" count="34" type="stmt"/>
|
|
95
|
-
<line num="221" count="34" type="stmt"/>
|
|
96
|
-
<line num="222" count="34" type="stmt"/>
|
|
97
|
-
<line num="223" count="34" type="stmt"/>
|
|
98
|
-
<line num="225" count="34" type="stmt"/>
|
|
99
|
-
<line num="227" count="34" type="cond" truecount="2" falsecount="0"/>
|
|
100
|
-
<line num="228" count="2" type="stmt"/>
|
|
101
|
-
<line num="229" count="2" type="stmt"/>
|
|
102
|
-
<line num="231" count="34" type="cond" truecount="1" falsecount="0"/>
|
|
103
|
-
<line num="232" count="50" type="stmt"/>
|
|
104
|
-
<line num="233" count="50" type="stmt"/>
|
|
105
|
-
<line num="234" count="50" type="stmt"/>
|
|
106
|
-
<line num="235" count="50" type="stmt"/>
|
|
107
|
-
<line num="236" count="50" type="stmt"/>
|
|
108
|
-
<line num="237" count="50" type="stmt"/>
|
|
109
|
-
<line num="238" count="50" type="stmt"/>
|
|
110
|
-
<line num="239" count="50" type="cond" truecount="1" falsecount="0"/>
|
|
111
|
-
<line num="240" count="32" type="cond" truecount="1" falsecount="0"/>
|
|
112
|
-
<line num="242" count="67" type="stmt"/>
|
|
113
|
-
<line num="243" count="67" type="stmt"/>
|
|
114
|
-
<line num="265" count="1" type="cond" truecount="1" falsecount="0"/>
|
|
115
|
-
<line num="266" count="22" type="stmt"/>
|
|
116
|
-
<line num="267" count="22" type="stmt"/>
|
|
117
|
-
<line num="268" count="22" type="stmt"/>
|
|
118
|
-
<line num="269" count="22" type="stmt"/>
|
|
119
|
-
<line num="270" count="22" type="stmt"/>
|
|
120
|
-
<line num="271" count="22" type="stmt"/>
|
|
121
|
-
</file>
|
|
122
|
-
</project>
|
|
123
|
-
</coverage>
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
{"/home/runner/work/udt/udt/packages/parser-utils/src/extractProperties.ts": {"path":"/home/runner/work/udt/udt/packages/parser-utils/src/extractProperties.ts","all":false,"statementMap":{"19":{"start":{"line":20,"column":0},"end":{"line":20,"column":34}},"20":{"start":{"line":21,"column":0},"end":{"line":21,"column":22}},"21":{"start":{"line":22,"column":0},"end":{"line":22,"column":37}},"34":{"start":{"line":35,"column":0},"end":{"line":35,"column":3}},"35":{"start":{"line":36,"column":0},"end":{"line":36,"column":51}},"36":{"start":{"line":37,"column":0},"end":{"line":37,"column":38}},"37":{"start":{"line":38,"column":0},"end":{"line":38,"column":4}},"38":{"start":{"line":39,"column":0},"end":{"line":39,"column":53}},"39":{"start":{"line":40,"column":0},"end":{"line":40,"column":36}},"40":{"start":{"line":41,"column":0},"end":{"line":41,"column":4}},"42":{"start":{"line":43,"column":0},"end":{"line":43,"column":36}},"43":{"start":{"line":44,"column":0},"end":{"line":44,"column":38}},"44":{"start":{"line":45,"column":0},"end":{"line":45,"column":56}},"45":{"start":{"line":46,"column":0},"end":{"line":46,"column":8}},"46":{"start":{"line":47,"column":0},"end":{"line":47,"column":30}},"47":{"start":{"line":48,"column":0},"end":{"line":48,"column":57}},"48":{"start":{"line":49,"column":0},"end":{"line":49,"column":10}},"49":{"start":{"line":50,"column":0},"end":{"line":50,"column":55}},"50":{"start":{"line":51,"column":0},"end":{"line":51,"column":37}},"51":{"start":{"line":52,"column":0},"end":{"line":52,"column":7}},"52":{"start":{"line":53,"column":0},"end":{"line":53,"column":7}},"53":{"start":{"line":54,"column":0},"end":{"line":54,"column":37}},"54":{"start":{"line":55,"column":0},"end":{"line":55,"column":12}},"55":{"start":{"line":56,"column":0},"end":{"line":56,"column":32}},"56":{"start":{"line":57,"column":0},"end":{"line":57,"column":5}},"57":{"start":{"line":58,"column":0},"end":{"line":58,"column":5}},"59":{"start":{"line":60,"column":0},"end":{"line":60,"column":10}},"60":{"start":{"line":61,"column":0},"end":{"line":61,"column":14}},"61":{"start":{"line":62,"column":0},"end":{"line":62,"column":19}},"62":{"start":{"line":63,"column":0},"end":{"line":63,"column":4}},"63":{"start":{"line":64,"column":0},"end":{"line":64,"column":1}}},"s":{"19":1,"20":38,"21":38,"34":38,"35":38,"36":38,"37":38,"38":38,"39":38,"40":38,"42":38,"43":38,"44":38,"45":67,"46":67,"47":67,"48":67,"49":59,"50":4,"51":59,"52":67,"53":10,"54":67,"55":57,"56":57,"57":38,"59":38,"60":38,"61":38,"62":38,"63":38},"branchMap":{"0":{"type":"branch","line":20,"loc":{"start":{"line":20,"column":7},"end":{"line":64,"column":1}},"locations":[{"start":{"line":20,"column":7},"end":{"line":64,"column":1}}]},"1":{"type":"branch","line":37,"loc":{"start":{"line":37,"column":4},"end":{"line":37,"column":38}},"locations":[{"start":{"line":37,"column":4},"end":{"line":37,"column":38}}]},"2":{"type":"branch","line":40,"loc":{"start":{"line":40,"column":4},"end":{"line":40,"column":36}},"locations":[{"start":{"line":40,"column":4},"end":{"line":40,"column":36}}]},"3":{"type":"branch","line":45,"loc":{"start":{"line":45,"column":45},"end":{"line":58,"column":3}},"locations":[{"start":{"line":45,"column":45},"end":{"line":58,"column":3}}]},"4":{"type":"branch","line":49,"loc":{"start":{"line":49,"column":6},"end":{"line":52,"column":7}},"locations":[{"start":{"line":49,"column":6},"end":{"line":52,"column":7}}]},"5":{"type":"branch","line":53,"loc":{"start":{"line":53,"column":6},"end":{"line":55,"column":11}},"locations":[{"start":{"line":53,"column":6},"end":{"line":55,"column":11}}]},"6":{"type":"branch","line":55,"loc":{"start":{"line":55,"column":4},"end":{"line":57,"column":5}},"locations":[{"start":{"line":55,"column":4},"end":{"line":57,"column":5}}]},"7":{"type":"branch","line":48,"loc":{"start":{"line":48,"column":8},"end":{"line":48,"column":57}},"locations":[{"start":{"line":48,"column":8},"end":{"line":48,"column":57}}]},"8":{"type":"branch","line":50,"loc":{"start":{"line":50,"column":32},"end":{"line":51,"column":37}},"locations":[{"start":{"line":50,"column":32},"end":{"line":51,"column":37}}]}},"b":{"0":[38],"1":[22],"2":[22],"3":[67],"4":[59],"5":[10],"6":[57],"7":[51],"8":[4]},"fnMap":{"0":{"name":"extractProperties","decl":{"start":{"line":20,"column":7},"end":{"line":64,"column":1}},"loc":{"start":{"line":20,"column":7},"end":{"line":64,"column":1}},"line":20}},"f":{"0":38}}
|
|
2
|
-
,"/home/runner/work/udt/udt/packages/parser-utils/src/index.ts": {"path":"/home/runner/work/udt/udt/packages/parser-utils/src/index.ts","all":true,"statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":34}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":39}}},"s":{"0":0,"1":0,"2":0},"branchMap":{"0":{"type":"branch","line":1,"loc":{"start":{"line":1,"column":106},"end":{"line":3,"column":39}},"locations":[{"start":{"line":1,"column":106},"end":{"line":3,"column":39}}]}},"b":{"0":[0]},"fnMap":{"0":{"name":"(empty-report)","decl":{"start":{"line":1,"column":106},"end":{"line":3,"column":39}},"loc":{"start":{"line":1,"column":106},"end":{"line":3,"column":39}},"line":1}},"f":{"0":0}}
|
|
3
|
-
,"/home/runner/work/udt/udt/packages/parser-utils/src/isJsonObject.ts": {"path":"/home/runner/work/udt/udt/packages/parser-utils/src/isJsonObject.ts","all":false,"statementMap":{"16":{"start":{"line":17,"column":0},"end":{"line":17,"column":69}},"17":{"start":{"line":18,"column":0},"end":{"line":18,"column":78}},"18":{"start":{"line":19,"column":0},"end":{"line":19,"column":1}}},"s":{"16":1,"17":79,"18":79},"branchMap":{"0":{"type":"branch","line":17,"loc":{"start":{"line":17,"column":7},"end":{"line":19,"column":1}},"locations":[{"start":{"line":17,"column":7},"end":{"line":19,"column":1}}]},"1":{"type":"branch","line":18,"loc":{"start":{"line":18,"column":26},"end":{"line":18,"column":56}},"locations":[{"start":{"line":18,"column":26},"end":{"line":18,"column":56}}]},"2":{"type":"branch","line":18,"loc":{"start":{"line":18,"column":48},"end":{"line":18,"column":78}},"locations":[{"start":{"line":18,"column":48},"end":{"line":18,"column":78}}]}},"b":{"0":[79],"1":[72],"2":[71]},"fnMap":{"0":{"name":"isPlainObject","decl":{"start":{"line":17,"column":7},"end":{"line":19,"column":1}},"loc":{"start":{"line":17,"column":7},"end":{"line":19,"column":1}},"line":17}},"f":{"0":79}}
|
|
4
|
-
,"/home/runner/work/udt/udt/packages/parser-utils/src/parseData.ts": {"path":"/home/runner/work/udt/udt/packages/parser-utils/src/parseData.ts","all":false,"statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":68}},"151":{"start":{"line":152,"column":0},"end":{"line":152,"column":45}},"155":{"start":{"line":156,"column":0},"end":{"line":156,"column":24}},"160":{"start":{"line":161,"column":0},"end":{"line":161,"column":23}},"162":{"start":{"line":163,"column":0},"end":{"line":163,"column":46}},"163":{"start":{"line":164,"column":0},"end":{"line":164,"column":10}},"164":{"start":{"line":165,"column":0},"end":{"line":165,"column":44}},"165":{"start":{"line":166,"column":0},"end":{"line":166,"column":11}},"166":{"start":{"line":167,"column":0},"end":{"line":167,"column":42}},"167":{"start":{"line":168,"column":0},"end":{"line":168,"column":6}},"168":{"start":{"line":169,"column":0},"end":{"line":169,"column":35}},"169":{"start":{"line":170,"column":0},"end":{"line":170,"column":21}},"170":{"start":{"line":171,"column":0},"end":{"line":171,"column":21}},"171":{"start":{"line":172,"column":0},"end":{"line":172,"column":3}},"172":{"start":{"line":173,"column":0},"end":{"line":173,"column":1}},"189":{"start":{"line":190,"column":0},"end":{"line":190,"column":58}},"190":{"start":{"line":191,"column":0},"end":{"line":191,"column":16}},"191":{"start":{"line":192,"column":0},"end":{"line":192,"column":58}},"192":{"start":{"line":193,"column":0},"end":{"line":193,"column":24}},"193":{"start":{"line":194,"column":0},"end":{"line":194,"column":22}},"194":{"start":{"line":195,"column":0},"end":{"line":195,"column":58}},"195":{"start":{"line":196,"column":0},"end":{"line":196,"column":36}},"196":{"start":{"line":197,"column":0},"end":{"line":197,"column":29}},"197":{"start":{"line":198,"column":0},"end":{"line":198,"column":43}},"198":{"start":{"line":199,"column":0},"end":{"line":199,"column":3}},"200":{"start":{"line":201,"column":0},"end":{"line":201,"column":9}},"201":{"start":{"line":202,"column":0},"end":{"line":202,"column":22}},"202":{"start":{"line":203,"column":0},"end":{"line":203,"column":24}},"203":{"start":{"line":204,"column":0},"end":{"line":204,"column":19}},"204":{"start":{"line":205,"column":0},"end":{"line":205,"column":25}},"205":{"start":{"line":206,"column":0},"end":{"line":206,"column":13}},"207":{"start":{"line":208,"column":0},"end":{"line":208,"column":52}},"208":{"start":{"line":209,"column":0},"end":{"line":209,"column":32}},"210":{"start":{"line":211,"column":0},"end":{"line":211,"column":71}},"211":{"start":{"line":212,"column":0},"end":{"line":212,"column":41}},"212":{"start":{"line":213,"column":0},"end":{"line":213,"column":55}},"213":{"start":{"line":214,"column":0},"end":{"line":214,"column":5}},"214":{"start":{"line":215,"column":0},"end":{"line":215,"column":10}},"216":{"start":{"line":217,"column":0},"end":{"line":217,"column":64}},"217":{"start":{"line":218,"column":0},"end":{"line":218,"column":51}},"218":{"start":{"line":219,"column":0},"end":{"line":219,"column":67}},"219":{"start":{"line":220,"column":0},"end":{"line":220,"column":16}},"220":{"start":{"line":221,"column":0},"end":{"line":221,"column":11}},"221":{"start":{"line":222,"column":0},"end":{"line":222,"column":23}},"222":{"start":{"line":223,"column":0},"end":{"line":223,"column":6}},"224":{"start":{"line":225,"column":0},"end":{"line":225,"column":25}},"226":{"start":{"line":227,"column":0},"end":{"line":227,"column":41}},"227":{"start":{"line":228,"column":0},"end":{"line":228,"column":55}},"228":{"start":{"line":229,"column":0},"end":{"line":229,"column":5}},"230":{"start":{"line":231,"column":0},"end":{"line":231,"column":41}},"231":{"start":{"line":232,"column":0},"end":{"line":232,"column":20}},"232":{"start":{"line":233,"column":0},"end":{"line":233,"column":24}},"233":{"start":{"line":234,"column":0},"end":{"line":234,"column":15}},"234":{"start":{"line":235,"column":0},"end":{"line":235,"column":27}},"235":{"start":{"line":236,"column":0},"end":{"line":236,"column":29}},"236":{"start":{"line":237,"column":0},"end":{"line":237,"column":16}},"237":{"start":{"line":238,"column":0},"end":{"line":238,"column":8}},"238":{"start":{"line":239,"column":0},"end":{"line":239,"column":5}},"239":{"start":{"line":240,"column":0},"end":{"line":240,"column":3}},"241":{"start":{"line":242,"column":0},"end":{"line":242,"column":22}},"242":{"start":{"line":243,"column":0},"end":{"line":243,"column":1}},"264":{"start":{"line":265,"column":0},"end":{"line":265,"column":61}},"265":{"start":{"line":266,"column":0},"end":{"line":266,"column":16}},"266":{"start":{"line":267,"column":0},"end":{"line":267,"column":58}},"267":{"start":{"line":268,"column":0},"end":{"line":268,"column":23}},"268":{"start":{"line":269,"column":0},"end":{"line":269,"column":36}},"269":{"start":{"line":270,"column":0},"end":{"line":270,"column":56}},"270":{"start":{"line":271,"column":0},"end":{"line":271,"column":1}}},"s":{"0":1,"151":1,"155":3,"160":3,"162":3,"163":3,"164":3,"165":3,"166":3,"167":3,"168":3,"169":3,"170":3,"171":3,"172":3,"189":72,"190":72,"191":72,"192":72,"193":72,"194":72,"195":72,"196":72,"197":3,"198":3,"200":69,"201":69,"202":69,"203":69,"204":69,"205":69,"207":69,"208":72,"210":35,"211":35,"212":8,"213":8,"214":72,"216":34,"217":34,"218":34,"219":34,"220":34,"221":34,"222":34,"224":34,"226":34,"227":2,"228":2,"230":34,"231":50,"232":50,"233":50,"234":50,"235":50,"236":50,"237":50,"238":50,"239":32,"241":67,"242":67,"264":1,"265":22,"266":22,"267":22,"268":22,"269":22,"270":22},"branchMap":{"0":{"type":"branch","line":152,"loc":{"start":{"line":152,"column":7},"end":{"line":173,"column":1}},"locations":[{"start":{"line":152,"column":7},"end":{"line":173,"column":1}}]},"1":{"type":"branch","line":163,"loc":{"start":{"line":163,"column":2},"end":{"line":172,"column":3}},"locations":[{"start":{"line":163,"column":2},"end":{"line":172,"column":3}}]},"2":{"type":"branch","line":190,"loc":{"start":{"line":190,"column":0},"end":{"line":243,"column":1}},"locations":[{"start":{"line":190,"column":0},"end":{"line":243,"column":1}}]},"3":{"type":"branch","line":197,"loc":{"start":{"line":197,"column":28},"end":{"line":199,"column":3}},"locations":[{"start":{"line":197,"column":28},"end":{"line":199,"column":3}}]},"4":{"type":"branch","line":199,"loc":{"start":{"line":199,"column":2},"end":{"line":209,"column":31}},"locations":[{"start":{"line":199,"column":2},"end":{"line":209,"column":31}}]},"5":{"type":"branch","line":209,"loc":{"start":{"line":209,"column":31},"end":{"line":215,"column":9}},"locations":[{"start":{"line":209,"column":31},"end":{"line":215,"column":9}}]},"6":{"type":"branch","line":212,"loc":{"start":{"line":212,"column":8},"end":{"line":212,"column":40}},"locations":[{"start":{"line":212,"column":8},"end":{"line":212,"column":40}}]},"7":{"type":"branch","line":212,"loc":{"start":{"line":212,"column":40},"end":{"line":214,"column":5}},"locations":[{"start":{"line":212,"column":40},"end":{"line":214,"column":5}}]},"8":{"type":"branch","line":215,"loc":{"start":{"line":215,"column":2},"end":{"line":240,"column":3}},"locations":[{"start":{"line":215,"column":2},"end":{"line":240,"column":3}}]},"9":{"type":"branch","line":227,"loc":{"start":{"line":227,"column":8},"end":{"line":227,"column":40}},"locations":[{"start":{"line":227,"column":8},"end":{"line":227,"column":40}}]},"10":{"type":"branch","line":227,"loc":{"start":{"line":227,"column":40},"end":{"line":229,"column":5}},"locations":[{"start":{"line":227,"column":40},"end":{"line":229,"column":5}}]},"11":{"type":"branch","line":231,"loc":{"start":{"line":231,"column":40},"end":{"line":239,"column":5}},"locations":[{"start":{"line":231,"column":40},"end":{"line":239,"column":5}}]},"12":{"type":"branch","line":239,"loc":{"start":{"line":239,"column":4},"end":{"line":240,"column":3}},"locations":[{"start":{"line":239,"column":4},"end":{"line":240,"column":3}}]},"13":{"type":"branch","line":240,"loc":{"start":{"line":240,"column":2},"end":{"line":243,"column":1}},"locations":[{"start":{"line":240,"column":2},"end":{"line":243,"column":1}}]},"14":{"type":"branch","line":265,"loc":{"start":{"line":265,"column":7},"end":{"line":271,"column":1}},"locations":[{"start":{"line":265,"column":7},"end":{"line":271,"column":1}}]}},"b":{"0":[3],"1":[3],"2":[72],"3":[3],"4":[69],"5":[35],"6":[8],"7":[8],"8":[34],"9":[2],"10":[2],"11":[50],"12":[32],"13":[67],"14":[22]},"fnMap":{"0":{"name":"<instance_members_initializer>","decl":{"start":{"line":152,"column":7},"end":{"line":173,"column":1}},"loc":{"start":{"line":152,"column":7},"end":{"line":173,"column":1}},"line":152},"1":{"name":"InvalidDataError","decl":{"start":{"line":163,"column":2},"end":{"line":172,"column":3}},"loc":{"start":{"line":163,"column":2},"end":{"line":172,"column":3}},"line":163},"2":{"name":"parseDataImpl","decl":{"start":{"line":190,"column":0},"end":{"line":243,"column":1}},"loc":{"start":{"line":190,"column":0},"end":{"line":243,"column":1}},"line":190},"3":{"name":"parseData","decl":{"start":{"line":265,"column":7},"end":{"line":271,"column":1}},"loc":{"start":{"line":265,"column":7},"end":{"line":271,"column":1}},"line":265}},"f":{"0":3,"1":3,"2":72,"3":22}}
|
|
5
|
-
}
|
|
@@ -1,277 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html lang="en">
|
|
4
|
-
|
|
5
|
-
<head>
|
|
6
|
-
<title>Code coverage report for extractProperties.ts</title>
|
|
7
|
-
<meta charset="utf-8" />
|
|
8
|
-
<link rel="stylesheet" href="prettify.css" />
|
|
9
|
-
<link rel="stylesheet" href="base.css" />
|
|
10
|
-
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
|
|
11
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
|
-
<style type='text/css'>
|
|
13
|
-
.coverage-summary .sorter {
|
|
14
|
-
background-image: url(sort-arrow-sprite.png);
|
|
15
|
-
}
|
|
16
|
-
</style>
|
|
17
|
-
</head>
|
|
18
|
-
|
|
19
|
-
<body>
|
|
20
|
-
<div class='wrapper'>
|
|
21
|
-
<div class='pad1'>
|
|
22
|
-
<h1><a href="index.html">All files</a> extractProperties.ts</h1>
|
|
23
|
-
<div class='clearfix'>
|
|
24
|
-
|
|
25
|
-
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">100% </span>
|
|
27
|
-
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>31/31</span>
|
|
29
|
-
</div>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">100% </span>
|
|
34
|
-
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>9/9</span>
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">100% </span>
|
|
41
|
-
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>1/1</span>
|
|
43
|
-
</div>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">100% </span>
|
|
48
|
-
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>31/31</span>
|
|
50
|
-
</div>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
</div>
|
|
54
|
-
<p class="quiet">
|
|
55
|
-
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
|
-
</p>
|
|
57
|
-
<template id="filterTemplate">
|
|
58
|
-
<div class="quiet">
|
|
59
|
-
Filter:
|
|
60
|
-
<input type="search" id="fileSearch">
|
|
61
|
-
</div>
|
|
62
|
-
</template>
|
|
63
|
-
</div>
|
|
64
|
-
<div class='status-line high'></div>
|
|
65
|
-
<pre><table class="coverage">
|
|
66
|
-
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
67
|
-
<a name='L2'></a><a href='#L2'>2</a>
|
|
68
|
-
<a name='L3'></a><a href='#L3'>3</a>
|
|
69
|
-
<a name='L4'></a><a href='#L4'>4</a>
|
|
70
|
-
<a name='L5'></a><a href='#L5'>5</a>
|
|
71
|
-
<a name='L6'></a><a href='#L6'>6</a>
|
|
72
|
-
<a name='L7'></a><a href='#L7'>7</a>
|
|
73
|
-
<a name='L8'></a><a href='#L8'>8</a>
|
|
74
|
-
<a name='L9'></a><a href='#L9'>9</a>
|
|
75
|
-
<a name='L10'></a><a href='#L10'>10</a>
|
|
76
|
-
<a name='L11'></a><a href='#L11'>11</a>
|
|
77
|
-
<a name='L12'></a><a href='#L12'>12</a>
|
|
78
|
-
<a name='L13'></a><a href='#L13'>13</a>
|
|
79
|
-
<a name='L14'></a><a href='#L14'>14</a>
|
|
80
|
-
<a name='L15'></a><a href='#L15'>15</a>
|
|
81
|
-
<a name='L16'></a><a href='#L16'>16</a>
|
|
82
|
-
<a name='L17'></a><a href='#L17'>17</a>
|
|
83
|
-
<a name='L18'></a><a href='#L18'>18</a>
|
|
84
|
-
<a name='L19'></a><a href='#L19'>19</a>
|
|
85
|
-
<a name='L20'></a><a href='#L20'>20</a>
|
|
86
|
-
<a name='L21'></a><a href='#L21'>21</a>
|
|
87
|
-
<a name='L22'></a><a href='#L22'>22</a>
|
|
88
|
-
<a name='L23'></a><a href='#L23'>23</a>
|
|
89
|
-
<a name='L24'></a><a href='#L24'>24</a>
|
|
90
|
-
<a name='L25'></a><a href='#L25'>25</a>
|
|
91
|
-
<a name='L26'></a><a href='#L26'>26</a>
|
|
92
|
-
<a name='L27'></a><a href='#L27'>27</a>
|
|
93
|
-
<a name='L28'></a><a href='#L28'>28</a>
|
|
94
|
-
<a name='L29'></a><a href='#L29'>29</a>
|
|
95
|
-
<a name='L30'></a><a href='#L30'>30</a>
|
|
96
|
-
<a name='L31'></a><a href='#L31'>31</a>
|
|
97
|
-
<a name='L32'></a><a href='#L32'>32</a>
|
|
98
|
-
<a name='L33'></a><a href='#L33'>33</a>
|
|
99
|
-
<a name='L34'></a><a href='#L34'>34</a>
|
|
100
|
-
<a name='L35'></a><a href='#L35'>35</a>
|
|
101
|
-
<a name='L36'></a><a href='#L36'>36</a>
|
|
102
|
-
<a name='L37'></a><a href='#L37'>37</a>
|
|
103
|
-
<a name='L38'></a><a href='#L38'>38</a>
|
|
104
|
-
<a name='L39'></a><a href='#L39'>39</a>
|
|
105
|
-
<a name='L40'></a><a href='#L40'>40</a>
|
|
106
|
-
<a name='L41'></a><a href='#L41'>41</a>
|
|
107
|
-
<a name='L42'></a><a href='#L42'>42</a>
|
|
108
|
-
<a name='L43'></a><a href='#L43'>43</a>
|
|
109
|
-
<a name='L44'></a><a href='#L44'>44</a>
|
|
110
|
-
<a name='L45'></a><a href='#L45'>45</a>
|
|
111
|
-
<a name='L46'></a><a href='#L46'>46</a>
|
|
112
|
-
<a name='L47'></a><a href='#L47'>47</a>
|
|
113
|
-
<a name='L48'></a><a href='#L48'>48</a>
|
|
114
|
-
<a name='L49'></a><a href='#L49'>49</a>
|
|
115
|
-
<a name='L50'></a><a href='#L50'>50</a>
|
|
116
|
-
<a name='L51'></a><a href='#L51'>51</a>
|
|
117
|
-
<a name='L52'></a><a href='#L52'>52</a>
|
|
118
|
-
<a name='L53'></a><a href='#L53'>53</a>
|
|
119
|
-
<a name='L54'></a><a href='#L54'>54</a>
|
|
120
|
-
<a name='L55'></a><a href='#L55'>55</a>
|
|
121
|
-
<a name='L56'></a><a href='#L56'>56</a>
|
|
122
|
-
<a name='L57'></a><a href='#L57'>57</a>
|
|
123
|
-
<a name='L58'></a><a href='#L58'>58</a>
|
|
124
|
-
<a name='L59'></a><a href='#L59'>59</a>
|
|
125
|
-
<a name='L60'></a><a href='#L60'>60</a>
|
|
126
|
-
<a name='L61'></a><a href='#L61'>61</a>
|
|
127
|
-
<a name='L62'></a><a href='#L62'>62</a>
|
|
128
|
-
<a name='L63'></a><a href='#L63'>63</a>
|
|
129
|
-
<a name='L64'></a><a href='#L64'>64</a>
|
|
130
|
-
<a name='L65'></a><a href='#L65'>65</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
131
|
-
<span class="cline-any cline-neutral"> </span>
|
|
132
|
-
<span class="cline-any cline-neutral"> </span>
|
|
133
|
-
<span class="cline-any cline-neutral"> </span>
|
|
134
|
-
<span class="cline-any cline-neutral"> </span>
|
|
135
|
-
<span class="cline-any cline-neutral"> </span>
|
|
136
|
-
<span class="cline-any cline-neutral"> </span>
|
|
137
|
-
<span class="cline-any cline-neutral"> </span>
|
|
138
|
-
<span class="cline-any cline-neutral"> </span>
|
|
139
|
-
<span class="cline-any cline-neutral"> </span>
|
|
140
|
-
<span class="cline-any cline-neutral"> </span>
|
|
141
|
-
<span class="cline-any cline-neutral"> </span>
|
|
142
|
-
<span class="cline-any cline-neutral"> </span>
|
|
143
|
-
<span class="cline-any cline-neutral"> </span>
|
|
144
|
-
<span class="cline-any cline-neutral"> </span>
|
|
145
|
-
<span class="cline-any cline-neutral"> </span>
|
|
146
|
-
<span class="cline-any cline-neutral"> </span>
|
|
147
|
-
<span class="cline-any cline-neutral"> </span>
|
|
148
|
-
<span class="cline-any cline-neutral"> </span>
|
|
149
|
-
<span class="cline-any cline-yes">1x</span>
|
|
150
|
-
<span class="cline-any cline-yes">38x</span>
|
|
151
|
-
<span class="cline-any cline-yes">38x</span>
|
|
152
|
-
<span class="cline-any cline-neutral"> </span>
|
|
153
|
-
<span class="cline-any cline-neutral"> </span>
|
|
154
|
-
<span class="cline-any cline-neutral"> </span>
|
|
155
|
-
<span class="cline-any cline-neutral"> </span>
|
|
156
|
-
<span class="cline-any cline-neutral"> </span>
|
|
157
|
-
<span class="cline-any cline-neutral"> </span>
|
|
158
|
-
<span class="cline-any cline-neutral"> </span>
|
|
159
|
-
<span class="cline-any cline-neutral"> </span>
|
|
160
|
-
<span class="cline-any cline-neutral"> </span>
|
|
161
|
-
<span class="cline-any cline-neutral"> </span>
|
|
162
|
-
<span class="cline-any cline-neutral"> </span>
|
|
163
|
-
<span class="cline-any cline-neutral"> </span>
|
|
164
|
-
<span class="cline-any cline-yes">38x</span>
|
|
165
|
-
<span class="cline-any cline-yes">38x</span>
|
|
166
|
-
<span class="cline-any cline-yes">38x</span>
|
|
167
|
-
<span class="cline-any cline-yes">38x</span>
|
|
168
|
-
<span class="cline-any cline-yes">38x</span>
|
|
169
|
-
<span class="cline-any cline-yes">38x</span>
|
|
170
|
-
<span class="cline-any cline-yes">38x</span>
|
|
171
|
-
<span class="cline-any cline-neutral"> </span>
|
|
172
|
-
<span class="cline-any cline-yes">38x</span>
|
|
173
|
-
<span class="cline-any cline-yes">38x</span>
|
|
174
|
-
<span class="cline-any cline-yes">38x</span>
|
|
175
|
-
<span class="cline-any cline-yes">67x</span>
|
|
176
|
-
<span class="cline-any cline-yes">67x</span>
|
|
177
|
-
<span class="cline-any cline-yes">67x</span>
|
|
178
|
-
<span class="cline-any cline-yes">67x</span>
|
|
179
|
-
<span class="cline-any cline-yes">59x</span>
|
|
180
|
-
<span class="cline-any cline-yes">4x</span>
|
|
181
|
-
<span class="cline-any cline-yes">59x</span>
|
|
182
|
-
<span class="cline-any cline-yes">67x</span>
|
|
183
|
-
<span class="cline-any cline-yes">10x</span>
|
|
184
|
-
<span class="cline-any cline-yes">67x</span>
|
|
185
|
-
<span class="cline-any cline-yes">57x</span>
|
|
186
|
-
<span class="cline-any cline-yes">57x</span>
|
|
187
|
-
<span class="cline-any cline-yes">38x</span>
|
|
188
|
-
<span class="cline-any cline-neutral"> </span>
|
|
189
|
-
<span class="cline-any cline-yes">38x</span>
|
|
190
|
-
<span class="cline-any cline-yes">38x</span>
|
|
191
|
-
<span class="cline-any cline-yes">38x</span>
|
|
192
|
-
<span class="cline-any cline-yes">38x</span>
|
|
193
|
-
<span class="cline-any cline-yes">38x</span>
|
|
194
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { type PlainObject } from "./isJsonObject.js";
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* Extracts specfied properties and their values from
|
|
198
|
-
* an object.
|
|
199
|
-
*
|
|
200
|
-
* A bit like destructuring, except that you can also use
|
|
201
|
-
* regular expressions to match the properties you want to
|
|
202
|
-
* extract.
|
|
203
|
-
*
|
|
204
|
-
* @param object The plain object from which to extract
|
|
205
|
-
* properties.
|
|
206
|
-
* @param propsToExtract An array of names, and/or
|
|
207
|
-
* regular expressions that match the
|
|
208
|
-
* names of the properties to exract.
|
|
209
|
-
* @returns The object containing the extracted properties
|
|
210
|
-
* and their values, and an array of all property
|
|
211
|
-
* names of the input object that were not extracted.
|
|
212
|
-
*/
|
|
213
|
-
export function extractProperties(
|
|
214
|
-
object: PlainObject,
|
|
215
|
-
propsToExtract: (string | RegExp)[]
|
|
216
|
-
): {
|
|
217
|
-
/**
|
|
218
|
-
* Object containg the extract properties
|
|
219
|
-
* and their respective values.
|
|
220
|
-
*/
|
|
221
|
-
extracted: PlainObject;
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* Array of property names of the input
|
|
225
|
-
* object that were not extracted.
|
|
226
|
-
*/
|
|
227
|
-
remainingProps: string[];
|
|
228
|
-
} {
|
|
229
|
-
const propNamesToExtract = propsToExtract.filter(
|
|
230
|
-
(prop) => typeof prop === "string"
|
|
231
|
-
);
|
|
232
|
-
const propRegexesToExtract = propsToExtract.filter(
|
|
233
|
-
(prop) => prop instanceof RegExp
|
|
234
|
-
);
|
|
235
|
-
|
|
236
|
-
const extracted: PlainObject = {};
|
|
237
|
-
const remainingProps: string[] = [];
|
|
238
|
-
Object.getOwnPropertyNames(object).forEach((prop) => {
|
|
239
|
-
if (
|
|
240
|
-
propNamesToExtract.some(
|
|
241
|
-
(propNameToExtract) => propNameToExtract === prop
|
|
242
|
-
) ||
|
|
243
|
-
propRegexesToExtract.some((propRegexToExtract) =>
|
|
244
|
-
propRegexToExtract.test(prop)
|
|
245
|
-
)
|
|
246
|
-
) {
|
|
247
|
-
extracted[prop] = object[prop];
|
|
248
|
-
} else {
|
|
249
|
-
remainingProps.push(prop);
|
|
250
|
-
}
|
|
251
|
-
});
|
|
252
|
-
|
|
253
|
-
return {
|
|
254
|
-
extracted,
|
|
255
|
-
remainingProps,
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
</pre></td></tr></table></pre>
|
|
259
|
-
|
|
260
|
-
<div class='push'></div><!-- for sticky footer -->
|
|
261
|
-
</div><!-- /wrapper -->
|
|
262
|
-
<div class='footer quiet pad2 space-top1 center small'>
|
|
263
|
-
Code coverage generated by
|
|
264
|
-
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
265
|
-
at 2024-11-22T01:43:01.579Z
|
|
266
|
-
</div>
|
|
267
|
-
<script src="prettify.js"></script>
|
|
268
|
-
<script>
|
|
269
|
-
window.onload = function () {
|
|
270
|
-
prettyPrint();
|
|
271
|
-
};
|
|
272
|
-
</script>
|
|
273
|
-
<script src="sorter.js"></script>
|
|
274
|
-
<script src="block-navigation.js"></script>
|
|
275
|
-
</body>
|
|
276
|
-
</html>
|
|
277
|
-
|
package/coverage/favicon.png
DELETED
|
Binary file
|