@grnsft/if 1.0.0 → 1.0.2

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.
Files changed (218) hide show
  1. package/build/common/util/helpers.d.ts +3 -2
  2. package/build/common/util/helpers.js +6 -18
  3. package/build/if-check/index.js +3 -13
  4. package/build/if-check/util/helpers.js +4 -4
  5. package/build/if-check/util/npm.d.ts +2 -2
  6. package/build/if-check/util/npm.js +32 -62
  7. package/build/if-run/builtins/divide/index.js +2 -2
  8. package/build/if-run/builtins/sci/index.js +2 -2
  9. package/build/if-run/config/strings.js +3 -3
  10. package/build/if-run/lib/compute.js +22 -5
  11. package/build/if-run/lib/environment.js +10 -14
  12. package/build/if-run/util/os-checker.js +14 -10
  13. package/jest.config.js +6 -2
  14. package/package.json +11 -10
  15. package/.env +0 -5
  16. package/coverage/clover.xml +0 -2062
  17. package/coverage/coverage-final.json +0 -58
  18. package/coverage/lcov-report/base.css +0 -224
  19. package/coverage/lcov-report/block-navigation.js +0 -87
  20. package/coverage/lcov-report/builtins/coefficient/index.html +0 -116
  21. package/coverage/lcov-report/builtins/coefficient/index.ts.html +0 -298
  22. package/coverage/lcov-report/builtins/csv-lookup/index.html +0 -116
  23. package/coverage/lcov-report/builtins/csv-lookup/index.ts.html +0 -826
  24. package/coverage/lcov-report/builtins/divide/index.html +0 -116
  25. package/coverage/lcov-report/builtins/divide/index.ts.html +0 -358
  26. package/coverage/lcov-report/builtins/exponent/index.html +0 -116
  27. package/coverage/lcov-report/builtins/exponent/index.ts.html +0 -361
  28. package/coverage/lcov-report/builtins/export-csv-raw.ts.html +0 -553
  29. package/coverage/lcov-report/builtins/export-csv.ts.html +0 -436
  30. package/coverage/lcov-report/builtins/export-log.ts.html +0 -148
  31. package/coverage/lcov-report/builtins/export-yaml.ts.html +0 -193
  32. package/coverage/lcov-report/builtins/group-by.ts.html +0 -370
  33. package/coverage/lcov-report/builtins/index.html +0 -206
  34. package/coverage/lcov-report/builtins/index.ts.html +0 -130
  35. package/coverage/lcov-report/builtins/interpolation/index.html +0 -116
  36. package/coverage/lcov-report/builtins/interpolation/index.ts.html +0 -676
  37. package/coverage/lcov-report/builtins/interpolation/types.ts.html +0 -100
  38. package/coverage/lcov-report/builtins/mock-observations/helpers/common-generator.ts.html +0 -184
  39. package/coverage/lcov-report/builtins/mock-observations/helpers/index.html +0 -131
  40. package/coverage/lcov-report/builtins/mock-observations/helpers/rand-int-generator.ts.html +0 -289
  41. package/coverage/lcov-report/builtins/mock-observations/index.html +0 -116
  42. package/coverage/lcov-report/builtins/mock-observations/index.ts.html +0 -619
  43. package/coverage/lcov-report/builtins/multiply/index.html +0 -116
  44. package/coverage/lcov-report/builtins/multiply/index.ts.html +0 -343
  45. package/coverage/lcov-report/builtins/regex/index.html +0 -116
  46. package/coverage/lcov-report/builtins/regex/index.ts.html +0 -373
  47. package/coverage/lcov-report/builtins/sci/config.ts.html +0 -205
  48. package/coverage/lcov-report/builtins/sci/index.html +0 -116
  49. package/coverage/lcov-report/builtins/sci/index.ts.html +0 -325
  50. package/coverage/lcov-report/builtins/sci-embodied/index.html +0 -116
  51. package/coverage/lcov-report/builtins/sci-embodied/index.ts.html +0 -478
  52. package/coverage/lcov-report/builtins/shell/index.html +0 -116
  53. package/coverage/lcov-report/builtins/shell/index.ts.html +0 -280
  54. package/coverage/lcov-report/builtins/subtract/index.html +0 -116
  55. package/coverage/lcov-report/builtins/subtract/index.ts.html +0 -379
  56. package/coverage/lcov-report/builtins/sum/index.html +0 -116
  57. package/coverage/lcov-report/builtins/sum/index.ts.html +0 -334
  58. package/coverage/lcov-report/builtins/time-sync.ts.html +0 -1462
  59. package/coverage/lcov-report/common/config/index.html +0 -131
  60. package/coverage/lcov-report/common/config/index.ts.html +0 -88
  61. package/coverage/lcov-report/common/config/strings.ts.html +0 -121
  62. package/coverage/lcov-report/common/lib/index.html +0 -116
  63. package/coverage/lcov-report/common/lib/load.ts.html +0 -139
  64. package/coverage/lcov-report/common/util/debug-logger.ts.html +0 -514
  65. package/coverage/lcov-report/common/util/fs.ts.html +0 -289
  66. package/coverage/lcov-report/common/util/helpers.ts.html +0 -355
  67. package/coverage/lcov-report/common/util/index.html +0 -191
  68. package/coverage/lcov-report/common/util/logger.ts.html +0 -151
  69. package/coverage/lcov-report/common/util/validations.ts.html +0 -628
  70. package/coverage/lcov-report/common/util/yaml.ts.html +0 -226
  71. package/coverage/lcov-report/config/config.ts.html +0 -463
  72. package/coverage/lcov-report/config/index.html +0 -161
  73. package/coverage/lcov-report/config/index.ts.html +0 -94
  74. package/coverage/lcov-report/config/params.ts.html +0 -697
  75. package/coverage/lcov-report/config/strings.ts.html +0 -490
  76. package/coverage/lcov-report/favicon.png +0 -0
  77. package/coverage/lcov-report/if-check/config/config.ts.html +0 -184
  78. package/coverage/lcov-report/if-check/config/index.html +0 -146
  79. package/coverage/lcov-report/if-check/config/index.ts.html +0 -91
  80. package/coverage/lcov-report/if-check/config/strings.ts.html +0 -142
  81. package/coverage/lcov-report/if-check/util/args.ts.html +0 -310
  82. package/coverage/lcov-report/if-check/util/helpers.ts.html +0 -136
  83. package/coverage/lcov-report/if-check/util/index.html +0 -146
  84. package/coverage/lcov-report/if-check/util/npm.ts.html +0 -376
  85. package/coverage/lcov-report/if-csv/util/args.ts.html +0 -256
  86. package/coverage/lcov-report/if-csv/util/helpers.ts.html +0 -346
  87. package/coverage/lcov-report/if-csv/util/index.html +0 -131
  88. package/coverage/lcov-report/if-diff/config/config.ts.html +0 -184
  89. package/coverage/lcov-report/if-diff/config/index.html +0 -146
  90. package/coverage/lcov-report/if-diff/config/index.ts.html +0 -91
  91. package/coverage/lcov-report/if-diff/config/strings.ts.html +0 -100
  92. package/coverage/lcov-report/if-diff/lib/compare.ts.html +0 -286
  93. package/coverage/lcov-report/if-diff/lib/index.html +0 -131
  94. package/coverage/lcov-report/if-diff/lib/load.ts.html +0 -199
  95. package/coverage/lcov-report/if-diff/util/args.ts.html +0 -274
  96. package/coverage/lcov-report/if-diff/util/helpers.ts.html +0 -337
  97. package/coverage/lcov-report/if-diff/util/index.html +0 -131
  98. package/coverage/lcov-report/if-env/config/config.ts.html +0 -211
  99. package/coverage/lcov-report/if-env/config/index.html +0 -146
  100. package/coverage/lcov-report/if-env/config/index.ts.html +0 -91
  101. package/coverage/lcov-report/if-env/config/strings.ts.html +0 -109
  102. package/coverage/lcov-report/if-env/util/args.ts.html +0 -256
  103. package/coverage/lcov-report/if-env/util/index.html +0 -131
  104. package/coverage/lcov-report/if-env/util/npm.ts.html +0 -526
  105. package/coverage/lcov-report/if-merge/util/args.ts.html +0 -301
  106. package/coverage/lcov-report/if-merge/util/helpers.ts.html +0 -313
  107. package/coverage/lcov-report/if-merge/util/index.html +0 -131
  108. package/coverage/lcov-report/if-run/builtins/coefficient/index.html +0 -116
  109. package/coverage/lcov-report/if-run/builtins/coefficient/index.ts.html +0 -286
  110. package/coverage/lcov-report/if-run/builtins/copy-param/index.html +0 -116
  111. package/coverage/lcov-report/if-run/builtins/copy-param/index.ts.html +0 -301
  112. package/coverage/lcov-report/if-run/builtins/csv-import/index.html +0 -116
  113. package/coverage/lcov-report/if-run/builtins/csv-import/index.ts.html +0 -364
  114. package/coverage/lcov-report/if-run/builtins/csv-lookup/index.html +0 -116
  115. package/coverage/lcov-report/if-run/builtins/csv-lookup/index.ts.html +0 -478
  116. package/coverage/lcov-report/if-run/builtins/divide/index.html +0 -116
  117. package/coverage/lcov-report/if-run/builtins/divide/index.ts.html +0 -346
  118. package/coverage/lcov-report/if-run/builtins/exponent/index.html +0 -116
  119. package/coverage/lcov-report/if-run/builtins/exponent/index.ts.html +0 -319
  120. package/coverage/lcov-report/if-run/builtins/export-csv-raw.ts.html +0 -553
  121. package/coverage/lcov-report/if-run/builtins/export-csv.ts.html +0 -436
  122. package/coverage/lcov-report/if-run/builtins/export-log.ts.html +0 -148
  123. package/coverage/lcov-report/if-run/builtins/export-yaml.ts.html +0 -193
  124. package/coverage/lcov-report/if-run/builtins/group-by.ts.html +0 -370
  125. package/coverage/lcov-report/if-run/builtins/index.html +0 -146
  126. package/coverage/lcov-report/if-run/builtins/index.ts.html +0 -136
  127. package/coverage/lcov-report/if-run/builtins/interpolation/index.html +0 -116
  128. package/coverage/lcov-report/if-run/builtins/interpolation/index.ts.html +0 -643
  129. package/coverage/lcov-report/if-run/builtins/mock-observations/helpers/common-generator.ts.html +0 -184
  130. package/coverage/lcov-report/if-run/builtins/mock-observations/helpers/index.html +0 -131
  131. package/coverage/lcov-report/if-run/builtins/mock-observations/helpers/rand-int-generator.ts.html +0 -289
  132. package/coverage/lcov-report/if-run/builtins/mock-observations/index.html +0 -116
  133. package/coverage/lcov-report/if-run/builtins/mock-observations/index.ts.html +0 -607
  134. package/coverage/lcov-report/if-run/builtins/multiply/index.html +0 -116
  135. package/coverage/lcov-report/if-run/builtins/multiply/index.ts.html +0 -289
  136. package/coverage/lcov-report/if-run/builtins/regex/index.html +0 -116
  137. package/coverage/lcov-report/if-run/builtins/regex/index.ts.html +0 -298
  138. package/coverage/lcov-report/if-run/builtins/sci/index.html +0 -116
  139. package/coverage/lcov-report/if-run/builtins/sci/index.ts.html +0 -418
  140. package/coverage/lcov-report/if-run/builtins/sci-embodied/index.html +0 -116
  141. package/coverage/lcov-report/if-run/builtins/sci-embodied/index.ts.html +0 -664
  142. package/coverage/lcov-report/if-run/builtins/shell/index.html +0 -116
  143. package/coverage/lcov-report/if-run/builtins/shell/index.ts.html +0 -256
  144. package/coverage/lcov-report/if-run/builtins/subtract/index.html +0 -116
  145. package/coverage/lcov-report/if-run/builtins/subtract/index.ts.html +0 -298
  146. package/coverage/lcov-report/if-run/builtins/sum/index.html +0 -116
  147. package/coverage/lcov-report/if-run/builtins/sum/index.ts.html +0 -238
  148. package/coverage/lcov-report/if-run/builtins/time-converter/config.ts.html +0 -205
  149. package/coverage/lcov-report/if-run/builtins/time-converter/index.html +0 -131
  150. package/coverage/lcov-report/if-run/builtins/time-converter/index.ts.html +0 -328
  151. package/coverage/lcov-report/if-run/builtins/time-sync/index.html +0 -116
  152. package/coverage/lcov-report/if-run/builtins/time-sync/index.ts.html +0 -1804
  153. package/coverage/lcov-report/if-run/builtins/time-sync.ts.html +0 -1462
  154. package/coverage/lcov-report/if-run/builtins/util/csv-helpers.ts.html +0 -376
  155. package/coverage/lcov-report/if-run/builtins/util/index.html +0 -116
  156. package/coverage/lcov-report/if-run/config/config.ts.html +0 -271
  157. package/coverage/lcov-report/if-run/config/index.html +0 -161
  158. package/coverage/lcov-report/if-run/config/index.ts.html +0 -94
  159. package/coverage/lcov-report/if-run/config/params.ts.html +0 -679
  160. package/coverage/lcov-report/if-run/config/strings.ts.html +0 -460
  161. package/coverage/lcov-report/if-run/lib/aggregate.ts.html +0 -577
  162. package/coverage/lcov-report/if-run/lib/compute.ts.html +0 -733
  163. package/coverage/lcov-report/if-run/lib/environment.ts.html +0 -373
  164. package/coverage/lcov-report/if-run/lib/exhaust.ts.html +0 -193
  165. package/coverage/lcov-report/if-run/lib/explain.ts.html +0 -484
  166. package/coverage/lcov-report/if-run/lib/index.html +0 -206
  167. package/coverage/lcov-report/if-run/lib/initialize.ts.html +0 -490
  168. package/coverage/lcov-report/if-run/lib/parameterize.ts.html +0 -322
  169. package/coverage/lcov-report/if-run/lib/regroup.ts.html +0 -349
  170. package/coverage/lcov-report/if-run/lib/time-sync.ts.html +0 -1510
  171. package/coverage/lcov-report/if-run/types/aggregation.ts.html +0 -94
  172. package/coverage/lcov-report/if-run/types/index.html +0 -146
  173. package/coverage/lcov-report/if-run/types/interface.ts.html +0 -112
  174. package/coverage/lcov-report/if-run/types/parameters.ts.html +0 -106
  175. package/coverage/lcov-report/if-run/util/aggregation-helper.ts.html +0 -277
  176. package/coverage/lcov-report/if-run/util/args.ts.html +0 -325
  177. package/coverage/lcov-report/if-run/util/helpers.ts.html +0 -208
  178. package/coverage/lcov-report/if-run/util/index.html +0 -191
  179. package/coverage/lcov-report/if-run/util/json.ts.html +0 -115
  180. package/coverage/lcov-report/if-run/util/log-memoize.ts.html +0 -145
  181. package/coverage/lcov-report/if-run/util/os-checker.ts.html +0 -421
  182. package/coverage/lcov-report/if-run/util/plugin-storage.ts.html +0 -202
  183. package/coverage/lcov-report/index.html +0 -551
  184. package/coverage/lcov-report/lib/aggregate.ts.html +0 -358
  185. package/coverage/lcov-report/lib/compare.ts.html +0 -286
  186. package/coverage/lcov-report/lib/compute.ts.html +0 -436
  187. package/coverage/lcov-report/lib/environment.ts.html +0 -376
  188. package/coverage/lcov-report/lib/exhaust.ts.html +0 -289
  189. package/coverage/lcov-report/lib/index.html +0 -221
  190. package/coverage/lcov-report/lib/initialize.ts.html +0 -430
  191. package/coverage/lcov-report/lib/load.ts.html +0 -268
  192. package/coverage/lcov-report/lib/parameterize.ts.html +0 -316
  193. package/coverage/lcov-report/prettify.css +0 -1
  194. package/coverage/lcov-report/prettify.js +0 -2
  195. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  196. package/coverage/lcov-report/sorter.js +0 -196
  197. package/coverage/lcov-report/types/aggregation.ts.html +0 -94
  198. package/coverage/lcov-report/types/index.html +0 -146
  199. package/coverage/lcov-report/types/interface.ts.html +0 -112
  200. package/coverage/lcov-report/types/parameters.ts.html +0 -106
  201. package/coverage/lcov-report/util/aggregation-helper.ts.html +0 -289
  202. package/coverage/lcov-report/util/args.ts.html +0 -649
  203. package/coverage/lcov-report/util/debug-logger.ts.html +0 -481
  204. package/coverage/lcov-report/util/errors.ts.html +0 -232
  205. package/coverage/lcov-report/util/fs.ts.html +0 -124
  206. package/coverage/lcov-report/util/helpers.ts.html +0 -895
  207. package/coverage/lcov-report/util/index.html +0 -296
  208. package/coverage/lcov-report/util/json.ts.html +0 -115
  209. package/coverage/lcov-report/util/log-memoize.ts.html +0 -145
  210. package/coverage/lcov-report/util/logger.ts.html +0 -151
  211. package/coverage/lcov-report/util/npm.ts.html +0 -499
  212. package/coverage/lcov-report/util/os-checker.ts.html +0 -421
  213. package/coverage/lcov-report/util/plugin-storage.ts.html +0 -202
  214. package/coverage/lcov-report/util/validations.ts.html +0 -544
  215. package/coverage/lcov-report/util/yaml.ts.html +0 -193
  216. package/coverage/lcov.info +0 -3548
  217. package/manifests/regroup.yml +0 -49
  218. package/manifests/test.yml +0 -524
@@ -1,193 +0,0 @@
1
-
2
- <!doctype html>
3
- <html lang="en">
4
-
5
- <head>
6
- <title>Code coverage report for util/yaml.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> / <a href="index.html">util</a> yaml.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'>20/20</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'>0/0</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'>3/3</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'>17/17</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 oninput="onInput()" 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></td><td class="line-coverage quiet"><span class="cline-any cline-yes">7x</span>
103
- <span class="cline-any cline-yes">7x</span>
104
- <span class="cline-any cline-neutral">&nbsp;</span>
105
- <span class="cline-any cline-yes">7x</span>
106
- <span class="cline-any cline-neutral">&nbsp;</span>
107
- <span class="cline-any cline-neutral">&nbsp;</span>
108
- <span class="cline-any cline-neutral">&nbsp;</span>
109
- <span class="cline-any cline-neutral">&nbsp;</span>
110
- <span class="cline-any cline-yes">7x</span>
111
- <span class="cline-any cline-yes">1x</span>
112
- <span class="cline-any cline-neutral">&nbsp;</span>
113
- <span class="cline-any cline-yes">1x</span>
114
- <span class="cline-any cline-neutral">&nbsp;</span>
115
- <span class="cline-any cline-neutral">&nbsp;</span>
116
- <span class="cline-any cline-neutral">&nbsp;</span>
117
- <span class="cline-any cline-neutral">&nbsp;</span>
118
- <span class="cline-any cline-neutral">&nbsp;</span>
119
- <span class="cline-any cline-yes">7x</span>
120
- <span class="cline-any cline-yes">2x</span>
121
- <span class="cline-any cline-yes">2x</span>
122
- <span class="cline-any cline-yes">2x</span>
123
- <span class="cline-any cline-neutral">&nbsp;</span>
124
- <span class="cline-any cline-yes">2x</span>
125
- <span class="cline-any cline-neutral">&nbsp;</span>
126
- <span class="cline-any cline-neutral">&nbsp;</span>
127
- <span class="cline-any cline-neutral">&nbsp;</span>
128
- <span class="cline-any cline-neutral">&nbsp;</span>
129
- <span class="cline-any cline-neutral">&nbsp;</span>
130
- <span class="cline-any cline-yes">7x</span>
131
- <span class="cline-any cline-yes">17x</span>
132
- <span class="cline-any cline-yes">17x</span>
133
- <span class="cline-any cline-yes">17x</span>
134
- <span class="cline-any cline-yes">17x</span>
135
- <span class="cline-any cline-neutral">&nbsp;</span>
136
- <span class="cline-any cline-yes">17x</span>
137
- <span class="cline-any cline-neutral">&nbsp;</span>
138
- <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import * as fs from 'fs/promises';
139
- import * as path from 'path';
140
- &nbsp;
141
- import * as YAML from 'js-yaml';
142
- &nbsp;
143
- /**
144
- * Reads and parses `yaml` file to object.
145
- */
146
- export const openYamlFileAsObject = async &lt;T&gt;(filePath: string): Promise&lt;T&gt; =&gt; {
147
- const yamlFileBuffer = await fs.readFile(filePath, 'utf8');
148
- &nbsp;
149
- return YAML.load(yamlFileBuffer) as T;
150
- };
151
- &nbsp;
152
- /**
153
- * Saves given `yaml` dump as a file.
154
- */
155
- export const saveYamlFileAs = async (object: any, pathToFile: string) =&gt; {
156
- const dirPath = path.dirname(pathToFile);
157
- await fs.mkdir(dirPath, {recursive: true});
158
- const yamlString = YAML.dump(object, {noRefs: true});
159
- &nbsp;
160
- return fs.writeFile(pathToFile, yamlString);
161
- };
162
- &nbsp;
163
- /**
164
- * Checks if given `fileName` is yaml.
165
- */
166
- export const checkIfFileIsYaml = (fileName: string) =&gt; {
167
- const yamlFileTypes = ['yaml', 'yml'];
168
- const splittedParts = fileName.split('.');
169
- const lastIndex = splittedParts.length - 1;
170
- const extension = splittedParts[lastIndex];
171
- &nbsp;
172
- return yamlFileTypes.includes(extension);
173
- };
174
- &nbsp;</pre></td></tr></table></pre>
175
-
176
- <div class='push'></div><!-- for sticky footer -->
177
- </div><!-- /wrapper -->
178
- <div class='footer quiet pad2 space-top1 center small'>
179
- Code coverage generated by
180
- <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
181
- at 2024-06-25T13:39:04.332Z
182
- </div>
183
- <script src="../prettify.js"></script>
184
- <script>
185
- window.onload = function () {
186
- prettyPrint();
187
- };
188
- </script>
189
- <script src="../sorter.js"></script>
190
- <script src="../block-navigation.js"></script>
191
- </body>
192
- </html>
193
-