structured-outputs 0.1.0-beta.20 → 0.1.0-beta.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (320) hide show
  1. package/esm/ResponseFormat.d.ts +21 -0
  2. package/esm/ResponseFormat.d.ts.map +1 -0
  3. package/esm/ResponseFormat.js +43 -19
  4. package/esm/ResponseFormat.js.map +1 -1
  5. package/esm/oai.d.ts +5 -0
  6. package/esm/oai.d.ts.map +1 -0
  7. package/esm/oai.js +2 -0
  8. package/esm/oai.js.map +1 -0
  9. package/package.json +5 -10
  10. package/src/ResponseFormat.ts +48 -41
  11. package/src/oai.ts +5 -0
  12. package/esm/_dnt.shims.js +0 -58
  13. package/esm/_dnt.shims.js.map +0 -1
  14. package/esm/deps/jsr.io/@std/assert/1.0.8/almost_equals.js +0 -47
  15. package/esm/deps/jsr.io/@std/assert/1.0.8/almost_equals.js.map +0 -1
  16. package/esm/deps/jsr.io/@std/assert/1.0.8/array_includes.js +0 -47
  17. package/esm/deps/jsr.io/@std/assert/1.0.8/array_includes.js.map +0 -1
  18. package/esm/deps/jsr.io/@std/assert/1.0.8/assert.js +0 -23
  19. package/esm/deps/jsr.io/@std/assert/1.0.8/assert.js.map +0 -1
  20. package/esm/deps/jsr.io/@std/assert/1.0.8/assertion_error.js +0 -31
  21. package/esm/deps/jsr.io/@std/assert/1.0.8/assertion_error.js.map +0 -1
  22. package/esm/deps/jsr.io/@std/assert/1.0.8/equal.js +0 -184
  23. package/esm/deps/jsr.io/@std/assert/1.0.8/equal.js.map +0 -1
  24. package/esm/deps/jsr.io/@std/assert/1.0.8/equals.js +0 -46
  25. package/esm/deps/jsr.io/@std/assert/1.0.8/equals.js.map +0 -1
  26. package/esm/deps/jsr.io/@std/assert/1.0.8/exists.js +0 -28
  27. package/esm/deps/jsr.io/@std/assert/1.0.8/exists.js.map +0 -1
  28. package/esm/deps/jsr.io/@std/assert/1.0.8/fail.js +0 -21
  29. package/esm/deps/jsr.io/@std/assert/1.0.8/fail.js.map +0 -1
  30. package/esm/deps/jsr.io/@std/assert/1.0.8/false.js +0 -23
  31. package/esm/deps/jsr.io/@std/assert/1.0.8/false.js.map +0 -1
  32. package/esm/deps/jsr.io/@std/assert/1.0.8/greater.js +0 -30
  33. package/esm/deps/jsr.io/@std/assert/1.0.8/greater.js.map +0 -1
  34. package/esm/deps/jsr.io/@std/assert/1.0.8/greater_or_equal.js +0 -30
  35. package/esm/deps/jsr.io/@std/assert/1.0.8/greater_or_equal.js.map +0 -1
  36. package/esm/deps/jsr.io/@std/assert/1.0.8/instance_of.js +0 -53
  37. package/esm/deps/jsr.io/@std/assert/1.0.8/instance_of.js.map +0 -1
  38. package/esm/deps/jsr.io/@std/assert/1.0.8/is_error.js +0 -54
  39. package/esm/deps/jsr.io/@std/assert/1.0.8/is_error.js.map +0 -1
  40. package/esm/deps/jsr.io/@std/assert/1.0.8/less.js +0 -29
  41. package/esm/deps/jsr.io/@std/assert/1.0.8/less.js.map +0 -1
  42. package/esm/deps/jsr.io/@std/assert/1.0.8/less_or_equal.js +0 -30
  43. package/esm/deps/jsr.io/@std/assert/1.0.8/less_or_equal.js.map +0 -1
  44. package/esm/deps/jsr.io/@std/assert/1.0.8/match.js +0 -27
  45. package/esm/deps/jsr.io/@std/assert/1.0.8/match.js.map +0 -1
  46. package/esm/deps/jsr.io/@std/assert/1.0.8/mod.js +0 -46
  47. package/esm/deps/jsr.io/@std/assert/1.0.8/mod.js.map +0 -1
  48. package/esm/deps/jsr.io/@std/assert/1.0.8/not_equals.js +0 -33
  49. package/esm/deps/jsr.io/@std/assert/1.0.8/not_equals.js.map +0 -1
  50. package/esm/deps/jsr.io/@std/assert/1.0.8/not_instance_of.js +0 -30
  51. package/esm/deps/jsr.io/@std/assert/1.0.8/not_instance_of.js.map +0 -1
  52. package/esm/deps/jsr.io/@std/assert/1.0.8/not_match.js +0 -27
  53. package/esm/deps/jsr.io/@std/assert/1.0.8/not_match.js.map +0 -1
  54. package/esm/deps/jsr.io/@std/assert/1.0.8/not_strict_equals.js +0 -33
  55. package/esm/deps/jsr.io/@std/assert/1.0.8/not_strict_equals.js.map +0 -1
  56. package/esm/deps/jsr.io/@std/assert/1.0.8/object_match.js +0 -160
  57. package/esm/deps/jsr.io/@std/assert/1.0.8/object_match.js.map +0 -1
  58. package/esm/deps/jsr.io/@std/assert/1.0.8/rejects.js +0 -54
  59. package/esm/deps/jsr.io/@std/assert/1.0.8/rejects.js.map +0 -1
  60. package/esm/deps/jsr.io/@std/assert/1.0.8/strict_equals.js +0 -58
  61. package/esm/deps/jsr.io/@std/assert/1.0.8/strict_equals.js.map +0 -1
  62. package/esm/deps/jsr.io/@std/assert/1.0.8/string_includes.js +0 -27
  63. package/esm/deps/jsr.io/@std/assert/1.0.8/string_includes.js.map +0 -1
  64. package/esm/deps/jsr.io/@std/assert/1.0.8/throws.js +0 -45
  65. package/esm/deps/jsr.io/@std/assert/1.0.8/throws.js.map +0 -1
  66. package/esm/deps/jsr.io/@std/assert/1.0.8/unimplemented.js +0 -21
  67. package/esm/deps/jsr.io/@std/assert/1.0.8/unimplemented.js.map +0 -1
  68. package/esm/deps/jsr.io/@std/assert/1.0.8/unreachable.js +0 -21
  69. package/esm/deps/jsr.io/@std/assert/1.0.8/unreachable.js.map +0 -1
  70. package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.js +0 -111
  71. package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.js.map +0 -1
  72. package/esm/deps/jsr.io/@std/internal/1.0.5/diff.js +0 -277
  73. package/esm/deps/jsr.io/@std/internal/1.0.5/diff.js.map +0 -1
  74. package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.js +0 -180
  75. package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.js.map +0 -1
  76. package/esm/deps/jsr.io/@std/internal/1.0.5/format.js +0 -38
  77. package/esm/deps/jsr.io/@std/internal/1.0.5/format.js.map +0 -1
  78. package/esm/deps/jsr.io/@std/internal/1.0.5/styles.js +0 -208
  79. package/esm/deps/jsr.io/@std/internal/1.0.5/styles.js.map +0 -1
  80. package/esm/deps/jsr.io/@std/internal/1.0.5/types.js +0 -3
  81. package/esm/deps/jsr.io/@std/internal/1.0.5/types.js.map +0 -1
  82. package/src/_dnt.shims.ts +0 -60
  83. package/src/deps/jsr.io/@std/assert/1.0.8/almost_equals.ts +0 -55
  84. package/src/deps/jsr.io/@std/assert/1.0.8/array_includes.ts +0 -57
  85. package/src/deps/jsr.io/@std/assert/1.0.8/assert.ts +0 -23
  86. package/src/deps/jsr.io/@std/assert/1.0.8/assertion_error.ts +0 -31
  87. package/src/deps/jsr.io/@std/assert/1.0.8/equal.ts +0 -210
  88. package/src/deps/jsr.io/@std/assert/1.0.8/equals.ts +0 -52
  89. package/src/deps/jsr.io/@std/assert/1.0.8/exists.ts +0 -31
  90. package/src/deps/jsr.io/@std/assert/1.0.8/fail.ts +0 -21
  91. package/src/deps/jsr.io/@std/assert/1.0.8/false.ts +0 -26
  92. package/src/deps/jsr.io/@std/assert/1.0.8/greater.ts +0 -30
  93. package/src/deps/jsr.io/@std/assert/1.0.8/greater_or_equal.ts +0 -36
  94. package/src/deps/jsr.io/@std/assert/1.0.8/instance_of.ts +0 -64
  95. package/src/deps/jsr.io/@std/assert/1.0.8/is_error.ts +0 -65
  96. package/src/deps/jsr.io/@std/assert/1.0.8/less.ts +0 -29
  97. package/src/deps/jsr.io/@std/assert/1.0.8/less_or_equal.ts +0 -36
  98. package/src/deps/jsr.io/@std/assert/1.0.8/match.ts +0 -30
  99. package/src/deps/jsr.io/@std/assert/1.0.8/mod.ts +0 -47
  100. package/src/deps/jsr.io/@std/assert/1.0.8/not_equals.ts +0 -36
  101. package/src/deps/jsr.io/@std/assert/1.0.8/not_instance_of.ts +0 -33
  102. package/src/deps/jsr.io/@std/assert/1.0.8/not_match.ts +0 -30
  103. package/src/deps/jsr.io/@std/assert/1.0.8/not_strict_equals.ts +0 -42
  104. package/src/deps/jsr.io/@std/assert/1.0.8/object_match.ts +0 -202
  105. package/src/deps/jsr.io/@std/assert/1.0.8/rejects.ts +0 -123
  106. package/src/deps/jsr.io/@std/assert/1.0.8/strict_equals.ts +0 -67
  107. package/src/deps/jsr.io/@std/assert/1.0.8/string_includes.ts +0 -30
  108. package/src/deps/jsr.io/@std/assert/1.0.8/throws.ts +0 -111
  109. package/src/deps/jsr.io/@std/assert/1.0.8/unimplemented.ts +0 -21
  110. package/src/deps/jsr.io/@std/assert/1.0.8/unreachable.ts +0 -21
  111. package/src/deps/jsr.io/@std/internal/1.0.5/build_message.ts +0 -134
  112. package/src/deps/jsr.io/@std/internal/1.0.5/diff.ts +0 -317
  113. package/src/deps/jsr.io/@std/internal/1.0.5/diff_str.ts +0 -204
  114. package/src/deps/jsr.io/@std/internal/1.0.5/format.ts +0 -39
  115. package/src/deps/jsr.io/@std/internal/1.0.5/styles.ts +0 -233
  116. package/src/deps/jsr.io/@std/internal/1.0.5/types.ts +0 -18
  117. package/types/ResponseFormat.d.ts +0 -26
  118. package/types/ResponseFormat.d.ts.map +0 -1
  119. package/types/_dnt.shims.d.ts +0 -2
  120. package/types/_dnt.shims.d.ts.map +0 -1
  121. package/types/deps/jsr.io/@std/assert/1.0.8/almost_equals.d.ts +0 -29
  122. package/types/deps/jsr.io/@std/assert/1.0.8/almost_equals.d.ts.map +0 -1
  123. package/types/deps/jsr.io/@std/assert/1.0.8/array_includes.d.ts +0 -24
  124. package/types/deps/jsr.io/@std/assert/1.0.8/array_includes.d.ts.map +0 -1
  125. package/types/deps/jsr.io/@std/assert/1.0.8/assert.d.ts +0 -16
  126. package/types/deps/jsr.io/@std/assert/1.0.8/assert.d.ts.map +0 -1
  127. package/types/deps/jsr.io/@std/assert/1.0.8/assertion_error.d.ts +0 -26
  128. package/types/deps/jsr.io/@std/assert/1.0.8/assertion_error.d.ts.map +0 -1
  129. package/types/deps/jsr.io/@std/assert/1.0.8/equal.d.ts +0 -17
  130. package/types/deps/jsr.io/@std/assert/1.0.8/equal.d.ts.map +0 -1
  131. package/types/deps/jsr.io/@std/assert/1.0.8/equals.d.ts +0 -22
  132. package/types/deps/jsr.io/@std/assert/1.0.8/equals.d.ts.map +0 -1
  133. package/types/deps/jsr.io/@std/assert/1.0.8/exists.d.ts +0 -18
  134. package/types/deps/jsr.io/@std/assert/1.0.8/exists.d.ts.map +0 -1
  135. package/types/deps/jsr.io/@std/assert/1.0.8/fail.d.ts +0 -15
  136. package/types/deps/jsr.io/@std/assert/1.0.8/fail.d.ts.map +0 -1
  137. package/types/deps/jsr.io/@std/assert/1.0.8/false.d.ts +0 -18
  138. package/types/deps/jsr.io/@std/assert/1.0.8/false.d.ts.map +0 -1
  139. package/types/deps/jsr.io/@std/assert/1.0.8/greater.d.ts +0 -20
  140. package/types/deps/jsr.io/@std/assert/1.0.8/greater.d.ts.map +0 -1
  141. package/types/deps/jsr.io/@std/assert/1.0.8/greater_or_equal.d.ts +0 -20
  142. package/types/deps/jsr.io/@std/assert/1.0.8/greater_or_equal.d.ts.map +0 -1
  143. package/types/deps/jsr.io/@std/assert/1.0.8/instance_of.d.ts +0 -23
  144. package/types/deps/jsr.io/@std/assert/1.0.8/instance_of.d.ts.map +0 -1
  145. package/types/deps/jsr.io/@std/assert/1.0.8/is_error.d.ts +0 -25
  146. package/types/deps/jsr.io/@std/assert/1.0.8/is_error.d.ts.map +0 -1
  147. package/types/deps/jsr.io/@std/assert/1.0.8/less.d.ts +0 -19
  148. package/types/deps/jsr.io/@std/assert/1.0.8/less.d.ts.map +0 -1
  149. package/types/deps/jsr.io/@std/assert/1.0.8/less_or_equal.d.ts +0 -20
  150. package/types/deps/jsr.io/@std/assert/1.0.8/less_or_equal.d.ts.map +0 -1
  151. package/types/deps/jsr.io/@std/assert/1.0.8/match.d.ts +0 -18
  152. package/types/deps/jsr.io/@std/assert/1.0.8/match.d.ts.map +0 -1
  153. package/types/deps/jsr.io/@std/assert/1.0.8/mod.d.ts +0 -44
  154. package/types/deps/jsr.io/@std/assert/1.0.8/mod.d.ts.map +0 -1
  155. package/types/deps/jsr.io/@std/assert/1.0.8/not_equals.d.ts +0 -21
  156. package/types/deps/jsr.io/@std/assert/1.0.8/not_equals.d.ts.map +0 -1
  157. package/types/deps/jsr.io/@std/assert/1.0.8/not_instance_of.d.ts +0 -20
  158. package/types/deps/jsr.io/@std/assert/1.0.8/not_instance_of.d.ts.map +0 -1
  159. package/types/deps/jsr.io/@std/assert/1.0.8/not_match.d.ts +0 -18
  160. package/types/deps/jsr.io/@std/assert/1.0.8/not_match.d.ts.map +0 -1
  161. package/types/deps/jsr.io/@std/assert/1.0.8/not_strict_equals.d.ts +0 -23
  162. package/types/deps/jsr.io/@std/assert/1.0.8/not_strict_equals.d.ts.map +0 -1
  163. package/types/deps/jsr.io/@std/assert/1.0.8/object_match.d.ts +0 -28
  164. package/types/deps/jsr.io/@std/assert/1.0.8/object_match.d.ts.map +0 -1
  165. package/types/deps/jsr.io/@std/assert/1.0.8/rejects.d.ts +0 -42
  166. package/types/deps/jsr.io/@std/assert/1.0.8/rejects.d.ts.map +0 -1
  167. package/types/deps/jsr.io/@std/assert/1.0.8/strict_equals.d.ts +0 -24
  168. package/types/deps/jsr.io/@std/assert/1.0.8/strict_equals.d.ts.map +0 -1
  169. package/types/deps/jsr.io/@std/assert/1.0.8/string_includes.d.ts +0 -18
  170. package/types/deps/jsr.io/@std/assert/1.0.8/string_includes.d.ts.map +0 -1
  171. package/types/deps/jsr.io/@std/assert/1.0.8/throws.d.ts +0 -45
  172. package/types/deps/jsr.io/@std/assert/1.0.8/throws.d.ts.map +0 -1
  173. package/types/deps/jsr.io/@std/assert/1.0.8/unimplemented.d.ts +0 -15
  174. package/types/deps/jsr.io/@std/assert/1.0.8/unimplemented.d.ts.map +0 -1
  175. package/types/deps/jsr.io/@std/assert/1.0.8/unreachable.d.ts +0 -15
  176. package/types/deps/jsr.io/@std/assert/1.0.8/unreachable.d.ts.map +0 -1
  177. package/types/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts +0 -82
  178. package/types/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +0 -1
  179. package/types/deps/jsr.io/@std/internal/1.0.5/diff.d.ts +0 -140
  180. package/types/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +0 -1
  181. package/types/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts +0 -99
  182. package/types/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +0 -1
  183. package/types/deps/jsr.io/@std/internal/1.0.5/format.d.ts +0 -2
  184. package/types/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +0 -1
  185. package/types/deps/jsr.io/@std/internal/1.0.5/styles.d.ts +0 -159
  186. package/types/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +0 -1
  187. package/types/deps/jsr.io/@std/internal/1.0.5/types.d.ts +0 -16
  188. package/types/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +0 -1
  189. /package/{types → esm}/Tool.d.ts +0 -0
  190. /package/{types → esm}/Tool.d.ts.map +0 -0
  191. /package/{types → esm}/_dnt.polyfills.d.ts +0 -0
  192. /package/{types → esm}/_dnt.polyfills.d.ts.map +0 -0
  193. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/_utils.d.ts +0 -0
  194. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/_utils.d.ts.map +0 -0
  195. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/aggregate_groups.d.ts +0 -0
  196. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/aggregate_groups.d.ts.map +0 -0
  197. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/associate_by.d.ts +0 -0
  198. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/associate_by.d.ts.map +0 -0
  199. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/associate_with.d.ts +0 -0
  200. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/associate_with.d.ts.map +0 -0
  201. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/chunk.d.ts +0 -0
  202. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/chunk.d.ts.map +0 -0
  203. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/deep_merge.d.ts +0 -0
  204. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/deep_merge.d.ts.map +0 -0
  205. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/distinct.d.ts +0 -0
  206. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/distinct.d.ts.map +0 -0
  207. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/distinct_by.d.ts +0 -0
  208. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/distinct_by.d.ts.map +0 -0
  209. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/drop_last_while.d.ts +0 -0
  210. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/drop_last_while.d.ts.map +0 -0
  211. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/drop_while.d.ts +0 -0
  212. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/drop_while.d.ts.map +0 -0
  213. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/filter_entries.d.ts +0 -0
  214. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/filter_entries.d.ts.map +0 -0
  215. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/filter_keys.d.ts +0 -0
  216. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/filter_keys.d.ts.map +0 -0
  217. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/filter_values.d.ts +0 -0
  218. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/filter_values.d.ts.map +0 -0
  219. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/find_single.d.ts +0 -0
  220. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/find_single.d.ts.map +0 -0
  221. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/first_not_nullish_of.d.ts +0 -0
  222. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/first_not_nullish_of.d.ts.map +0 -0
  223. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/includes_value.d.ts +0 -0
  224. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/includes_value.d.ts.map +0 -0
  225. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/intersect.d.ts +0 -0
  226. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/intersect.d.ts.map +0 -0
  227. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/invert.d.ts +0 -0
  228. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/invert.d.ts.map +0 -0
  229. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/invert_by.d.ts +0 -0
  230. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/invert_by.d.ts.map +0 -0
  231. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/join_to_string.d.ts +0 -0
  232. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/join_to_string.d.ts.map +0 -0
  233. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/map_entries.d.ts +0 -0
  234. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/map_entries.d.ts.map +0 -0
  235. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/map_keys.d.ts +0 -0
  236. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/map_keys.d.ts.map +0 -0
  237. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/map_not_nullish.d.ts +0 -0
  238. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/map_not_nullish.d.ts.map +0 -0
  239. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/map_values.d.ts +0 -0
  240. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/map_values.d.ts.map +0 -0
  241. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/max_by.d.ts +0 -0
  242. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/max_by.d.ts.map +0 -0
  243. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/max_of.d.ts +0 -0
  244. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/max_of.d.ts.map +0 -0
  245. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/max_with.d.ts +0 -0
  246. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/max_with.d.ts.map +0 -0
  247. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/min_by.d.ts +0 -0
  248. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/min_by.d.ts.map +0 -0
  249. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/min_of.d.ts +0 -0
  250. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/min_of.d.ts.map +0 -0
  251. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/min_with.d.ts +0 -0
  252. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/min_with.d.ts.map +0 -0
  253. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/mod.d.ts +0 -0
  254. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/mod.d.ts.map +0 -0
  255. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/omit.d.ts +0 -0
  256. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/omit.d.ts.map +0 -0
  257. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/partition.d.ts +0 -0
  258. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/partition.d.ts.map +0 -0
  259. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/partition_entries.d.ts +0 -0
  260. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/partition_entries.d.ts.map +0 -0
  261. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/permutations.d.ts +0 -0
  262. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/permutations.d.ts.map +0 -0
  263. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/pick.d.ts +0 -0
  264. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/pick.d.ts.map +0 -0
  265. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/reduce_groups.d.ts +0 -0
  266. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/reduce_groups.d.ts.map +0 -0
  267. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/running_reduce.d.ts +0 -0
  268. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/running_reduce.d.ts.map +0 -0
  269. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/sample.d.ts +0 -0
  270. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/sample.d.ts.map +0 -0
  271. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/sliding_windows.d.ts +0 -0
  272. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/sliding_windows.d.ts.map +0 -0
  273. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/sort_by.d.ts +0 -0
  274. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/sort_by.d.ts.map +0 -0
  275. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/sum_of.d.ts +0 -0
  276. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/sum_of.d.ts.map +0 -0
  277. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/take_last_while.d.ts +0 -0
  278. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/take_last_while.d.ts.map +0 -0
  279. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/take_while.d.ts +0 -0
  280. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/take_while.d.ts.map +0 -0
  281. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/union.d.ts +0 -0
  282. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/union.d.ts.map +0 -0
  283. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/unzip.d.ts +0 -0
  284. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/unzip.d.ts.map +0 -0
  285. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/without_all.d.ts +0 -0
  286. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/without_all.d.ts.map +0 -0
  287. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/zip.d.ts +0 -0
  288. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/zip.d.ts.map +0 -0
  289. /package/{types → esm}/mod.d.ts +0 -0
  290. /package/{types → esm}/mod.d.ts.map +0 -0
  291. /package/{types → esm}/types/Ref.d.ts +0 -0
  292. /package/{types → esm}/types/Ref.d.ts.map +0 -0
  293. /package/{types → esm}/types/RootTy.d.ts +0 -0
  294. /package/{types → esm}/types/RootTy.d.ts.map +0 -0
  295. /package/{types → esm}/types/Ty.d.ts +0 -0
  296. /package/{types → esm}/types/Ty.d.ts.map +0 -0
  297. /package/{types → esm}/types/array.d.ts +0 -0
  298. /package/{types → esm}/types/array.d.ts.map +0 -0
  299. /package/{types → esm}/types/constant.d.ts +0 -0
  300. /package/{types → esm}/types/constant.d.ts.map +0 -0
  301. /package/{types → esm}/types/constantUnion.d.ts +0 -0
  302. /package/{types → esm}/types/constantUnion.d.ts.map +0 -0
  303. /package/{types → esm}/types/leaves.d.ts +0 -0
  304. /package/{types → esm}/types/leaves.d.ts.map +0 -0
  305. /package/{types → esm}/types/mod.d.ts +0 -0
  306. /package/{types → esm}/types/mod.d.ts.map +0 -0
  307. /package/{types → esm}/types/object.d.ts +0 -0
  308. /package/{types → esm}/types/object.d.ts.map +0 -0
  309. /package/{types → esm}/types/std/Option.d.ts +0 -0
  310. /package/{types → esm}/types/std/Option.d.ts.map +0 -0
  311. /package/{types → esm}/types/std/Wrapper.d.ts +0 -0
  312. /package/{types → esm}/types/std/Wrapper.d.ts.map +0 -0
  313. /package/{types → esm}/types/std/mod.d.ts +0 -0
  314. /package/{types → esm}/types/std/mod.d.ts.map +0 -0
  315. /package/{types → esm}/types/taggedUnion.d.ts +0 -0
  316. /package/{types → esm}/types/taggedUnion.d.ts.map +0 -0
  317. /package/{types → esm}/util/phantoms.d.ts +0 -0
  318. /package/{types → esm}/util/phantoms.d.ts.map +0 -0
  319. /package/{types → esm}/util/recombineTaggedTemplateArgs.d.ts +0 -0
  320. /package/{types → esm}/util/recombineTaggedTemplateArgs.d.ts.map +0 -0
@@ -1,208 +0,0 @@
1
- // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
- // This module is browser compatible.
3
- // A module to print ANSI terminal colors. Inspired by chalk, kleur, and colors
4
- // on npm.
5
- // This code is vendored from `fmt/colors.ts`.
6
- // deno-lint-ignore no-explicit-any
7
- import * as dntShim from "../../../../../_dnt.shims.js";
8
- const { Deno } = dntShim.dntGlobalThis;
9
- const noColor = typeof Deno?.noColor === "boolean"
10
- ? Deno.noColor
11
- : false;
12
- const enabled = !noColor;
13
- function code(open, close) {
14
- return {
15
- open: `\x1b[${open.join(";")}m`,
16
- close: `\x1b[${close}m`,
17
- regexp: new RegExp(`\\x1b\\[${close}m`, "g"),
18
- };
19
- }
20
- function run(str, code) {
21
- return enabled
22
- ? `${code.open}${str.replace(code.regexp, code.open)}${code.close}`
23
- : str;
24
- }
25
- /**
26
- * Sets the style of text to be printed to bold.
27
- *
28
- * Disable by setting the `NO_COLOR` environmental variable.
29
- *
30
- * @param str Text to make bold
31
- *
32
- * @returns Bold text for printing
33
- *
34
- * @example Usage
35
- * ```ts no-assert
36
- * import { bold } from "@std/internal/styles";
37
- *
38
- * console.log(bold("Hello, world!")); // Prints "Hello, world!" in bold
39
- * ```
40
- */
41
- export function bold(str) {
42
- return run(str, code([1], 22));
43
- }
44
- /**
45
- * Sets the color of text to be printed to red.
46
- *
47
- * Disable by setting the `NO_COLOR` environmental variable.
48
- *
49
- * @param str Text to make red
50
- *
51
- * @returns Red text for printing
52
- *
53
- * @example Usage
54
- * ```ts no-assert
55
- * import { red } from "@std/internal/styles";
56
- *
57
- * console.log(red("Hello, world!")); // Prints "Hello, world!" in red
58
- * ```
59
- */
60
- export function red(str) {
61
- return run(str, code([31], 39));
62
- }
63
- /**
64
- * Sets the color of text to be printed to green.
65
- *
66
- * Disable by setting the `NO_COLOR` environmental variable.
67
- *
68
- * @param str Text to make green
69
- *
70
- * @returns Green text for print
71
- *
72
- * @example Usage
73
- * ```ts no-assert
74
- * import { green } from "@std/internal/styles";
75
- *
76
- * console.log(green("Hello, world!")); // Prints "Hello, world!" in green
77
- * ```
78
- */
79
- export function green(str) {
80
- return run(str, code([32], 39));
81
- }
82
- /**
83
- * Sets the color of text to be printed to yellow.
84
- *
85
- * Disable by setting the `NO_COLOR` environmental variable.
86
- *
87
- * @param str Text to make yellow
88
- *
89
- * @returns Yellow text for print
90
- *
91
- * @example Usage
92
- * ```ts no-assert
93
- * import { yellow } from "@std/internal/styles";
94
- *
95
- * console.log(yellow("Hello, world!")); // Prints "Hello, world!" in yellow
96
- * ```
97
- */
98
- export function yellow(str) {
99
- return run(str, code([33], 39));
100
- }
101
- /**
102
- * Sets the color of text to be printed to white.
103
- *
104
- * @param str Text to make white
105
- *
106
- * @returns White text for print
107
- *
108
- * @example Usage
109
- * ```ts no-assert
110
- * import { white } from "@std/internal/styles";
111
- *
112
- * console.log(white("Hello, world!")); // Prints "Hello, world!" in white
113
- * ```
114
- */
115
- export function white(str) {
116
- return run(str, code([37], 39));
117
- }
118
- /**
119
- * Sets the color of text to be printed to gray.
120
- *
121
- * @param str Text to make gray
122
- *
123
- * @returns Gray text for print
124
- *
125
- * @example Usage
126
- * ```ts no-assert
127
- * import { gray } from "@std/internal/styles";
128
- *
129
- * console.log(gray("Hello, world!")); // Prints "Hello, world!" in gray
130
- * ```
131
- */
132
- export function gray(str) {
133
- return brightBlack(str);
134
- }
135
- /**
136
- * Sets the color of text to be printed to bright-black.
137
- *
138
- * @param str Text to make bright-black
139
- *
140
- * @returns Bright-black text for print
141
- *
142
- * @example Usage
143
- * ```ts no-assert
144
- * import { brightBlack } from "@std/internal/styles";
145
- *
146
- * console.log(brightBlack("Hello, world!")); // Prints "Hello, world!" in bright-black
147
- * ```
148
- */
149
- export function brightBlack(str) {
150
- return run(str, code([90], 39));
151
- }
152
- /**
153
- * Sets the background color of text to be printed to red.
154
- *
155
- * @param str Text to make its background red
156
- *
157
- * @returns Red background text for print
158
- *
159
- * @example Usage
160
- * ```ts no-assert
161
- * import { bgRed } from "@std/internal/styles";
162
- *
163
- * console.log(bgRed("Hello, world!")); // Prints "Hello, world!" with red background
164
- * ```
165
- */
166
- export function bgRed(str) {
167
- return run(str, code([41], 49));
168
- }
169
- /**
170
- * Sets the background color of text to be printed to green.
171
- *
172
- * @param str Text to make its background green
173
- *
174
- * @returns Green background text for print
175
- *
176
- * @example Usage
177
- * ```ts no-assert
178
- * import { bgGreen } from "@std/internal/styles";
179
- *
180
- * console.log(bgGreen("Hello, world!")); // Prints "Hello, world!" with green background
181
- * ```
182
- */
183
- export function bgGreen(str) {
184
- return run(str, code([42], 49));
185
- }
186
- // https://github.com/chalk/ansi-regex/blob/02fa893d619d3da85411acc8fd4e2eea0e95a9d9/index.js
187
- const ANSI_PATTERN = new RegExp([
188
- "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
189
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TXZcf-nq-uy=><~]))",
190
- ].join("|"), "g");
191
- /**
192
- * Remove ANSI escape codes from the string.
193
- *
194
- * @param string Text to remove ANSI escape codes from
195
- *
196
- * @returns Text without ANSI escape codes
197
- *
198
- * @example Usage
199
- * ```ts no-assert
200
- * import { red, stripAnsiCode } from "@std/internal/styles";
201
- *
202
- * console.log(stripAnsiCode(red("Hello, world!"))); // Prints "Hello, world!"
203
- * ```
204
- */
205
- export function stripAnsiCode(string) {
206
- return string.replace(ANSI_PATTERN, "");
207
- }
208
- //# sourceMappingURL=styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.5/styles.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AACrC,+EAA+E;AAC/E,UAAU;AAEV,8CAA8C;AAE9C,mCAAmC;AACnC,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC;AAExD,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,aAAoB,CAAC;AAC9C,MAAM,OAAO,GAAG,OAAO,IAAI,EAAE,OAAO,KAAK,SAAS;IAChD,CAAC,CAAC,IAAI,CAAC,OAAkB;IACzB,CAAC,CAAC,KAAK,CAAC;AAQV,MAAM,OAAO,GAAG,CAAC,OAAO,CAAC;AAEzB,SAAS,IAAI,CAAC,IAAc,EAAE,KAAa;IACzC,OAAO;QACL,IAAI,EAAE,QAAQ,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG;QAC/B,KAAK,EAAE,QAAQ,KAAK,GAAG;QACvB,MAAM,EAAE,IAAI,MAAM,CAAC,WAAW,KAAK,GAAG,EAAE,GAAG,CAAC;KAC7C,CAAC;AACJ,CAAC;AAED,SAAS,GAAG,CAAC,GAAW,EAAE,IAAU;IAClC,OAAO,OAAO;QACZ,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE;QACnE,CAAC,CAAC,GAAG,CAAC;AACV,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,IAAI,CAAC,GAAW;IAC9B,OAAO,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AACjC,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,GAAG,CAAC,GAAW;IAC7B,OAAO,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAClC,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,KAAK,CAAC,GAAW;IAC/B,OAAO,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAClC,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,MAAM,CAAC,GAAW;IAChC,OAAO,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAClC,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,KAAK,CAAC,GAAW;IAC/B,OAAO,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAClC,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,IAAI,CAAC,GAAW;IAC9B,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC;AAC1B,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,OAAO,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAClC,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,KAAK,CAAC,GAAW;IAC/B,OAAO,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAClC,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,OAAO,CAAC,GAAW;IACjC,OAAO,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAClC,CAAC;AAED,6FAA6F;AAC7F,MAAM,YAAY,GAAG,IAAI,MAAM,CAC7B;IACE,8HAA8H;IAC9H,2DAA2D;CAC5D,CAAC,IAAI,CAAC,GAAG,CAAC,EACX,GAAG,CACJ,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,OAAO,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AAC1C,CAAC"}
@@ -1,3 +0,0 @@
1
- // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
- export {};
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/internal/1.0.5/types.ts"],"names":[],"mappings":"AAAA,0EAA0E"}
package/src/_dnt.shims.ts DELETED
@@ -1,60 +0,0 @@
1
- const dntGlobals = {
2
- };
3
- export const dntGlobalThis = createMergeProxy(globalThis, dntGlobals);
4
-
5
- function createMergeProxy<T extends object, U extends object>(
6
- baseObj: T,
7
- extObj: U,
8
- ): Omit<T, keyof U> & U {
9
- return new Proxy(baseObj, {
10
- get(_target, prop, _receiver) {
11
- if (prop in extObj) {
12
- return (extObj as any)[prop];
13
- } else {
14
- return (baseObj as any)[prop];
15
- }
16
- },
17
- set(_target, prop, value) {
18
- if (prop in extObj) {
19
- delete (extObj as any)[prop];
20
- }
21
- (baseObj as any)[prop] = value;
22
- return true;
23
- },
24
- deleteProperty(_target, prop) {
25
- let success = false;
26
- if (prop in extObj) {
27
- delete (extObj as any)[prop];
28
- success = true;
29
- }
30
- if (prop in baseObj) {
31
- delete (baseObj as any)[prop];
32
- success = true;
33
- }
34
- return success;
35
- },
36
- ownKeys(_target) {
37
- const baseKeys = Reflect.ownKeys(baseObj);
38
- const extKeys = Reflect.ownKeys(extObj);
39
- const extKeysSet = new Set(extKeys);
40
- return [...baseKeys.filter((k) => !extKeysSet.has(k)), ...extKeys];
41
- },
42
- defineProperty(_target, prop, desc) {
43
- if (prop in extObj) {
44
- delete (extObj as any)[prop];
45
- }
46
- Reflect.defineProperty(baseObj, prop, desc);
47
- return true;
48
- },
49
- getOwnPropertyDescriptor(_target, prop) {
50
- if (prop in extObj) {
51
- return Reflect.getOwnPropertyDescriptor(extObj, prop);
52
- } else {
53
- return Reflect.getOwnPropertyDescriptor(baseObj, prop);
54
- }
55
- },
56
- has(_target, prop) {
57
- return prop in extObj || prop in baseObj;
58
- },
59
- }) as any;
60
- }
@@ -1,55 +0,0 @@
1
- // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
- // This module is browser compatible.
3
- import { AssertionError } from "./assertion_error.js";
4
-
5
- /**
6
- * Make an assertion that `actual` and `expected` are almost equal numbers
7
- * through a given tolerance. It can be used to take into account IEEE-754
8
- * double-precision floating-point representation limitations. If the values
9
- * are not almost equal then throw.
10
- *
11
- * The default tolerance is one hundred thousandth of a percent of the
12
- * expected value.
13
- *
14
- * @example Usage
15
- * ```ts ignore
16
- * import { assertAlmostEquals } from "@std/assert";
17
- *
18
- * assertAlmostEquals(0.01, 0.02); // Throws
19
- * assertAlmostEquals(1e-8, 1e-9); // Throws
20
- * assertAlmostEquals(1.000000001e-8, 1.000000002e-8); // Doesn't throw
21
- * assertAlmostEquals(0.01, 0.02, 0.1); // Doesn't throw
22
- * assertAlmostEquals(0.1 + 0.2, 0.3, 1e-16); // Doesn't throw
23
- * assertAlmostEquals(0.1 + 0.2, 0.3, 1e-17); // Throws
24
- * ```
25
- *
26
- * @param actual The actual value to compare.
27
- * @param expected The expected value to compare.
28
- * @param tolerance The tolerance to consider the values almost equal. The
29
- * default is one hundred thousandth of a percent of the expected value.
30
- * @param msg The optional message to include in the error.
31
- */
32
- export function assertAlmostEquals(
33
- actual: number,
34
- expected: number,
35
- tolerance?: number,
36
- msg?: string,
37
- ) {
38
- if (Object.is(actual, expected)) {
39
- return;
40
- }
41
- const delta = Math.abs(expected - actual);
42
- if (tolerance === undefined) {
43
- tolerance = isFinite(expected) ? Math.abs(expected * 1e-7) : 1e-7;
44
- }
45
- if (delta <= tolerance) {
46
- return;
47
- }
48
-
49
- const msgSuffix = msg ? `: ${msg}` : ".";
50
- const f = (n: number) => Number.isInteger(n) ? n : n.toExponential();
51
- throw new AssertionError(
52
- `Expected actual: "${f(actual)}" to be close to "${f(expected)}": \
53
- delta "${f(delta)}" is greater than "${f(tolerance)}"${msgSuffix}`,
54
- );
55
- }
@@ -1,57 +0,0 @@
1
- // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
- // This module is browser compatible.
3
- import { equal } from "./equal.js";
4
- import { format } from "../../internal/1.0.5/format.js";
5
- import { AssertionError } from "./assertion_error.js";
6
-
7
- /** An array-like object (`Array`, `Uint8Array`, `NodeList`, etc.) that is not a string */
8
- export type ArrayLikeArg<T> = ArrayLike<T> & object;
9
-
10
- /**
11
- * Make an assertion that `actual` includes the `expected` values. If not then
12
- * an error will be thrown.
13
- *
14
- * Type parameter can be specified to ensure values under comparison have the
15
- * same type.
16
- *
17
- * @example Usage
18
- * ```ts ignore
19
- * import { assertArrayIncludes } from "@std/assert";
20
- *
21
- * assertArrayIncludes([1, 2], [2]); // Doesn't throw
22
- * assertArrayIncludes([1, 2], [3]); // Throws
23
- * ```
24
- *
25
- * @typeParam T The type of the elements in the array to compare.
26
- * @param actual The array-like object to check for.
27
- * @param expected The array-like object to check for.
28
- * @param msg The optional message to display if the assertion fails.
29
- */
30
- export function assertArrayIncludes<T>(
31
- actual: ArrayLikeArg<T>,
32
- expected: ArrayLikeArg<T>,
33
- msg?: string,
34
- ) {
35
- const missing: unknown[] = [];
36
- for (let i = 0; i < expected.length; i++) {
37
- let found = false;
38
- for (let j = 0; j < actual.length; j++) {
39
- if (equal(expected[i], actual[j])) {
40
- found = true;
41
- break;
42
- }
43
- }
44
- if (!found) {
45
- missing.push(expected[i]);
46
- }
47
- }
48
- if (missing.length === 0) {
49
- return;
50
- }
51
-
52
- const msgSuffix = msg ? `: ${msg}` : ".";
53
- msg = `Expected actual: "${format(actual)}" to include: "${
54
- format(expected)
55
- }"${msgSuffix}\nmissing: ${format(missing)}`;
56
- throw new AssertionError(msg);
57
- }
@@ -1,23 +0,0 @@
1
- // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
- // This module is browser compatible.
3
- import { AssertionError } from "./assertion_error.js";
4
-
5
- /**
6
- * Make an assertion, error will be thrown if `expr` does not have truthy value.
7
- *
8
- * @example Usage
9
- * ```ts ignore
10
- * import { assert } from "@std/assert";
11
- *
12
- * assert("hello".includes("ello")); // Doesn't throw
13
- * assert("hello".includes("world")); // Throws
14
- * ```
15
- *
16
- * @param expr The expression to test.
17
- * @param msg The optional message to display if the assertion fails.
18
- */
19
- export function assert(expr: unknown, msg = ""): asserts expr {
20
- if (!expr) {
21
- throw new AssertionError(msg);
22
- }
23
- }
@@ -1,31 +0,0 @@
1
- // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
- // This module is browser compatible.
3
-
4
- /**
5
- * Error thrown when an assertion fails.
6
- *
7
- * @example Usage
8
- * ```ts ignore
9
- * import { AssertionError } from "@std/assert";
10
- *
11
- * try {
12
- * throw new AssertionError("foo", { cause: "bar" });
13
- * } catch (error) {
14
- * if (error instanceof AssertionError) {
15
- * error.message === "foo"; // true
16
- * error.cause === "bar"; // true
17
- * }
18
- * }
19
- * ```
20
- */
21
- export class AssertionError extends Error {
22
- /** Constructs a new instance.
23
- *
24
- * @param message The error message.
25
- * @param options Additional options. This argument is still unstable. It may change in the future release.
26
- */
27
- constructor(message: string, options?: ErrorOptions) {
28
- super(message, options);
29
- this.name = "AssertionError";
30
- }
31
- }
@@ -1,210 +0,0 @@
1
- // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
- // This module is browser compatible.
3
- import * as dntShim from "../../../../../_dnt.shims.js";
4
-
5
-
6
- type KeyedCollection = Set<unknown> | Map<unknown, unknown>;
7
- function isKeyedCollection(x: unknown): x is KeyedCollection {
8
- return x instanceof Set || x instanceof Map;
9
- }
10
-
11
- function prototypesEqual(a: object, b: object) {
12
- const pa = Object.getPrototypeOf(a);
13
- const pb = Object.getPrototypeOf(b);
14
- return pa === pb ||
15
- pa === Object.prototype && pb === null ||
16
- pa === null && pb === Object.prototype;
17
- }
18
-
19
- function isBasicObjectOrArray(obj: object) {
20
- const proto = Object.getPrototypeOf(obj);
21
- return proto === null || proto === Object.prototype ||
22
- proto === Array.prototype;
23
- }
24
-
25
- // Slightly faster than Reflect.ownKeys in V8 as of 12.9.202.13-rusty (2024-10-28)
26
- function ownKeys(obj: object) {
27
- return [
28
- ...Object.getOwnPropertyNames(obj),
29
- ...Object.getOwnPropertySymbols(obj),
30
- ];
31
- }
32
-
33
- function getKeysDeep(obj: object) {
34
- const keys = new Set<string | symbol>();
35
-
36
- while (obj !== Object.prototype && obj !== Array.prototype && obj != null) {
37
- for (const key of ownKeys(obj)) {
38
- keys.add(key);
39
- }
40
- obj = Object.getPrototypeOf(obj);
41
- }
42
-
43
- return keys;
44
- }
45
-
46
- // deno-lint-ignore no-explicit-any
47
- const Temporal: any = (dntShim.dntGlobalThis as any).Temporal ??
48
- new Proxy({}, { get: () => {} });
49
-
50
- /** A non-exhaustive list of prototypes that can be accurately fast-path compared with `String(instance)` */
51
- const stringComparablePrototypes = new Set<unknown>(
52
- [
53
- Intl.Locale,
54
- RegExp,
55
- Temporal.Duration,
56
- Temporal.Instant,
57
- Temporal.PlainDate,
58
- Temporal.PlainDateTime,
59
- Temporal.PlainTime,
60
- Temporal.PlainYearMonth,
61
- Temporal.PlainMonthDay,
62
- Temporal.ZonedDateTime,
63
- URL,
64
- URLSearchParams,
65
- ].filter((x) => x != null).map((x) => x.prototype),
66
- );
67
-
68
- function isPrimitive(x: unknown) {
69
- return typeof x === "string" ||
70
- typeof x === "number" ||
71
- typeof x === "boolean" ||
72
- typeof x === "bigint" ||
73
- typeof x === "symbol" ||
74
- x == null;
75
- }
76
-
77
- type TypedArray = Pick<Uint8Array | BigUint64Array, "length" | number>;
78
- const TypedArray = Object.getPrototypeOf(Uint8Array);
79
- function compareTypedArrays(a: TypedArray, b: TypedArray) {
80
- if (a.length !== b.length) return false;
81
- for (let i = 0; i < b.length; i++) {
82
- if (!sameValueZero(a[i], b[i])) return false;
83
- }
84
- return true;
85
- }
86
-
87
- /** Check both strict equality (`0 == -0`) and `Object.is` (`NaN == NaN`) */
88
- function sameValueZero(a: unknown, b: unknown) {
89
- return a === b || Object.is(a, b);
90
- }
91
-
92
- /**
93
- * Deep equality comparison used in assertions.
94
- *
95
- * @param a The actual value
96
- * @param b The expected value
97
- * @returns `true` if the values are deeply equal, `false` otherwise
98
- *
99
- * @example Usage
100
- * ```ts
101
- * import { equal } from "@std/assert/equal";
102
- *
103
- * equal({ foo: "bar" }, { foo: "bar" }); // Returns `true`
104
- * equal({ foo: "bar" }, { foo: "baz" }); // Returns `false`
105
- * ```
106
- */
107
- export function equal(a: unknown, b: unknown): boolean {
108
- const seen = new Map<unknown, unknown>();
109
- return (function compare(a: unknown, b: unknown): boolean {
110
- if (sameValueZero(a, b)) return true;
111
- if (isPrimitive(a) || isPrimitive(b)) return false;
112
-
113
- if (a instanceof Date && b instanceof Date) {
114
- return Object.is(a.getTime(), b.getTime());
115
- }
116
- if (a && typeof a === "object" && b && typeof b === "object") {
117
- if (!prototypesEqual(a, b)) {
118
- return false;
119
- }
120
- if (a instanceof TypedArray) {
121
- return compareTypedArrays(a as TypedArray, b as TypedArray);
122
- }
123
- if (a instanceof WeakMap) {
124
- throw new TypeError("cannot compare WeakMap instances");
125
- }
126
- if (a instanceof WeakSet) {
127
- throw new TypeError("cannot compare WeakSet instances");
128
- }
129
- if (a instanceof WeakRef) {
130
- return compare(a.deref(), (b as WeakRef<WeakKey>).deref());
131
- }
132
- if (seen.get(a) === b) {
133
- return true;
134
- }
135
- if (Object.keys(a).length !== Object.keys(b).length) {
136
- return false;
137
- }
138
- seen.set(a, b);
139
- if (isKeyedCollection(a) && isKeyedCollection(b)) {
140
- if (a.size !== b.size) {
141
- return false;
142
- }
143
-
144
- const aKeys = [...a.keys()];
145
- const primitiveKeysFastPath = aKeys.every(isPrimitive);
146
- if (primitiveKeysFastPath) {
147
- if (a instanceof Set) {
148
- return a.symmetricDifference(b).size === 0;
149
- }
150
-
151
- for (const key of aKeys) {
152
- if (
153
- !b.has(key) ||
154
- !compare(a.get(key), (b as Map<unknown, unknown>).get(key))
155
- ) {
156
- return false;
157
- }
158
- }
159
- return true;
160
- }
161
-
162
- let unmatchedEntries = a.size;
163
-
164
- for (const [aKey, aValue] of a.entries()) {
165
- for (const [bKey, bValue] of b.entries()) {
166
- /* Given that Map keys can be references, we need
167
- * to ensure that they are also deeply equal */
168
-
169
- if (!compare(aKey, bKey)) continue;
170
-
171
- if (
172
- (aKey === aValue && bKey === bValue) ||
173
- (compare(aValue, bValue))
174
- ) {
175
- unmatchedEntries--;
176
- break;
177
- }
178
- }
179
- }
180
-
181
- return unmatchedEntries === 0;
182
- }
183
-
184
- let keys: Iterable<string | symbol>;
185
-
186
- if (isBasicObjectOrArray(a)) {
187
- // fast path
188
- keys = ownKeys({ ...a, ...b });
189
- } else if (stringComparablePrototypes.has(Object.getPrototypeOf(a))) {
190
- // medium path
191
- return String(a) === String(b);
192
- } else {
193
- // slow path
194
- keys = getKeysDeep(a).union(getKeysDeep(b));
195
- }
196
-
197
- for (const key of keys) {
198
- type Key = keyof typeof a;
199
- if (!compare(a[key as Key], b[key as Key])) {
200
- return false;
201
- }
202
- if (((key in a) && (!(key in b))) || ((key in b) && (!(key in a)))) {
203
- return false;
204
- }
205
- }
206
- return true;
207
- }
208
- return false;
209
- })(a, b);
210
- }