@goast/core 0.4.0 → 0.4.1-springwebclient1

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 (443) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +67 -67
  3. package/esm/src/transform/helpers.d.ts.map +1 -1
  4. package/esm/src/transform/helpers.js +5 -1
  5. package/esm/src/utils/asset-manager.d.ts +1 -0
  6. package/esm/src/utils/asset-manager.d.ts.map +1 -1
  7. package/esm/src/utils/asset-manager.js +1 -1
  8. package/esm/src/utils/source-builder.d.ts +2 -0
  9. package/esm/src/utils/source-builder.d.ts.map +1 -1
  10. package/esm/src/utils/source-builder.js +7 -1
  11. package/package.json +2 -5
  12. package/script/src/transform/helpers.d.ts.map +1 -1
  13. package/script/src/transform/helpers.js +5 -1
  14. package/script/src/utils/asset-manager.d.ts +1 -0
  15. package/script/src/utils/asset-manager.d.ts.map +1 -1
  16. package/script/src/utils/asset-manager.js +1 -1
  17. package/script/src/utils/source-builder.d.ts +2 -0
  18. package/script/src/utils/source-builder.d.ts.map +1 -1
  19. package/script/src/utils/source-builder.js +8 -1
  20. package/esm/_dnt.test_polyfills.d.ts +0 -18
  21. package/esm/_dnt.test_polyfills.d.ts.map +0 -1
  22. package/esm/_dnt.test_polyfills.js +0 -17
  23. package/esm/_dnt.test_shims.d.ts +0 -14
  24. package/esm/_dnt.test_shims.d.ts.map +0 -1
  25. package/esm/_dnt.test_shims.js +0 -69
  26. package/esm/deps/jsr.io/@std/assert/1.0.6/assertion_error.d.ts +0 -26
  27. package/esm/deps/jsr.io/@std/assert/1.0.6/assertion_error.d.ts.map +0 -1
  28. package/esm/deps/jsr.io/@std/assert/1.0.6/assertion_error.js +0 -30
  29. package/esm/deps/jsr.io/@std/assert/1.0.6/equal.d.ts +0 -17
  30. package/esm/deps/jsr.io/@std/assert/1.0.6/equal.d.ts.map +0 -1
  31. package/esm/deps/jsr.io/@std/assert/1.0.6/equal.js +0 -136
  32. package/esm/deps/jsr.io/@std/assert/1.0.6/equals.d.ts +0 -22
  33. package/esm/deps/jsr.io/@std/assert/1.0.6/equals.d.ts.map +0 -1
  34. package/esm/deps/jsr.io/@std/assert/1.0.6/equals.js +0 -45
  35. package/esm/deps/jsr.io/@std/assert/1.0.6/false.d.ts +0 -18
  36. package/esm/deps/jsr.io/@std/assert/1.0.6/false.d.ts.map +0 -1
  37. package/esm/deps/jsr.io/@std/assert/1.0.6/false.js +0 -22
  38. package/esm/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts +0 -23
  39. package/esm/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts.map +0 -1
  40. package/esm/deps/jsr.io/@std/assert/1.0.6/instance_of.js +0 -53
  41. package/esm/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts +0 -25
  42. package/esm/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts.map +0 -1
  43. package/esm/deps/jsr.io/@std/assert/1.0.6/is_error.js +0 -54
  44. package/esm/deps/jsr.io/@std/assert/1.0.6/match.d.ts +0 -18
  45. package/esm/deps/jsr.io/@std/assert/1.0.6/match.d.ts.map +0 -1
  46. package/esm/deps/jsr.io/@std/assert/1.0.6/match.js +0 -26
  47. package/esm/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts +0 -20
  48. package/esm/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts.map +0 -1
  49. package/esm/deps/jsr.io/@std/assert/1.0.6/not_instance_of.js +0 -29
  50. package/esm/deps/jsr.io/@std/assert/1.0.6/not_match.d.ts +0 -18
  51. package/esm/deps/jsr.io/@std/assert/1.0.6/not_match.d.ts.map +0 -1
  52. package/esm/deps/jsr.io/@std/assert/1.0.6/not_match.js +0 -26
  53. package/esm/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.d.ts +0 -23
  54. package/esm/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.d.ts.map +0 -1
  55. package/esm/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.js +0 -32
  56. package/esm/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts +0 -28
  57. package/esm/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts.map +0 -1
  58. package/esm/deps/jsr.io/@std/assert/1.0.6/object_match.js +0 -159
  59. package/esm/deps/jsr.io/@std/assert/1.0.6/strict_equals.d.ts +0 -24
  60. package/esm/deps/jsr.io/@std/assert/1.0.6/strict_equals.d.ts.map +0 -1
  61. package/esm/deps/jsr.io/@std/assert/1.0.6/strict_equals.js +0 -57
  62. package/esm/deps/jsr.io/@std/expect/1.0.5/_assert_equals.d.ts +0 -20
  63. package/esm/deps/jsr.io/@std/expect/1.0.5/_assert_equals.d.ts.map +0 -1
  64. package/esm/deps/jsr.io/@std/expect/1.0.5/_assert_equals.js +0 -29
  65. package/esm/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.d.ts +0 -17
  66. package/esm/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.d.ts.map +0 -1
  67. package/esm/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.js +0 -26
  68. package/esm/deps/jsr.io/@std/expect/1.0.5/_assertion.d.ts +0 -3
  69. package/esm/deps/jsr.io/@std/expect/1.0.5/_assertion.d.ts.map +0 -1
  70. package/esm/deps/jsr.io/@std/expect/1.0.5/_assertion.js +0 -9
  71. package/esm/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.d.ts +0 -36
  72. package/esm/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.d.ts.map +0 -1
  73. package/esm/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.js +0 -124
  74. package/esm/deps/jsr.io/@std/expect/1.0.5/_build_message.d.ts +0 -6
  75. package/esm/deps/jsr.io/@std/expect/1.0.5/_build_message.d.ts.map +0 -1
  76. package/esm/deps/jsr.io/@std/expect/1.0.5/_build_message.js +0 -29
  77. package/esm/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.d.ts +0 -4
  78. package/esm/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.d.ts.map +0 -1
  79. package/esm/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.js +0 -11
  80. package/esm/deps/jsr.io/@std/expect/1.0.5/_equal.d.ts +0 -9
  81. package/esm/deps/jsr.io/@std/expect/1.0.5/_equal.d.ts.map +0 -1
  82. package/esm/deps/jsr.io/@std/expect/1.0.5/_equal.js +0 -191
  83. package/esm/deps/jsr.io/@std/expect/1.0.5/_extend.d.ts +0 -4
  84. package/esm/deps/jsr.io/@std/expect/1.0.5/_extend.d.ts.map +0 -1
  85. package/esm/deps/jsr.io/@std/expect/1.0.5/_extend.js +0 -11
  86. package/esm/deps/jsr.io/@std/expect/1.0.5/_inspect_args.d.ts +0 -3
  87. package/esm/deps/jsr.io/@std/expect/1.0.5/_inspect_args.d.ts.map +0 -1
  88. package/esm/deps/jsr.io/@std/expect/1.0.5/_inspect_args.js +0 -12
  89. package/esm/deps/jsr.io/@std/expect/1.0.5/_matchers.d.ts +0 -34
  90. package/esm/deps/jsr.io/@std/expect/1.0.5/_matchers.d.ts.map +0 -1
  91. package/esm/deps/jsr.io/@std/expect/1.0.5/_matchers.js +0 -564
  92. package/esm/deps/jsr.io/@std/expect/1.0.5/_mock_util.d.ts +0 -11
  93. package/esm/deps/jsr.io/@std/expect/1.0.5/_mock_util.d.ts.map +0 -1
  94. package/esm/deps/jsr.io/@std/expect/1.0.5/_mock_util.js +0 -10
  95. package/esm/deps/jsr.io/@std/expect/1.0.5/_types.d.ts +0 -838
  96. package/esm/deps/jsr.io/@std/expect/1.0.5/_types.d.ts.map +0 -1
  97. package/esm/deps/jsr.io/@std/expect/1.0.5/_types.js +0 -3
  98. package/esm/deps/jsr.io/@std/expect/1.0.5/_utils.d.ts +0 -8
  99. package/esm/deps/jsr.io/@std/expect/1.0.5/_utils.d.ts.map +0 -1
  100. package/esm/deps/jsr.io/@std/expect/1.0.5/_utils.js +0 -159
  101. package/esm/deps/jsr.io/@std/expect/1.0.5/expect.d.ts +0 -51
  102. package/esm/deps/jsr.io/@std/expect/1.0.5/expect.d.ts.map +0 -1
  103. package/esm/deps/jsr.io/@std/expect/1.0.5/expect.js +0 -425
  104. package/esm/deps/jsr.io/@std/expect/1.0.5/fn.d.ts +0 -29
  105. package/esm/deps/jsr.io/@std/expect/1.0.5/fn.d.ts.map +0 -1
  106. package/esm/deps/jsr.io/@std/expect/1.0.5/fn.js +0 -85
  107. package/esm/deps/jsr.io/@std/expect/1.0.5/mod.d.ts +0 -85
  108. package/esm/deps/jsr.io/@std/expect/1.0.5/mod.d.ts.map +0 -1
  109. package/esm/deps/jsr.io/@std/expect/1.0.5/mod.js +0 -87
  110. package/esm/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts +0 -75
  111. package/esm/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts.map +0 -1
  112. package/esm/deps/jsr.io/@std/internal/1.0.4/assertion_state.js +0 -101
  113. package/esm/deps/jsr.io/@std/internal/1.0.4/build_message.d.ts +0 -82
  114. package/esm/deps/jsr.io/@std/internal/1.0.4/build_message.d.ts.map +0 -1
  115. package/esm/deps/jsr.io/@std/internal/1.0.4/build_message.js +0 -111
  116. package/esm/deps/jsr.io/@std/internal/1.0.4/diff.d.ts +0 -140
  117. package/esm/deps/jsr.io/@std/internal/1.0.4/diff.d.ts.map +0 -1
  118. package/esm/deps/jsr.io/@std/internal/1.0.4/diff.js +0 -277
  119. package/esm/deps/jsr.io/@std/internal/1.0.4/diff_str.d.ts +0 -99
  120. package/esm/deps/jsr.io/@std/internal/1.0.4/diff_str.d.ts.map +0 -1
  121. package/esm/deps/jsr.io/@std/internal/1.0.4/diff_str.js +0 -180
  122. package/esm/deps/jsr.io/@std/internal/1.0.4/format.d.ts +0 -2
  123. package/esm/deps/jsr.io/@std/internal/1.0.4/format.d.ts.map +0 -1
  124. package/esm/deps/jsr.io/@std/internal/1.0.4/format.js +0 -37
  125. package/esm/deps/jsr.io/@std/internal/1.0.4/styles.d.ts +0 -159
  126. package/esm/deps/jsr.io/@std/internal/1.0.4/styles.d.ts.map +0 -1
  127. package/esm/deps/jsr.io/@std/internal/1.0.4/styles.js +0 -207
  128. package/esm/deps/jsr.io/@std/internal/1.0.4/types.d.ts +0 -16
  129. package/esm/deps/jsr.io/@std/internal/1.0.4/types.d.ts.map +0 -1
  130. package/esm/deps/jsr.io/@std/internal/1.0.4/types.js +0 -2
  131. package/esm/deps/jsr.io/@std/testing/1.0.3/_test_suite.d.ts +0 -74
  132. package/esm/deps/jsr.io/@std/testing/1.0.3/_test_suite.d.ts.map +0 -1
  133. package/esm/deps/jsr.io/@std/testing/1.0.3/_test_suite.js +0 -340
  134. package/esm/deps/jsr.io/@std/testing/1.0.3/bdd.d.ts +0 -731
  135. package/esm/deps/jsr.io/@std/testing/1.0.3/bdd.d.ts.map +0 -1
  136. package/esm/deps/jsr.io/@std/testing/1.0.3/bdd.js +0 -576
  137. package/esm/src/collect/helpers.test.d.ts +0 -2
  138. package/esm/src/collect/helpers.test.d.ts.map +0 -1
  139. package/esm/src/collect/helpers.test.js +0 -77
  140. package/esm/src/transform/helpers.test.d.ts +0 -2
  141. package/esm/src/transform/helpers.test.d.ts.map +0 -1
  142. package/esm/src/transform/helpers.test.js +0 -265
  143. package/esm/src/utils/action-provider.test.d.ts +0 -2
  144. package/esm/src/utils/action-provider.test.d.ts.map +0 -1
  145. package/esm/src/utils/action-provider.test.js +0 -28
  146. package/esm/src/utils/common.utils.test.d.ts +0 -2
  147. package/esm/src/utils/common.utils.test.d.ts.map +0 -1
  148. package/esm/src/utils/common.utils.test.js +0 -18
  149. package/esm/src/utils/condition.test.d.ts +0 -2
  150. package/esm/src/utils/condition.test.d.ts.map +0 -1
  151. package/esm/src/utils/condition.test.js +0 -31
  152. package/esm/src/utils/endpoint.utils.test.d.ts +0 -2
  153. package/esm/src/utils/endpoint.utils.test.d.ts.map +0 -1
  154. package/esm/src/utils/endpoint.utils.test.js +0 -31
  155. package/esm/src/utils/factory.test.d.ts +0 -2
  156. package/esm/src/utils/factory.test.d.ts.map +0 -1
  157. package/esm/src/utils/factory.test.js +0 -34
  158. package/esm/src/utils/generator.utils.test.d.ts +0 -2
  159. package/esm/src/utils/generator.utils.test.d.ts.map +0 -1
  160. package/esm/src/utils/generator.utils.test.js +0 -13
  161. package/esm/src/utils/object.utils.test.d.ts +0 -2
  162. package/esm/src/utils/object.utils.test.d.ts.map +0 -1
  163. package/esm/src/utils/object.utils.test.js +0 -29
  164. package/esm/src/utils/schema.utils.test.d.ts +0 -2
  165. package/esm/src/utils/schema.utils.test.d.ts.map +0 -1
  166. package/esm/src/utils/schema.utils.test.js +0 -78
  167. package/esm/src/utils/source-builder.test.d.ts +0 -2
  168. package/esm/src/utils/source-builder.test.d.ts.map +0 -1
  169. package/esm/src/utils/source-builder.test.js +0 -506
  170. package/esm/src/utils/string-builder/string-builder.test.d.ts +0 -2
  171. package/esm/src/utils/string-builder/string-builder.test.d.ts.map +0 -1
  172. package/esm/src/utils/string-builder/string-builder.test.js +0 -164
  173. package/esm/src/utils/string.utils.test.d.ts +0 -2
  174. package/esm/src/utils/string.utils.test.d.ts.map +0 -1
  175. package/esm/src/utils/string.utils.test.js +0 -528
  176. package/esm/tests/openapi.test.d.ts +0 -2
  177. package/esm/tests/openapi.test.d.ts.map +0 -1
  178. package/esm/tests/openapi.test.js +0 -33
  179. package/esm/tests/schema-factory.d.ts +0 -42
  180. package/esm/tests/schema-factory.d.ts.map +0 -1
  181. package/esm/tests/schema-factory.js +0 -138
  182. package/script/_dnt.test_polyfills.d.ts +0 -18
  183. package/script/_dnt.test_polyfills.d.ts.map +0 -1
  184. package/script/_dnt.test_polyfills.js +0 -18
  185. package/script/_dnt.test_shims.d.ts +0 -14
  186. package/script/_dnt.test_shims.d.ts.map +0 -1
  187. package/script/_dnt.test_shims.js +0 -79
  188. package/script/deps/jsr.io/@std/assert/1.0.6/assertion_error.d.ts +0 -26
  189. package/script/deps/jsr.io/@std/assert/1.0.6/assertion_error.d.ts.map +0 -1
  190. package/script/deps/jsr.io/@std/assert/1.0.6/assertion_error.js +0 -34
  191. package/script/deps/jsr.io/@std/assert/1.0.6/equal.d.ts +0 -17
  192. package/script/deps/jsr.io/@std/assert/1.0.6/equal.d.ts.map +0 -1
  193. package/script/deps/jsr.io/@std/assert/1.0.6/equal.js +0 -139
  194. package/script/deps/jsr.io/@std/assert/1.0.6/equals.d.ts +0 -22
  195. package/script/deps/jsr.io/@std/assert/1.0.6/equals.d.ts.map +0 -1
  196. package/script/deps/jsr.io/@std/assert/1.0.6/equals.js +0 -48
  197. package/script/deps/jsr.io/@std/assert/1.0.6/false.d.ts +0 -18
  198. package/script/deps/jsr.io/@std/assert/1.0.6/false.d.ts.map +0 -1
  199. package/script/deps/jsr.io/@std/assert/1.0.6/false.js +0 -25
  200. package/script/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts +0 -23
  201. package/script/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts.map +0 -1
  202. package/script/deps/jsr.io/@std/assert/1.0.6/instance_of.js +0 -56
  203. package/script/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts +0 -25
  204. package/script/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts.map +0 -1
  205. package/script/deps/jsr.io/@std/assert/1.0.6/is_error.js +0 -57
  206. package/script/deps/jsr.io/@std/assert/1.0.6/match.d.ts +0 -18
  207. package/script/deps/jsr.io/@std/assert/1.0.6/match.d.ts.map +0 -1
  208. package/script/deps/jsr.io/@std/assert/1.0.6/match.js +0 -29
  209. package/script/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts +0 -20
  210. package/script/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts.map +0 -1
  211. package/script/deps/jsr.io/@std/assert/1.0.6/not_instance_of.js +0 -32
  212. package/script/deps/jsr.io/@std/assert/1.0.6/not_match.d.ts +0 -18
  213. package/script/deps/jsr.io/@std/assert/1.0.6/not_match.d.ts.map +0 -1
  214. package/script/deps/jsr.io/@std/assert/1.0.6/not_match.js +0 -29
  215. package/script/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.d.ts +0 -23
  216. package/script/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.d.ts.map +0 -1
  217. package/script/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.js +0 -35
  218. package/script/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts +0 -28
  219. package/script/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts.map +0 -1
  220. package/script/deps/jsr.io/@std/assert/1.0.6/object_match.js +0 -162
  221. package/script/deps/jsr.io/@std/assert/1.0.6/strict_equals.d.ts +0 -24
  222. package/script/deps/jsr.io/@std/assert/1.0.6/strict_equals.d.ts.map +0 -1
  223. package/script/deps/jsr.io/@std/assert/1.0.6/strict_equals.js +0 -60
  224. package/script/deps/jsr.io/@std/expect/1.0.5/_assert_equals.d.ts +0 -20
  225. package/script/deps/jsr.io/@std/expect/1.0.5/_assert_equals.d.ts.map +0 -1
  226. package/script/deps/jsr.io/@std/expect/1.0.5/_assert_equals.js +0 -32
  227. package/script/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.d.ts +0 -17
  228. package/script/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.d.ts.map +0 -1
  229. package/script/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.js +0 -29
  230. package/script/deps/jsr.io/@std/expect/1.0.5/_assertion.d.ts +0 -3
  231. package/script/deps/jsr.io/@std/expect/1.0.5/_assertion.d.ts.map +0 -1
  232. package/script/deps/jsr.io/@std/expect/1.0.5/_assertion.js +0 -13
  233. package/script/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.d.ts +0 -36
  234. package/script/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.d.ts.map +0 -1
  235. package/script/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.js +0 -140
  236. package/script/deps/jsr.io/@std/expect/1.0.5/_build_message.d.ts +0 -6
  237. package/script/deps/jsr.io/@std/expect/1.0.5/_build_message.d.ts.map +0 -1
  238. package/script/deps/jsr.io/@std/expect/1.0.5/_build_message.js +0 -33
  239. package/script/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.d.ts +0 -4
  240. package/script/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.d.ts.map +0 -1
  241. package/script/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.js +0 -15
  242. package/script/deps/jsr.io/@std/expect/1.0.5/_equal.d.ts +0 -9
  243. package/script/deps/jsr.io/@std/expect/1.0.5/_equal.d.ts.map +0 -1
  244. package/script/deps/jsr.io/@std/expect/1.0.5/_equal.js +0 -194
  245. package/script/deps/jsr.io/@std/expect/1.0.5/_extend.d.ts +0 -4
  246. package/script/deps/jsr.io/@std/expect/1.0.5/_extend.d.ts.map +0 -1
  247. package/script/deps/jsr.io/@std/expect/1.0.5/_extend.js +0 -15
  248. package/script/deps/jsr.io/@std/expect/1.0.5/_inspect_args.d.ts +0 -3
  249. package/script/deps/jsr.io/@std/expect/1.0.5/_inspect_args.d.ts.map +0 -1
  250. package/script/deps/jsr.io/@std/expect/1.0.5/_inspect_args.js +0 -17
  251. package/script/deps/jsr.io/@std/expect/1.0.5/_matchers.d.ts +0 -34
  252. package/script/deps/jsr.io/@std/expect/1.0.5/_matchers.d.ts.map +0 -1
  253. package/script/deps/jsr.io/@std/expect/1.0.5/_matchers.js +0 -598
  254. package/script/deps/jsr.io/@std/expect/1.0.5/_mock_util.d.ts +0 -11
  255. package/script/deps/jsr.io/@std/expect/1.0.5/_mock_util.d.ts.map +0 -1
  256. package/script/deps/jsr.io/@std/expect/1.0.5/_mock_util.js +0 -14
  257. package/script/deps/jsr.io/@std/expect/1.0.5/_types.d.ts +0 -838
  258. package/script/deps/jsr.io/@std/expect/1.0.5/_types.d.ts.map +0 -1
  259. package/script/deps/jsr.io/@std/expect/1.0.5/_types.js +0 -4
  260. package/script/deps/jsr.io/@std/expect/1.0.5/_utils.d.ts +0 -8
  261. package/script/deps/jsr.io/@std/expect/1.0.5/_utils.d.ts.map +0 -1
  262. package/script/deps/jsr.io/@std/expect/1.0.5/_utils.js +0 -166
  263. package/script/deps/jsr.io/@std/expect/1.0.5/expect.d.ts +0 -51
  264. package/script/deps/jsr.io/@std/expect/1.0.5/expect.d.ts.map +0 -1
  265. package/script/deps/jsr.io/@std/expect/1.0.5/expect.js +0 -429
  266. package/script/deps/jsr.io/@std/expect/1.0.5/fn.d.ts +0 -29
  267. package/script/deps/jsr.io/@std/expect/1.0.5/fn.d.ts.map +0 -1
  268. package/script/deps/jsr.io/@std/expect/1.0.5/fn.js +0 -88
  269. package/script/deps/jsr.io/@std/expect/1.0.5/mod.d.ts +0 -85
  270. package/script/deps/jsr.io/@std/expect/1.0.5/mod.d.ts.map +0 -1
  271. package/script/deps/jsr.io/@std/expect/1.0.5/mod.js +0 -90
  272. package/script/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts +0 -75
  273. package/script/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts.map +0 -1
  274. package/script/deps/jsr.io/@std/internal/1.0.4/assertion_state.js +0 -106
  275. package/script/deps/jsr.io/@std/internal/1.0.4/build_message.d.ts +0 -82
  276. package/script/deps/jsr.io/@std/internal/1.0.4/build_message.d.ts.map +0 -1
  277. package/script/deps/jsr.io/@std/internal/1.0.4/build_message.js +0 -116
  278. package/script/deps/jsr.io/@std/internal/1.0.4/diff.d.ts +0 -140
  279. package/script/deps/jsr.io/@std/internal/1.0.4/diff.d.ts.map +0 -1
  280. package/script/deps/jsr.io/@std/internal/1.0.4/diff.js +0 -284
  281. package/script/deps/jsr.io/@std/internal/1.0.4/diff_str.d.ts +0 -99
  282. package/script/deps/jsr.io/@std/internal/1.0.4/diff_str.d.ts.map +0 -1
  283. package/script/deps/jsr.io/@std/internal/1.0.4/diff_str.js +0 -186
  284. package/script/deps/jsr.io/@std/internal/1.0.4/format.d.ts +0 -2
  285. package/script/deps/jsr.io/@std/internal/1.0.4/format.d.ts.map +0 -1
  286. package/script/deps/jsr.io/@std/internal/1.0.4/format.js +0 -41
  287. package/script/deps/jsr.io/@std/internal/1.0.4/styles.d.ts +0 -159
  288. package/script/deps/jsr.io/@std/internal/1.0.4/styles.d.ts.map +0 -1
  289. package/script/deps/jsr.io/@std/internal/1.0.4/styles.js +0 -220
  290. package/script/deps/jsr.io/@std/internal/1.0.4/types.d.ts +0 -16
  291. package/script/deps/jsr.io/@std/internal/1.0.4/types.d.ts.map +0 -1
  292. package/script/deps/jsr.io/@std/internal/1.0.4/types.js +0 -3
  293. package/script/deps/jsr.io/@std/testing/1.0.3/_test_suite.d.ts +0 -74
  294. package/script/deps/jsr.io/@std/testing/1.0.3/_test_suite.d.ts.map +0 -1
  295. package/script/deps/jsr.io/@std/testing/1.0.3/_test_suite.js +0 -345
  296. package/script/deps/jsr.io/@std/testing/1.0.3/bdd.d.ts +0 -731
  297. package/script/deps/jsr.io/@std/testing/1.0.3/bdd.d.ts.map +0 -1
  298. package/script/deps/jsr.io/@std/testing/1.0.3/bdd.js +0 -587
  299. package/script/src/collect/helpers.test.d.ts +0 -2
  300. package/script/src/collect/helpers.test.d.ts.map +0 -1
  301. package/script/src/collect/helpers.test.js +0 -79
  302. package/script/src/transform/helpers.test.d.ts +0 -2
  303. package/script/src/transform/helpers.test.d.ts.map +0 -1
  304. package/script/src/transform/helpers.test.js +0 -267
  305. package/script/src/utils/action-provider.test.d.ts +0 -2
  306. package/script/src/utils/action-provider.test.d.ts.map +0 -1
  307. package/script/src/utils/action-provider.test.js +0 -30
  308. package/script/src/utils/common.utils.test.d.ts +0 -2
  309. package/script/src/utils/common.utils.test.d.ts.map +0 -1
  310. package/script/src/utils/common.utils.test.js +0 -20
  311. package/script/src/utils/condition.test.d.ts +0 -2
  312. package/script/src/utils/condition.test.d.ts.map +0 -1
  313. package/script/src/utils/condition.test.js +0 -33
  314. package/script/src/utils/endpoint.utils.test.d.ts +0 -2
  315. package/script/src/utils/endpoint.utils.test.d.ts.map +0 -1
  316. package/script/src/utils/endpoint.utils.test.js +0 -33
  317. package/script/src/utils/factory.test.d.ts +0 -2
  318. package/script/src/utils/factory.test.d.ts.map +0 -1
  319. package/script/src/utils/factory.test.js +0 -36
  320. package/script/src/utils/generator.utils.test.d.ts +0 -2
  321. package/script/src/utils/generator.utils.test.d.ts.map +0 -1
  322. package/script/src/utils/generator.utils.test.js +0 -15
  323. package/script/src/utils/object.utils.test.d.ts +0 -2
  324. package/script/src/utils/object.utils.test.d.ts.map +0 -1
  325. package/script/src/utils/object.utils.test.js +0 -31
  326. package/script/src/utils/schema.utils.test.d.ts +0 -2
  327. package/script/src/utils/schema.utils.test.d.ts.map +0 -1
  328. package/script/src/utils/schema.utils.test.js +0 -80
  329. package/script/src/utils/source-builder.test.d.ts +0 -2
  330. package/script/src/utils/source-builder.test.d.ts.map +0 -1
  331. package/script/src/utils/source-builder.test.js +0 -508
  332. package/script/src/utils/string-builder/string-builder.test.d.ts +0 -2
  333. package/script/src/utils/string-builder/string-builder.test.d.ts.map +0 -1
  334. package/script/src/utils/string-builder/string-builder.test.js +0 -166
  335. package/script/src/utils/string.utils.test.d.ts +0 -2
  336. package/script/src/utils/string.utils.test.d.ts.map +0 -1
  337. package/script/src/utils/string.utils.test.js +0 -530
  338. package/script/tests/openapi.test.d.ts +0 -2
  339. package/script/tests/openapi.test.d.ts.map +0 -1
  340. package/script/tests/openapi.test.js +0 -35
  341. package/script/tests/schema-factory.d.ts +0 -42
  342. package/script/tests/schema-factory.d.ts.map +0 -1
  343. package/script/tests/schema-factory.js +0 -162
  344. package/src/_dnt.shims.ts +0 -69
  345. package/src/_dnt.test_polyfills.ts +0 -43
  346. package/src/_dnt.test_shims.ts +0 -72
  347. package/src/deps/jsr.io/@std/assert/1.0.6/assertion_error.ts +0 -31
  348. package/src/deps/jsr.io/@std/assert/1.0.6/equal.ts +0 -152
  349. package/src/deps/jsr.io/@std/assert/1.0.6/equals.ts +0 -52
  350. package/src/deps/jsr.io/@std/assert/1.0.6/false.ts +0 -26
  351. package/src/deps/jsr.io/@std/assert/1.0.6/instance_of.ts +0 -64
  352. package/src/deps/jsr.io/@std/assert/1.0.6/is_error.ts +0 -65
  353. package/src/deps/jsr.io/@std/assert/1.0.6/match.ts +0 -30
  354. package/src/deps/jsr.io/@std/assert/1.0.6/not_instance_of.ts +0 -33
  355. package/src/deps/jsr.io/@std/assert/1.0.6/not_match.ts +0 -30
  356. package/src/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.ts +0 -42
  357. package/src/deps/jsr.io/@std/assert/1.0.6/object_match.ts +0 -202
  358. package/src/deps/jsr.io/@std/assert/1.0.6/strict_equals.ts +0 -67
  359. package/src/deps/jsr.io/@std/expect/1.0.5/_assert_equals.ts +0 -38
  360. package/src/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.ts +0 -35
  361. package/src/deps/jsr.io/@std/expect/1.0.5/_assertion.ts +0 -13
  362. package/src/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.ts +0 -147
  363. package/src/deps/jsr.io/@std/expect/1.0.5/_build_message.ts +0 -51
  364. package/src/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.ts +0 -19
  365. package/src/deps/jsr.io/@std/expect/1.0.5/_equal.ts +0 -229
  366. package/src/deps/jsr.io/@std/expect/1.0.5/_extend.ts +0 -16
  367. package/src/deps/jsr.io/@std/expect/1.0.5/_inspect_args.ts +0 -15
  368. package/src/deps/jsr.io/@std/expect/1.0.5/_matchers.ts +0 -828
  369. package/src/deps/jsr.io/@std/expect/1.0.5/_mock_util.ts +0 -22
  370. package/src/deps/jsr.io/@std/expect/1.0.5/_types.ts +0 -917
  371. package/src/deps/jsr.io/@std/expect/1.0.5/_utils.ts +0 -201
  372. package/src/deps/jsr.io/@std/expect/1.0.5/expect.ts +0 -511
  373. package/src/deps/jsr.io/@std/expect/1.0.5/fn.ts +0 -91
  374. package/src/deps/jsr.io/@std/expect/1.0.5/mod.ts +0 -88
  375. package/src/deps/jsr.io/@std/internal/1.0.4/assertion_state.ts +0 -111
  376. package/src/deps/jsr.io/@std/internal/1.0.4/build_message.ts +0 -134
  377. package/src/deps/jsr.io/@std/internal/1.0.4/diff.ts +0 -317
  378. package/src/deps/jsr.io/@std/internal/1.0.4/diff_str.ts +0 -204
  379. package/src/deps/jsr.io/@std/internal/1.0.4/format.ts +0 -39
  380. package/src/deps/jsr.io/@std/internal/1.0.4/styles.ts +0 -233
  381. package/src/deps/jsr.io/@std/internal/1.0.4/types.ts +0 -18
  382. package/src/deps/jsr.io/@std/testing/1.0.3/_test_suite.ts +0 -389
  383. package/src/deps/jsr.io/@std/testing/1.0.3/bdd.ts +0 -1202
  384. package/src/mod.ts +0 -33
  385. package/src/src/ast/node.ts +0 -46
  386. package/src/src/codegen/config.ts +0 -28
  387. package/src/src/codegen/endpoints-generator.ts +0 -72
  388. package/src/src/codegen/generator.ts +0 -181
  389. package/src/src/codegen/internal-utils.ts +0 -6
  390. package/src/src/codegen/schemas-generator.ts +0 -87
  391. package/src/src/codegen/services-generator.ts +0 -77
  392. package/src/src/codegen/types.ts +0 -37
  393. package/src/src/collect/collector.ts +0 -142
  394. package/src/src/collect/helpers.test.ts +0 -91
  395. package/src/src/collect/helpers.ts +0 -36
  396. package/src/src/collect/types.ts +0 -21
  397. package/src/src/internal-utils.ts +0 -5
  398. package/src/src/parse/deref-proxy.ts +0 -64
  399. package/src/src/parse/openapi-types.ts +0 -949
  400. package/src/src/parse/parser.ts +0 -220
  401. package/src/src/parse/types.ts +0 -27
  402. package/src/src/transform/api-types.ts +0 -243
  403. package/src/src/transform/helpers.test.ts +0 -316
  404. package/src/src/transform/helpers.ts +0 -211
  405. package/src/src/transform/transform-document.ts +0 -35
  406. package/src/src/transform/transform-endpoint.ts +0 -331
  407. package/src/src/transform/transform-schema.ts +0 -217
  408. package/src/src/transform/transformer.ts +0 -52
  409. package/src/src/transform/types.ts +0 -52
  410. package/src/src/utils/action-provider.test.ts +0 -32
  411. package/src/src/utils/action-provider.ts +0 -58
  412. package/src/src/utils/array.utils.ts +0 -7
  413. package/src/src/utils/asset-manager.ts +0 -51
  414. package/src/src/utils/class.utils.ts +0 -40
  415. package/src/src/utils/common.utils.test.ts +0 -22
  416. package/src/src/utils/common.utils.ts +0 -86
  417. package/src/src/utils/condition.test.ts +0 -36
  418. package/src/src/utils/condition.ts +0 -7
  419. package/src/src/utils/endpoint.utils.test.ts +0 -36
  420. package/src/src/utils/endpoint.utils.ts +0 -10
  421. package/src/src/utils/error.utils.ts +0 -3
  422. package/src/src/utils/factory.test.ts +0 -31
  423. package/src/src/utils/factory.ts +0 -42
  424. package/src/src/utils/file-system.utils.ts +0 -48
  425. package/src/src/utils/generator.utils.test.ts +0 -16
  426. package/src/src/utils/generator.utils.ts +0 -6
  427. package/src/src/utils/object.utils.test.ts +0 -33
  428. package/src/src/utils/object.utils.ts +0 -32
  429. package/src/src/utils/schema.utils.test.ts +0 -87
  430. package/src/src/utils/schema.utils.ts +0 -142
  431. package/src/src/utils/source-builder.test.ts +0 -658
  432. package/src/src/utils/source-builder.ts +0 -589
  433. package/src/src/utils/string-builder/options.ts +0 -19
  434. package/src/src/utils/string-builder/string-builder.test.ts +0 -189
  435. package/src/src/utils/string-builder/string-builder.ts +0 -165
  436. package/src/src/utils/string-builder/utils.ts +0 -69
  437. package/src/src/utils/string.utils.test.ts +0 -691
  438. package/src/src/utils/string.utils.ts +0 -369
  439. package/src/src/utils/string.utils.types.ts +0 -179
  440. package/src/src/utils/type.utils.ts +0 -93
  441. package/src/tests/openapi.test.ts +0 -50
  442. package/src/tests/schema-factory.ts +0 -185
  443. package/test_runner.js +0 -221
@@ -1,91 +0,0 @@
1
- // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
- // This module is browser compatible.
3
- // Copyright 2019 Allain Lalonde. All rights reserved. ISC License.
4
- // deno-lint-ignore-file no-explicit-any ban-types
5
-
6
- /**
7
- * This module contains a function to mock functions for testing and assertions.
8
- *
9
- * ```ts
10
- * import { fn, expect } from "@std/expect";
11
- *
12
- * Deno.test("example", () => {
13
- * const mockFn = fn((a: number, b: number) => a + b);
14
- * const result = mockFn(1, 2);
15
- * expect(result).toEqual(3);
16
- * expect(mockFn).toHaveBeenCalledWith(1, 2);
17
- * expect(mockFn).toHaveBeenCalledTimes(1);
18
- * });
19
- * ```
20
- *
21
- * @module
22
- */
23
-
24
- import { MOCK_SYMBOL, type MockCall } from "./_mock_util.js";
25
-
26
- /**
27
- * Creates a mock function that can be used for testing and assertions.
28
- *
29
- * @param stubs Functions to be used as stubs for different calls.
30
- * @returns A mock function that keeps track of calls and returns values based on the provided stubs.
31
- *
32
- * @example Usage
33
- * ```ts no-assert
34
- * import { fn, expect } from "@std/expect";
35
- *
36
- * Deno.test("example", () => {
37
- * const mockFn = fn(
38
- * (a: number, b: number) => a + b,
39
- * (a: number, b: number) => a - b
40
- * );
41
- * const result = mockFn(1, 2);
42
- * expect(result).toEqual(3);
43
- * expect(mockFn).toHaveBeenCalledWith(1, 2);
44
- * expect(mockFn).toHaveBeenCalledTimes(1);
45
- *
46
- * const result2 = mockFn(3, 2);
47
- * expect(result2).toEqual(1);
48
- * expect(mockFn).toHaveBeenCalledWith(3, 2);
49
- * expect(mockFn).toHaveBeenCalledTimes(2);
50
- * });
51
- * ```
52
- */
53
- export function fn(...stubs: Function[]): Function {
54
- const calls: MockCall[] = [];
55
-
56
- const f = (...args: any[]) => {
57
- const stub = stubs.length === 1
58
- // keep reusing the first
59
- ? stubs[0]
60
- // pick the exact mock for the current call
61
- : stubs[calls.length];
62
-
63
- try {
64
- const returned = stub ? stub(...args) : undefined;
65
- calls.push({
66
- args,
67
- returned,
68
- timestamp: Date.now(),
69
- returns: true,
70
- throws: false,
71
- });
72
- return returned;
73
- } catch (err) {
74
- calls.push({
75
- args,
76
- timestamp: Date.now(),
77
- returns: false,
78
- thrown: err,
79
- throws: true,
80
- });
81
- throw err;
82
- }
83
- };
84
-
85
- Object.defineProperty(f, MOCK_SYMBOL, {
86
- value: { calls },
87
- writable: false,
88
- });
89
-
90
- return f;
91
- }
@@ -1,88 +0,0 @@
1
- // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
- // Copyright 2019 Allain Lalonde. All rights reserved. ISC License.
3
- // This module is browser compatible.
4
-
5
- /**
6
- * This module provides Jest compatible expect assertion functionality.
7
- *
8
- * ```ts no-assert
9
- * import { expect } from "@std/expect";
10
- *
11
- * const x = 6 * 7;
12
- * expect(x).toEqual(42);
13
- * expect(x).not.toEqual(0);
14
- *
15
- * await expect(Promise.resolve(x)).resolves.toEqual(42);
16
- * ```
17
- *
18
- * Currently this module supports the following functions:
19
- * - Common matchers:
20
- * - {@linkcode Expected.toBe | toBe}
21
- * - {@linkcode Expected.toEqual | toEqual}
22
- * - {@linkcode Expected.toStrictEqual | toStrictEqual}
23
- * - {@linkcode Expected.toMatch | toMatch}
24
- * - {@linkcode Expected.toMatchObject | toMatchObject}
25
- * - {@linkcode Expected.toBeDefined | toBeDefined}
26
- * - {@linkcode Expected.toBeUndefined | toBeUndefined}
27
- * - {@linkcode Expected.toBeNull | toBeNull}
28
- * - {@linkcode Expected.toBeNaN | toBeNaN}
29
- * - {@linkcode Expected.toBeTruthy | toBeTruthy}
30
- * - {@linkcode Expected.toBeFalsy | toBeFalsy}
31
- * - {@linkcode Expected.toContain | toContain}
32
- * - {@linkcode Expected.toContainEqual | toContainEqual}
33
- * - {@linkcode Expected.toHaveLength | toHaveLength}
34
- * - {@linkcode Expected.toBeGreaterThan | toBeGreaterThan}
35
- * - {@linkcode Expected.toBeGreaterThanOrEqual | toBeGreaterThanOrEqual}
36
- * - {@linkcode Expected.toBeLessThan | toBeLessThan}
37
- * - {@linkcode Expected.toBeLessThanOrEqual | toBeLessThanOrEqual}
38
- * - {@linkcode Expected.toBeCloseTo | toBeCloseTo}
39
- * - {@linkcode Expected.toBeInstanceOf | toBeInstanceOf}
40
- * - {@linkcode Expected.toThrow | toThrow}
41
- * - {@linkcode Expected.toHaveProperty | toHaveProperty}
42
- * - Mock related matchers:
43
- * - {@linkcode Expected.toHaveBeenCalled | toHaveBeenCalled}
44
- * - {@linkcode Expected.toHaveBeenCalledTimes | toHaveBeenCalledTimes}
45
- * - {@linkcode Expected.toHaveBeenCalledWith | toHaveBeenCalledWith}
46
- * - {@linkcode Expected.toHaveBeenLastCalledWith | toHaveBeenLastCalledWith}
47
- * - {@linkcode Expected.toHaveBeenNthCalledWith | toHaveBeenNthCalledWith}
48
- * - {@linkcode Expected.toHaveReturned | toHaveReturned}
49
- * - {@linkcode Expected.toHaveReturnedTimes | toHaveReturnedTimes}
50
- * - {@linkcode Expected.toHaveReturnedWith | toHaveReturnedWith}
51
- * - {@linkcode Expected.toHaveLastReturnedWith | toHaveLastReturnedWith}
52
- * - {@linkcode Expected.toHaveNthReturnedWith | toHaveNthReturnedWith}
53
- * - Asymmetric matchers:
54
- * - {@linkcode expect.anything}
55
- * - {@linkcode expect.any}
56
- * - {@linkcode expect.arrayContaining}
57
- * - {@linkcode expect.closeTo}
58
- * - {@linkcode expect.stringContaining}
59
- * - {@linkcode expect.stringMatching}
60
- * - Utilities:
61
- * - {@linkcode expect.addEqualityTester}
62
- * - {@linkcode expect.extend}
63
- * - {@linkcode expect.hasAssertions}
64
- *
65
- * Only these functions are still not available:
66
- * - Matchers:
67
- * - `toMatchSnapShot`
68
- * - `toMatchInlineSnapshot`
69
- * - `toThrowErrorMatchingSnapshot`
70
- * - `toThrowErrorMatchingInlineSnapshot`
71
- * - Asymmetric matchers:
72
- * - `expect.objectContaining`
73
- * - `expect.not.objectContaining`
74
- * - Utilities:
75
- * - `expect.assertions`
76
- * - `expect.addSnapshotSerializer`
77
- *
78
- * The tracking issue to add support for unsupported parts of the API is
79
- * {@link https://github.com/denoland/std/issues/3964}.
80
- *
81
- * This module is largely inspired by
82
- * {@link https://github.com/allain/expect | x/expect} module by
83
- * {@link https://github.com/allain | Allain Lalonde}.
84
- *
85
- * @module
86
- */
87
- export * from "./expect.js";
88
- export * from "./fn.js";
@@ -1,111 +0,0 @@
1
- // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
-
3
- /**
4
- * Check the test suite internal state
5
- *
6
- * @example Usage
7
- * ```ts ignore
8
- * import { AssertionState } from "@std/internal";
9
- *
10
- * const assertionState = new AssertionState();
11
- * ```
12
- */
13
- export class AssertionState {
14
- #state: {
15
- assertionCheck: boolean;
16
- assertionTriggered: boolean;
17
- };
18
-
19
- constructor() {
20
- this.#state = {
21
- assertionCheck: false,
22
- assertionTriggered: false,
23
- };
24
- }
25
-
26
- /**
27
- * If `expect.hasAssertions` called, then through this method to update #state.assertionCheck value.
28
- *
29
- * @param val Set #state.assertionCheck's value
30
- *
31
- * @example Usage
32
- * ```ts ignore
33
- * import { AssertionState } from "@std/internal";
34
- *
35
- * const assertionState = new AssertionState();
36
- * assertionState.setAssertionCheck(true);
37
- * ```
38
- */
39
- setAssertionCheck(val: boolean) {
40
- this.#state.assertionCheck = val;
41
- }
42
-
43
- /**
44
- * If any matchers was called, `#state.assertionTriggered` will be set through this method.
45
- *
46
- * @param val Set #state.assertionTriggered's value
47
- *
48
- * @example Usage
49
- * ```ts ignore
50
- * import { AssertionState } from "@std/internal";
51
- *
52
- * const assertionState = new AssertionState();
53
- * assertionState.setAssertionTriggered(true);
54
- * ```
55
- */
56
- setAssertionTriggered(val: boolean) {
57
- this.#state.assertionTriggered = val;
58
- }
59
-
60
- /**
61
- * Check Assertion internal state, if `#state.assertionCheck` is set true, but
62
- * `#state.assertionTriggered` is still false, then should throw an Assertion Error.
63
- *
64
- * @returns a boolean value, that the test suite is satisfied with the check. If not,
65
- * it should throw an AssertionError.
66
- *
67
- * @example Usage
68
- * ```ts ignore
69
- * import { AssertionState } from "@std/internal";
70
- *
71
- * const assertionState = new AssertionState();
72
- * if (assertionState.checkAssertionErrorStateAndReset()) {
73
- * // throw AssertionError("");
74
- * }
75
- * ```
76
- */
77
- checkAssertionErrorStateAndReset(): boolean {
78
- const result = this.#state.assertionCheck &&
79
- !this.#state.assertionTriggered;
80
-
81
- this.#resetAssertionState();
82
-
83
- return result;
84
- }
85
-
86
- #resetAssertionState(): void {
87
- this.#state = {
88
- assertionCheck: false,
89
- assertionTriggered: false,
90
- };
91
- }
92
- }
93
-
94
- const assertionState = new AssertionState();
95
-
96
- /**
97
- * return an instance of AssertionState
98
- *
99
- * @returns AssertionState
100
- *
101
- * @example Usage
102
- * ```ts ignore
103
- * import { getAssertionState } from "@std/internal";
104
- *
105
- * const assertionState = getAssertionState();
106
- * assertionState.setAssertionTriggered(true);
107
- * ```
108
- */
109
- export function getAssertionState(): AssertionState {
110
- return assertionState;
111
- }
@@ -1,134 +0,0 @@
1
- // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
- // This module is browser compatible.
3
-
4
- import { bgGreen, bgRed, bold, gray, green, red, white } from "./styles.js";
5
- import type { DiffResult, DiffType } from "./types.js";
6
-
7
- /**
8
- * Colors the output of assertion diffs.
9
- *
10
- * @param diffType Difference type, either added or removed.
11
- * @param background If true, colors the background instead of the text.
12
- *
13
- * @returns A function that colors the input string.
14
- *
15
- * @example Usage
16
- * ```ts
17
- * import { createColor } from "@std/internal";
18
- * import { assertEquals } from "@std/assert";
19
- * import { bold, green, red, white } from "@std/fmt/colors";
20
- *
21
- * assertEquals(createColor("added")("foo"), green(bold("foo")));
22
- * assertEquals(createColor("removed")("foo"), red(bold("foo")));
23
- * assertEquals(createColor("common")("foo"), white("foo"));
24
- * ```
25
- */
26
- export function createColor(
27
- diffType: DiffType,
28
- /**
29
- * TODO(@littledivy): Remove this when we can detect true color terminals. See
30
- * https://github.com/denoland/deno_std/issues/2575.
31
- */
32
- background = false,
33
- ): (s: string) => string {
34
- switch (diffType) {
35
- case "added":
36
- return (s) => background ? bgGreen(white(s)) : green(bold(s));
37
- case "removed":
38
- return (s) => background ? bgRed(white(s)) : red(bold(s));
39
- default:
40
- return white;
41
- }
42
- }
43
-
44
- /**
45
- * Prefixes `+` or `-` in diff output.
46
- *
47
- * @param diffType Difference type, either added or removed
48
- *
49
- * @returns A string representing the sign.
50
- *
51
- * @example Usage
52
- * ```ts
53
- * import { createSign } from "@std/internal";
54
- * import { assertEquals } from "@std/assert";
55
- *
56
- * assertEquals(createSign("added"), "+ ");
57
- * assertEquals(createSign("removed"), "- ");
58
- * assertEquals(createSign("common"), " ");
59
- * ```
60
- */
61
- export function createSign(diffType: DiffType): string {
62
- switch (diffType) {
63
- case "added":
64
- return "+ ";
65
- case "removed":
66
- return "- ";
67
- default:
68
- return " ";
69
- }
70
- }
71
-
72
- /** Options for {@linkcode buildMessage}. */
73
- export interface BuildMessageOptions {
74
- /**
75
- * Whether to output the diff as a single string.
76
- *
77
- * @default {false}
78
- */
79
- stringDiff?: boolean;
80
- }
81
-
82
- /**
83
- * Builds a message based on the provided diff result.
84
- *
85
- * @param diffResult The diff result array.
86
- * @param options Optional parameters for customizing the message.
87
- *
88
- * @returns An array of strings representing the built message.
89
- *
90
- * @example Usage
91
- * ```ts no-assert
92
- * import { diffStr, buildMessage } from "@std/internal";
93
- *
94
- * const diffResult = diffStr("Hello, world!", "Hello, world");
95
- *
96
- * console.log(buildMessage(diffResult));
97
- * // [
98
- * // "",
99
- * // "",
100
- * // " [Diff] Actual / Expected",
101
- * // "",
102
- * // "",
103
- * // "- Hello, world!",
104
- * // "+ Hello, world",
105
- * // "",
106
- * // ]
107
- * ```
108
- */
109
- export function buildMessage(
110
- diffResult: ReadonlyArray<DiffResult<string>>,
111
- options: BuildMessageOptions = {},
112
- ): string[] {
113
- const { stringDiff = false } = options;
114
- const messages = [
115
- "",
116
- "",
117
- ` ${gray(bold("[Diff]"))} ${red(bold("Actual"))} / ${
118
- green(bold("Expected"))
119
- }`,
120
- "",
121
- "",
122
- ];
123
- const diffMessages = diffResult.map((result) => {
124
- const color = createColor(result.type);
125
- const line = result.details?.map((detail) =>
126
- detail.type !== "common"
127
- ? createColor(detail.type, true)(detail.value)
128
- : detail.value
129
- ).join("") ?? result.value;
130
- return color(`${createSign(result.type)}${line}`);
131
- });
132
- messages.push(...(stringDiff ? [diffMessages.join("")] : diffMessages), "");
133
- return messages;
134
- }