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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (371) hide show
  1. package/README.md +46 -40
  2. package/esm/ResponseFormat.d.ts +21 -0
  3. package/esm/ResponseFormat.d.ts.map +1 -0
  4. package/esm/ResponseFormat.js +43 -19
  5. package/esm/ResponseFormat.js.map +1 -1
  6. package/{types → esm}/Tool.d.ts +1 -0
  7. package/esm/Tool.d.ts.map +1 -0
  8. package/esm/Tool.js +1 -0
  9. package/esm/Tool.js.map +1 -1
  10. package/esm/oai.d.ts +5 -0
  11. package/esm/oai.d.ts.map +1 -0
  12. package/esm/oai.js +2 -0
  13. package/esm/oai.js.map +1 -0
  14. package/esm/types/Ref.d.ts.map +1 -0
  15. package/esm/types/Ref.js +6 -3
  16. package/esm/types/Ref.js.map +1 -1
  17. package/esm/types/RootTy.d.ts +8 -0
  18. package/esm/types/RootTy.d.ts.map +1 -0
  19. package/esm/types/RootTy.js +5 -7
  20. package/esm/types/RootTy.js.map +1 -1
  21. package/esm/types/Ty.d.ts +23 -0
  22. package/esm/types/Ty.d.ts.map +1 -0
  23. package/esm/types/Ty.js +5 -9
  24. package/esm/types/Ty.js.map +1 -1
  25. package/{types → esm}/types/array.d.ts +1 -1
  26. package/{types → esm}/types/array.d.ts.map +1 -1
  27. package/esm/types/array.js +1 -2
  28. package/esm/types/array.js.map +1 -1
  29. package/{types → esm}/types/constant.d.ts.map +1 -1
  30. package/esm/types/constant.js +1 -2
  31. package/esm/types/constant.js.map +1 -1
  32. package/{types → esm}/types/constantUnion.d.ts.map +1 -1
  33. package/esm/types/constantUnion.js +16 -19
  34. package/esm/types/constantUnion.js.map +1 -1
  35. package/{types → esm}/types/mod.d.ts +3 -3
  36. package/esm/types/mod.d.ts.map +1 -0
  37. package/esm/types/mod.js +3 -3
  38. package/esm/types/mod.js.map +1 -1
  39. package/{types → esm}/types/object.d.ts +2 -2
  40. package/{types → esm}/types/object.d.ts.map +1 -1
  41. package/esm/types/object.js +1 -2
  42. package/esm/types/object.js.map +1 -1
  43. package/{types/types/leaves.d.ts → esm/types/primitives.d.ts} +1 -1
  44. package/esm/types/primitives.d.ts.map +1 -0
  45. package/esm/types/primitives.js +14 -0
  46. package/esm/types/primitives.js.map +1 -0
  47. package/esm/types/std/Option.js +1 -1
  48. package/esm/types/std/Option.js.map +1 -1
  49. package/{types → esm}/types/std/Wrapper.d.ts +0 -1
  50. package/esm/types/std/Wrapper.d.ts.map +1 -0
  51. package/esm/types/std/Wrapper.js.map +1 -1
  52. package/{types → esm}/types/taggedUnion.d.ts +2 -2
  53. package/{types → esm}/types/taggedUnion.d.ts.map +1 -1
  54. package/esm/types/taggedUnion.js +1 -2
  55. package/esm/types/taggedUnion.js.map +1 -1
  56. package/package.json +6 -11
  57. package/src/ResponseFormat.ts +48 -41
  58. package/src/Tool.ts +1 -0
  59. package/src/oai.ts +5 -0
  60. package/src/types/Ref.ts +7 -4
  61. package/src/types/RootTy.ts +11 -13
  62. package/src/types/Ty.ts +23 -30
  63. package/src/types/array.ts +2 -3
  64. package/src/types/constant.ts +1 -2
  65. package/src/types/constantUnion.ts +16 -19
  66. package/src/types/mod.ts +3 -3
  67. package/src/types/object.ts +4 -6
  68. package/src/types/primitives.ts +17 -0
  69. package/src/types/std/Option.ts +1 -1
  70. package/src/types/std/Wrapper.ts +0 -2
  71. package/src/types/taggedUnion.ts +3 -4
  72. package/esm/_dnt.shims.js +0 -58
  73. package/esm/_dnt.shims.js.map +0 -1
  74. package/esm/deps/jsr.io/@std/assert/1.0.8/almost_equals.js +0 -47
  75. package/esm/deps/jsr.io/@std/assert/1.0.8/almost_equals.js.map +0 -1
  76. package/esm/deps/jsr.io/@std/assert/1.0.8/array_includes.js +0 -47
  77. package/esm/deps/jsr.io/@std/assert/1.0.8/array_includes.js.map +0 -1
  78. package/esm/deps/jsr.io/@std/assert/1.0.8/assert.js +0 -23
  79. package/esm/deps/jsr.io/@std/assert/1.0.8/assert.js.map +0 -1
  80. package/esm/deps/jsr.io/@std/assert/1.0.8/assertion_error.js +0 -31
  81. package/esm/deps/jsr.io/@std/assert/1.0.8/assertion_error.js.map +0 -1
  82. package/esm/deps/jsr.io/@std/assert/1.0.8/equal.js +0 -184
  83. package/esm/deps/jsr.io/@std/assert/1.0.8/equal.js.map +0 -1
  84. package/esm/deps/jsr.io/@std/assert/1.0.8/equals.js +0 -46
  85. package/esm/deps/jsr.io/@std/assert/1.0.8/equals.js.map +0 -1
  86. package/esm/deps/jsr.io/@std/assert/1.0.8/exists.js +0 -28
  87. package/esm/deps/jsr.io/@std/assert/1.0.8/exists.js.map +0 -1
  88. package/esm/deps/jsr.io/@std/assert/1.0.8/fail.js +0 -21
  89. package/esm/deps/jsr.io/@std/assert/1.0.8/fail.js.map +0 -1
  90. package/esm/deps/jsr.io/@std/assert/1.0.8/false.js +0 -23
  91. package/esm/deps/jsr.io/@std/assert/1.0.8/false.js.map +0 -1
  92. package/esm/deps/jsr.io/@std/assert/1.0.8/greater.js +0 -30
  93. package/esm/deps/jsr.io/@std/assert/1.0.8/greater.js.map +0 -1
  94. package/esm/deps/jsr.io/@std/assert/1.0.8/greater_or_equal.js +0 -30
  95. package/esm/deps/jsr.io/@std/assert/1.0.8/greater_or_equal.js.map +0 -1
  96. package/esm/deps/jsr.io/@std/assert/1.0.8/instance_of.js +0 -53
  97. package/esm/deps/jsr.io/@std/assert/1.0.8/instance_of.js.map +0 -1
  98. package/esm/deps/jsr.io/@std/assert/1.0.8/is_error.js +0 -54
  99. package/esm/deps/jsr.io/@std/assert/1.0.8/is_error.js.map +0 -1
  100. package/esm/deps/jsr.io/@std/assert/1.0.8/less.js +0 -29
  101. package/esm/deps/jsr.io/@std/assert/1.0.8/less.js.map +0 -1
  102. package/esm/deps/jsr.io/@std/assert/1.0.8/less_or_equal.js +0 -30
  103. package/esm/deps/jsr.io/@std/assert/1.0.8/less_or_equal.js.map +0 -1
  104. package/esm/deps/jsr.io/@std/assert/1.0.8/match.js +0 -27
  105. package/esm/deps/jsr.io/@std/assert/1.0.8/match.js.map +0 -1
  106. package/esm/deps/jsr.io/@std/assert/1.0.8/mod.js +0 -46
  107. package/esm/deps/jsr.io/@std/assert/1.0.8/mod.js.map +0 -1
  108. package/esm/deps/jsr.io/@std/assert/1.0.8/not_equals.js +0 -33
  109. package/esm/deps/jsr.io/@std/assert/1.0.8/not_equals.js.map +0 -1
  110. package/esm/deps/jsr.io/@std/assert/1.0.8/not_instance_of.js +0 -30
  111. package/esm/deps/jsr.io/@std/assert/1.0.8/not_instance_of.js.map +0 -1
  112. package/esm/deps/jsr.io/@std/assert/1.0.8/not_match.js +0 -27
  113. package/esm/deps/jsr.io/@std/assert/1.0.8/not_match.js.map +0 -1
  114. package/esm/deps/jsr.io/@std/assert/1.0.8/not_strict_equals.js +0 -33
  115. package/esm/deps/jsr.io/@std/assert/1.0.8/not_strict_equals.js.map +0 -1
  116. package/esm/deps/jsr.io/@std/assert/1.0.8/object_match.js +0 -160
  117. package/esm/deps/jsr.io/@std/assert/1.0.8/object_match.js.map +0 -1
  118. package/esm/deps/jsr.io/@std/assert/1.0.8/rejects.js +0 -54
  119. package/esm/deps/jsr.io/@std/assert/1.0.8/rejects.js.map +0 -1
  120. package/esm/deps/jsr.io/@std/assert/1.0.8/strict_equals.js +0 -58
  121. package/esm/deps/jsr.io/@std/assert/1.0.8/strict_equals.js.map +0 -1
  122. package/esm/deps/jsr.io/@std/assert/1.0.8/string_includes.js +0 -27
  123. package/esm/deps/jsr.io/@std/assert/1.0.8/string_includes.js.map +0 -1
  124. package/esm/deps/jsr.io/@std/assert/1.0.8/throws.js +0 -45
  125. package/esm/deps/jsr.io/@std/assert/1.0.8/throws.js.map +0 -1
  126. package/esm/deps/jsr.io/@std/assert/1.0.8/unimplemented.js +0 -21
  127. package/esm/deps/jsr.io/@std/assert/1.0.8/unimplemented.js.map +0 -1
  128. package/esm/deps/jsr.io/@std/assert/1.0.8/unreachable.js +0 -21
  129. package/esm/deps/jsr.io/@std/assert/1.0.8/unreachable.js.map +0 -1
  130. package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.js +0 -111
  131. package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.js.map +0 -1
  132. package/esm/deps/jsr.io/@std/internal/1.0.5/diff.js +0 -277
  133. package/esm/deps/jsr.io/@std/internal/1.0.5/diff.js.map +0 -1
  134. package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.js +0 -180
  135. package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.js.map +0 -1
  136. package/esm/deps/jsr.io/@std/internal/1.0.5/format.js +0 -38
  137. package/esm/deps/jsr.io/@std/internal/1.0.5/format.js.map +0 -1
  138. package/esm/deps/jsr.io/@std/internal/1.0.5/styles.js +0 -208
  139. package/esm/deps/jsr.io/@std/internal/1.0.5/styles.js.map +0 -1
  140. package/esm/deps/jsr.io/@std/internal/1.0.5/types.js +0 -3
  141. package/esm/deps/jsr.io/@std/internal/1.0.5/types.js.map +0 -1
  142. package/esm/types/leaves.js +0 -18
  143. package/esm/types/leaves.js.map +0 -1
  144. package/src/_dnt.shims.ts +0 -60
  145. package/src/deps/jsr.io/@std/assert/1.0.8/almost_equals.ts +0 -55
  146. package/src/deps/jsr.io/@std/assert/1.0.8/array_includes.ts +0 -57
  147. package/src/deps/jsr.io/@std/assert/1.0.8/assert.ts +0 -23
  148. package/src/deps/jsr.io/@std/assert/1.0.8/assertion_error.ts +0 -31
  149. package/src/deps/jsr.io/@std/assert/1.0.8/equal.ts +0 -210
  150. package/src/deps/jsr.io/@std/assert/1.0.8/equals.ts +0 -52
  151. package/src/deps/jsr.io/@std/assert/1.0.8/exists.ts +0 -31
  152. package/src/deps/jsr.io/@std/assert/1.0.8/fail.ts +0 -21
  153. package/src/deps/jsr.io/@std/assert/1.0.8/false.ts +0 -26
  154. package/src/deps/jsr.io/@std/assert/1.0.8/greater.ts +0 -30
  155. package/src/deps/jsr.io/@std/assert/1.0.8/greater_or_equal.ts +0 -36
  156. package/src/deps/jsr.io/@std/assert/1.0.8/instance_of.ts +0 -64
  157. package/src/deps/jsr.io/@std/assert/1.0.8/is_error.ts +0 -65
  158. package/src/deps/jsr.io/@std/assert/1.0.8/less.ts +0 -29
  159. package/src/deps/jsr.io/@std/assert/1.0.8/less_or_equal.ts +0 -36
  160. package/src/deps/jsr.io/@std/assert/1.0.8/match.ts +0 -30
  161. package/src/deps/jsr.io/@std/assert/1.0.8/mod.ts +0 -47
  162. package/src/deps/jsr.io/@std/assert/1.0.8/not_equals.ts +0 -36
  163. package/src/deps/jsr.io/@std/assert/1.0.8/not_instance_of.ts +0 -33
  164. package/src/deps/jsr.io/@std/assert/1.0.8/not_match.ts +0 -30
  165. package/src/deps/jsr.io/@std/assert/1.0.8/not_strict_equals.ts +0 -42
  166. package/src/deps/jsr.io/@std/assert/1.0.8/object_match.ts +0 -202
  167. package/src/deps/jsr.io/@std/assert/1.0.8/rejects.ts +0 -123
  168. package/src/deps/jsr.io/@std/assert/1.0.8/strict_equals.ts +0 -67
  169. package/src/deps/jsr.io/@std/assert/1.0.8/string_includes.ts +0 -30
  170. package/src/deps/jsr.io/@std/assert/1.0.8/throws.ts +0 -111
  171. package/src/deps/jsr.io/@std/assert/1.0.8/unimplemented.ts +0 -21
  172. package/src/deps/jsr.io/@std/assert/1.0.8/unreachable.ts +0 -21
  173. package/src/deps/jsr.io/@std/internal/1.0.5/build_message.ts +0 -134
  174. package/src/deps/jsr.io/@std/internal/1.0.5/diff.ts +0 -317
  175. package/src/deps/jsr.io/@std/internal/1.0.5/diff_str.ts +0 -204
  176. package/src/deps/jsr.io/@std/internal/1.0.5/format.ts +0 -39
  177. package/src/deps/jsr.io/@std/internal/1.0.5/styles.ts +0 -233
  178. package/src/deps/jsr.io/@std/internal/1.0.5/types.ts +0 -18
  179. package/src/types/leaves.ts +0 -21
  180. package/types/ResponseFormat.d.ts +0 -26
  181. package/types/ResponseFormat.d.ts.map +0 -1
  182. package/types/Tool.d.ts.map +0 -1
  183. package/types/_dnt.shims.d.ts +0 -2
  184. package/types/_dnt.shims.d.ts.map +0 -1
  185. package/types/deps/jsr.io/@std/assert/1.0.8/almost_equals.d.ts +0 -29
  186. package/types/deps/jsr.io/@std/assert/1.0.8/almost_equals.d.ts.map +0 -1
  187. package/types/deps/jsr.io/@std/assert/1.0.8/array_includes.d.ts +0 -24
  188. package/types/deps/jsr.io/@std/assert/1.0.8/array_includes.d.ts.map +0 -1
  189. package/types/deps/jsr.io/@std/assert/1.0.8/assert.d.ts +0 -16
  190. package/types/deps/jsr.io/@std/assert/1.0.8/assert.d.ts.map +0 -1
  191. package/types/deps/jsr.io/@std/assert/1.0.8/assertion_error.d.ts +0 -26
  192. package/types/deps/jsr.io/@std/assert/1.0.8/assertion_error.d.ts.map +0 -1
  193. package/types/deps/jsr.io/@std/assert/1.0.8/equal.d.ts +0 -17
  194. package/types/deps/jsr.io/@std/assert/1.0.8/equal.d.ts.map +0 -1
  195. package/types/deps/jsr.io/@std/assert/1.0.8/equals.d.ts +0 -22
  196. package/types/deps/jsr.io/@std/assert/1.0.8/equals.d.ts.map +0 -1
  197. package/types/deps/jsr.io/@std/assert/1.0.8/exists.d.ts +0 -18
  198. package/types/deps/jsr.io/@std/assert/1.0.8/exists.d.ts.map +0 -1
  199. package/types/deps/jsr.io/@std/assert/1.0.8/fail.d.ts +0 -15
  200. package/types/deps/jsr.io/@std/assert/1.0.8/fail.d.ts.map +0 -1
  201. package/types/deps/jsr.io/@std/assert/1.0.8/false.d.ts +0 -18
  202. package/types/deps/jsr.io/@std/assert/1.0.8/false.d.ts.map +0 -1
  203. package/types/deps/jsr.io/@std/assert/1.0.8/greater.d.ts +0 -20
  204. package/types/deps/jsr.io/@std/assert/1.0.8/greater.d.ts.map +0 -1
  205. package/types/deps/jsr.io/@std/assert/1.0.8/greater_or_equal.d.ts +0 -20
  206. package/types/deps/jsr.io/@std/assert/1.0.8/greater_or_equal.d.ts.map +0 -1
  207. package/types/deps/jsr.io/@std/assert/1.0.8/instance_of.d.ts +0 -23
  208. package/types/deps/jsr.io/@std/assert/1.0.8/instance_of.d.ts.map +0 -1
  209. package/types/deps/jsr.io/@std/assert/1.0.8/is_error.d.ts +0 -25
  210. package/types/deps/jsr.io/@std/assert/1.0.8/is_error.d.ts.map +0 -1
  211. package/types/deps/jsr.io/@std/assert/1.0.8/less.d.ts +0 -19
  212. package/types/deps/jsr.io/@std/assert/1.0.8/less.d.ts.map +0 -1
  213. package/types/deps/jsr.io/@std/assert/1.0.8/less_or_equal.d.ts +0 -20
  214. package/types/deps/jsr.io/@std/assert/1.0.8/less_or_equal.d.ts.map +0 -1
  215. package/types/deps/jsr.io/@std/assert/1.0.8/match.d.ts +0 -18
  216. package/types/deps/jsr.io/@std/assert/1.0.8/match.d.ts.map +0 -1
  217. package/types/deps/jsr.io/@std/assert/1.0.8/mod.d.ts +0 -44
  218. package/types/deps/jsr.io/@std/assert/1.0.8/mod.d.ts.map +0 -1
  219. package/types/deps/jsr.io/@std/assert/1.0.8/not_equals.d.ts +0 -21
  220. package/types/deps/jsr.io/@std/assert/1.0.8/not_equals.d.ts.map +0 -1
  221. package/types/deps/jsr.io/@std/assert/1.0.8/not_instance_of.d.ts +0 -20
  222. package/types/deps/jsr.io/@std/assert/1.0.8/not_instance_of.d.ts.map +0 -1
  223. package/types/deps/jsr.io/@std/assert/1.0.8/not_match.d.ts +0 -18
  224. package/types/deps/jsr.io/@std/assert/1.0.8/not_match.d.ts.map +0 -1
  225. package/types/deps/jsr.io/@std/assert/1.0.8/not_strict_equals.d.ts +0 -23
  226. package/types/deps/jsr.io/@std/assert/1.0.8/not_strict_equals.d.ts.map +0 -1
  227. package/types/deps/jsr.io/@std/assert/1.0.8/object_match.d.ts +0 -28
  228. package/types/deps/jsr.io/@std/assert/1.0.8/object_match.d.ts.map +0 -1
  229. package/types/deps/jsr.io/@std/assert/1.0.8/rejects.d.ts +0 -42
  230. package/types/deps/jsr.io/@std/assert/1.0.8/rejects.d.ts.map +0 -1
  231. package/types/deps/jsr.io/@std/assert/1.0.8/strict_equals.d.ts +0 -24
  232. package/types/deps/jsr.io/@std/assert/1.0.8/strict_equals.d.ts.map +0 -1
  233. package/types/deps/jsr.io/@std/assert/1.0.8/string_includes.d.ts +0 -18
  234. package/types/deps/jsr.io/@std/assert/1.0.8/string_includes.d.ts.map +0 -1
  235. package/types/deps/jsr.io/@std/assert/1.0.8/throws.d.ts +0 -45
  236. package/types/deps/jsr.io/@std/assert/1.0.8/throws.d.ts.map +0 -1
  237. package/types/deps/jsr.io/@std/assert/1.0.8/unimplemented.d.ts +0 -15
  238. package/types/deps/jsr.io/@std/assert/1.0.8/unimplemented.d.ts.map +0 -1
  239. package/types/deps/jsr.io/@std/assert/1.0.8/unreachable.d.ts +0 -15
  240. package/types/deps/jsr.io/@std/assert/1.0.8/unreachable.d.ts.map +0 -1
  241. package/types/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts +0 -82
  242. package/types/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +0 -1
  243. package/types/deps/jsr.io/@std/internal/1.0.5/diff.d.ts +0 -140
  244. package/types/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +0 -1
  245. package/types/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts +0 -99
  246. package/types/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +0 -1
  247. package/types/deps/jsr.io/@std/internal/1.0.5/format.d.ts +0 -2
  248. package/types/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +0 -1
  249. package/types/deps/jsr.io/@std/internal/1.0.5/styles.d.ts +0 -159
  250. package/types/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +0 -1
  251. package/types/deps/jsr.io/@std/internal/1.0.5/types.d.ts +0 -16
  252. package/types/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +0 -1
  253. package/types/types/Ref.d.ts.map +0 -1
  254. package/types/types/RootTy.d.ts +0 -8
  255. package/types/types/RootTy.d.ts.map +0 -1
  256. package/types/types/Ty.d.ts +0 -27
  257. package/types/types/Ty.d.ts.map +0 -1
  258. package/types/types/leaves.d.ts.map +0 -1
  259. package/types/types/mod.d.ts.map +0 -1
  260. package/types/types/std/Wrapper.d.ts.map +0 -1
  261. /package/{types → esm}/_dnt.polyfills.d.ts +0 -0
  262. /package/{types → esm}/_dnt.polyfills.d.ts.map +0 -0
  263. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/_utils.d.ts +0 -0
  264. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/_utils.d.ts.map +0 -0
  265. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/aggregate_groups.d.ts +0 -0
  266. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/aggregate_groups.d.ts.map +0 -0
  267. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/associate_by.d.ts +0 -0
  268. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/associate_by.d.ts.map +0 -0
  269. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/associate_with.d.ts +0 -0
  270. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/associate_with.d.ts.map +0 -0
  271. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/chunk.d.ts +0 -0
  272. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/chunk.d.ts.map +0 -0
  273. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/deep_merge.d.ts +0 -0
  274. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/deep_merge.d.ts.map +0 -0
  275. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/distinct.d.ts +0 -0
  276. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/distinct.d.ts.map +0 -0
  277. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/distinct_by.d.ts +0 -0
  278. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/distinct_by.d.ts.map +0 -0
  279. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/drop_last_while.d.ts +0 -0
  280. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/drop_last_while.d.ts.map +0 -0
  281. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/drop_while.d.ts +0 -0
  282. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/drop_while.d.ts.map +0 -0
  283. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/filter_entries.d.ts +0 -0
  284. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/filter_entries.d.ts.map +0 -0
  285. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/filter_keys.d.ts +0 -0
  286. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/filter_keys.d.ts.map +0 -0
  287. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/filter_values.d.ts +0 -0
  288. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/filter_values.d.ts.map +0 -0
  289. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/find_single.d.ts +0 -0
  290. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/find_single.d.ts.map +0 -0
  291. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/first_not_nullish_of.d.ts +0 -0
  292. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/first_not_nullish_of.d.ts.map +0 -0
  293. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/includes_value.d.ts +0 -0
  294. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/includes_value.d.ts.map +0 -0
  295. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/intersect.d.ts +0 -0
  296. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/intersect.d.ts.map +0 -0
  297. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/invert.d.ts +0 -0
  298. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/invert.d.ts.map +0 -0
  299. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/invert_by.d.ts +0 -0
  300. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/invert_by.d.ts.map +0 -0
  301. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/join_to_string.d.ts +0 -0
  302. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/join_to_string.d.ts.map +0 -0
  303. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/map_entries.d.ts +0 -0
  304. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/map_entries.d.ts.map +0 -0
  305. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/map_keys.d.ts +0 -0
  306. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/map_keys.d.ts.map +0 -0
  307. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/map_not_nullish.d.ts +0 -0
  308. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/map_not_nullish.d.ts.map +0 -0
  309. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/map_values.d.ts +0 -0
  310. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/map_values.d.ts.map +0 -0
  311. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/max_by.d.ts +0 -0
  312. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/max_by.d.ts.map +0 -0
  313. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/max_of.d.ts +0 -0
  314. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/max_of.d.ts.map +0 -0
  315. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/max_with.d.ts +0 -0
  316. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/max_with.d.ts.map +0 -0
  317. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/min_by.d.ts +0 -0
  318. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/min_by.d.ts.map +0 -0
  319. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/min_of.d.ts +0 -0
  320. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/min_of.d.ts.map +0 -0
  321. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/min_with.d.ts +0 -0
  322. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/min_with.d.ts.map +0 -0
  323. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/mod.d.ts +0 -0
  324. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/mod.d.ts.map +0 -0
  325. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/omit.d.ts +0 -0
  326. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/omit.d.ts.map +0 -0
  327. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/partition.d.ts +0 -0
  328. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/partition.d.ts.map +0 -0
  329. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/partition_entries.d.ts +0 -0
  330. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/partition_entries.d.ts.map +0 -0
  331. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/permutations.d.ts +0 -0
  332. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/permutations.d.ts.map +0 -0
  333. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/pick.d.ts +0 -0
  334. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/pick.d.ts.map +0 -0
  335. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/reduce_groups.d.ts +0 -0
  336. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/reduce_groups.d.ts.map +0 -0
  337. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/running_reduce.d.ts +0 -0
  338. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/running_reduce.d.ts.map +0 -0
  339. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/sample.d.ts +0 -0
  340. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/sample.d.ts.map +0 -0
  341. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/sliding_windows.d.ts +0 -0
  342. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/sliding_windows.d.ts.map +0 -0
  343. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/sort_by.d.ts +0 -0
  344. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/sort_by.d.ts.map +0 -0
  345. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/sum_of.d.ts +0 -0
  346. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/sum_of.d.ts.map +0 -0
  347. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/take_last_while.d.ts +0 -0
  348. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/take_last_while.d.ts.map +0 -0
  349. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/take_while.d.ts +0 -0
  350. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/take_while.d.ts.map +0 -0
  351. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/union.d.ts +0 -0
  352. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/union.d.ts.map +0 -0
  353. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/unzip.d.ts +0 -0
  354. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/unzip.d.ts.map +0 -0
  355. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/without_all.d.ts +0 -0
  356. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/without_all.d.ts.map +0 -0
  357. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/zip.d.ts +0 -0
  358. /package/{types → esm}/deps/jsr.io/@std/collections/1.0.9/zip.d.ts.map +0 -0
  359. /package/{types → esm}/mod.d.ts +0 -0
  360. /package/{types → esm}/mod.d.ts.map +0 -0
  361. /package/{types → esm}/types/Ref.d.ts +0 -0
  362. /package/{types → esm}/types/constant.d.ts +0 -0
  363. /package/{types → esm}/types/constantUnion.d.ts +0 -0
  364. /package/{types → esm}/types/std/Option.d.ts +0 -0
  365. /package/{types → esm}/types/std/Option.d.ts.map +0 -0
  366. /package/{types → esm}/types/std/mod.d.ts +0 -0
  367. /package/{types → esm}/types/std/mod.d.ts.map +0 -0
  368. /package/{types → esm}/util/phantoms.d.ts +0 -0
  369. /package/{types → esm}/util/phantoms.d.ts.map +0 -0
  370. /package/{types → esm}/util/recombineTaggedTemplateArgs.d.ts +0 -0
  371. /package/{types → esm}/util/recombineTaggedTemplateArgs.d.ts.map +0 -0
@@ -1,204 +0,0 @@
1
- // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
- import type { DiffResult } from "./types.js";
3
- import { diff } from "./diff.js";
4
-
5
- /**
6
- * Unescape invisible characters.
7
- *
8
- * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#escape_sequences}
9
- *
10
- * @param string String to unescape.
11
- *
12
- * @returns Unescaped string.
13
- *
14
- * @example Usage
15
- * ```ts
16
- * import { unescape } from "@std/internal/diff-str";
17
- * import { assertEquals } from "@std/assert";
18
- *
19
- * assertEquals(unescape("Hello\nWorld"), "Hello\\n\nWorld");
20
- * ```
21
- */
22
- export function unescape(string: string): string {
23
- return string
24
- .replaceAll("\b", "\\b")
25
- .replaceAll("\f", "\\f")
26
- .replaceAll("\t", "\\t")
27
- .replaceAll("\v", "\\v")
28
- // This does not remove line breaks
29
- .replaceAll(
30
- /\r\n|\r|\n/g,
31
- (str) => str === "\r" ? "\\r" : str === "\n" ? "\\n\n" : "\\r\\n\r\n",
32
- );
33
- }
34
-
35
- const WHITESPACE_SYMBOLS = /([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/;
36
-
37
- /**
38
- * Tokenizes a string into an array of tokens.
39
- *
40
- * @param string The string to tokenize.
41
- * @param wordDiff If true, performs word-based tokenization. Default is false.
42
- *
43
- * @returns An array of tokens.
44
- *
45
- * @example Usage
46
- * ```ts
47
- * import { tokenize } from "@std/internal/diff-str";
48
- * import { assertEquals } from "@std/assert";
49
- *
50
- * assertEquals(tokenize("Hello\nWorld"), ["Hello\n", "World"]);
51
- * ```
52
- */
53
- export function tokenize(string: string, wordDiff = false): string[] {
54
- if (wordDiff) {
55
- return string
56
- .split(WHITESPACE_SYMBOLS)
57
- .filter((token) => token);
58
- }
59
- const tokens: string[] = [];
60
- const lines = string.split(/(\n|\r\n)/).filter((line) => line);
61
-
62
- for (const [i, line] of lines.entries()) {
63
- if (i % 2) {
64
- tokens[tokens.length - 1] += line;
65
- } else {
66
- tokens.push(line);
67
- }
68
- }
69
- return tokens;
70
- }
71
-
72
- /**
73
- * Create details by filtering relevant word-diff for current line and merge
74
- * "space-diff" if surrounded by word-diff for cleaner displays.
75
- *
76
- * @param line Current line
77
- * @param tokens Word-diff tokens
78
- *
79
- * @returns Array of diff results.
80
- *
81
- * @example Usage
82
- * ```ts
83
- * import { createDetails } from "@std/internal/diff-str";
84
- * import { assertEquals } from "@std/assert";
85
- *
86
- * const tokens = [
87
- * { type: "added", value: "a" },
88
- * { type: "removed", value: "b" },
89
- * { type: "common", value: "c" },
90
- * ] as const;
91
- * assertEquals(
92
- * createDetails({ type: "added", value: "a" }, [...tokens]),
93
- * [{ type: "added", value: "a" }, { type: "common", value: "c" }]
94
- * );
95
- * ```
96
- */
97
- export function createDetails(
98
- line: DiffResult<string>,
99
- tokens: DiffResult<string>[],
100
- ): DiffResult<string>[] {
101
- return tokens.filter(({ type }) => type === line.type || type === "common")
102
- .map((result, i, t) => {
103
- const token = t[i - 1];
104
- if (
105
- (result.type === "common") && token &&
106
- (token.type === t[i + 1]?.type) && /\s+/.test(result.value)
107
- ) {
108
- return {
109
- ...result,
110
- type: token.type,
111
- };
112
- }
113
- return result;
114
- });
115
- }
116
-
117
- const NON_WHITESPACE_REGEXP = /\S/;
118
-
119
- /**
120
- * Renders the differences between the actual and expected strings. Partially
121
- * inspired from {@link https://github.com/kpdecker/jsdiff}.
122
- *
123
- * @param A Actual string
124
- * @param B Expected string
125
- *
126
- * @returns Array of diff results.
127
- *
128
- * @example Usage
129
- * ```ts
130
- * import { diffStr } from "@std/internal/diff-str";
131
- * import { assertEquals } from "@std/assert";
132
- *
133
- * assertEquals(diffStr("Hello!", "Hello"), [
134
- * {
135
- * type: "removed",
136
- * value: "Hello!\n",
137
- * details: [
138
- * { type: "common", value: "Hello" },
139
- * { type: "removed", value: "!" },
140
- * { type: "common", value: "\n" }
141
- * ]
142
- * },
143
- * {
144
- * type: "added",
145
- * value: "Hello\n",
146
- * details: [
147
- * { type: "common", value: "Hello" },
148
- * { type: "common", value: "\n" }
149
- * ]
150
- * }
151
- * ]);
152
- * ```
153
- */
154
- export function diffStr(A: string, B: string): DiffResult<string>[] {
155
- // Compute multi-line diff
156
- const diffResult = diff(
157
- tokenize(`${unescape(A)}\n`),
158
- tokenize(`${unescape(B)}\n`),
159
- );
160
-
161
- const added = [];
162
- const removed = [];
163
- for (const result of diffResult) {
164
- if (result.type === "added") {
165
- added.push(result);
166
- }
167
- if (result.type === "removed") {
168
- removed.push(result);
169
- }
170
- }
171
-
172
- // Compute word-diff
173
- const hasMoreRemovedLines = added.length < removed.length;
174
- const aLines = hasMoreRemovedLines ? added : removed;
175
- const bLines = hasMoreRemovedLines ? removed : added;
176
- for (const a of aLines) {
177
- let tokens = [] as Array<DiffResult<string>>;
178
- let b: undefined | DiffResult<string>;
179
- // Search another diff line with at least one common token
180
- while (bLines.length) {
181
- b = bLines.shift();
182
- const tokenized = [
183
- tokenize(a.value, true),
184
- tokenize(b!.value, true),
185
- ] as [string[], string[]];
186
- if (hasMoreRemovedLines) tokenized.reverse();
187
- tokens = diff(tokenized[0], tokenized[1]);
188
- if (
189
- tokens.some(({ type, value }) =>
190
- type === "common" && NON_WHITESPACE_REGEXP.test(value)
191
- )
192
- ) {
193
- break;
194
- }
195
- }
196
- // Register word-diff details
197
- a.details = createDetails(a, tokens);
198
- if (b) {
199
- b.details = createDetails(b, tokens);
200
- }
201
- }
202
-
203
- return diffResult;
204
- }
@@ -1,39 +0,0 @@
1
- // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
- // This module is browser compatible.
3
-
4
- /**
5
- * Converts the input into a string. Objects, Sets and Maps are sorted so as to
6
- * make tests less flaky.
7
- *
8
- * @param v Value to be formatted
9
- *
10
- * @returns The formatted string
11
- *
12
- * @example Usage
13
- * ```ts
14
- * import { format } from "@std/internal/format";
15
- * import { assertEquals } from "@std/assert";
16
- *
17
- * assertEquals(format({ a: 1, b: 2 }), "{\n a: 1,\n b: 2,\n}");
18
- * assertEquals(format(new Set([1, 2])), "Set(2) {\n 1,\n 2,\n}");
19
- * assertEquals(format(new Map([[1, 2]])), "Map(1) {\n 1 => 2,\n}");
20
- * ```
21
- */
22
- import * as dntShim from "../../../../../_dnt.shims.js";
23
-
24
- export function format(v: unknown): string {
25
- // deno-lint-ignore no-explicit-any
26
- const { Deno } = dntShim.dntGlobalThis as any;
27
- return typeof Deno?.inspect === "function"
28
- ? Deno.inspect(v, {
29
- depth: Infinity,
30
- sorted: true,
31
- trailingComma: true,
32
- compact: false,
33
- iterableLimit: Infinity,
34
- // getters should be true in assertEquals.
35
- getters: true,
36
- strAbbreviateSize: Infinity,
37
- })
38
- : `"${String(v).replace(/(?=["\\])/g, "\\")}"`;
39
- }
@@ -1,233 +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
-
6
- // This code is vendored from `fmt/colors.ts`.
7
-
8
- // deno-lint-ignore no-explicit-any
9
- import * as dntShim from "../../../../../_dnt.shims.js";
10
-
11
- const { Deno } = dntShim.dntGlobalThis as any;
12
- const noColor = typeof Deno?.noColor === "boolean"
13
- ? Deno.noColor as boolean
14
- : false;
15
-
16
- interface Code {
17
- open: string;
18
- close: string;
19
- regexp: RegExp;
20
- }
21
-
22
- const enabled = !noColor;
23
-
24
- function code(open: number[], close: number): Code {
25
- return {
26
- open: `\x1b[${open.join(";")}m`,
27
- close: `\x1b[${close}m`,
28
- regexp: new RegExp(`\\x1b\\[${close}m`, "g"),
29
- };
30
- }
31
-
32
- function run(str: string, code: Code): string {
33
- return enabled
34
- ? `${code.open}${str.replace(code.regexp, code.open)}${code.close}`
35
- : str;
36
- }
37
-
38
- /**
39
- * Sets the style of text to be printed to bold.
40
- *
41
- * Disable by setting the `NO_COLOR` environmental variable.
42
- *
43
- * @param str Text to make bold
44
- *
45
- * @returns Bold text for printing
46
- *
47
- * @example Usage
48
- * ```ts no-assert
49
- * import { bold } from "@std/internal/styles";
50
- *
51
- * console.log(bold("Hello, world!")); // Prints "Hello, world!" in bold
52
- * ```
53
- */
54
- export function bold(str: string): string {
55
- return run(str, code([1], 22));
56
- }
57
-
58
- /**
59
- * Sets the color of text to be printed to red.
60
- *
61
- * Disable by setting the `NO_COLOR` environmental variable.
62
- *
63
- * @param str Text to make red
64
- *
65
- * @returns Red text for printing
66
- *
67
- * @example Usage
68
- * ```ts no-assert
69
- * import { red } from "@std/internal/styles";
70
- *
71
- * console.log(red("Hello, world!")); // Prints "Hello, world!" in red
72
- * ```
73
- */
74
- export function red(str: string): string {
75
- return run(str, code([31], 39));
76
- }
77
-
78
- /**
79
- * Sets the color of text to be printed to green.
80
- *
81
- * Disable by setting the `NO_COLOR` environmental variable.
82
- *
83
- * @param str Text to make green
84
- *
85
- * @returns Green text for print
86
- *
87
- * @example Usage
88
- * ```ts no-assert
89
- * import { green } from "@std/internal/styles";
90
- *
91
- * console.log(green("Hello, world!")); // Prints "Hello, world!" in green
92
- * ```
93
- */
94
- export function green(str: string): string {
95
- return run(str, code([32], 39));
96
- }
97
-
98
- /**
99
- * Sets the color of text to be printed to yellow.
100
- *
101
- * Disable by setting the `NO_COLOR` environmental variable.
102
- *
103
- * @param str Text to make yellow
104
- *
105
- * @returns Yellow text for print
106
- *
107
- * @example Usage
108
- * ```ts no-assert
109
- * import { yellow } from "@std/internal/styles";
110
- *
111
- * console.log(yellow("Hello, world!")); // Prints "Hello, world!" in yellow
112
- * ```
113
- */
114
- export function yellow(str: string): string {
115
- return run(str, code([33], 39));
116
- }
117
-
118
- /**
119
- * Sets the color of text to be printed to white.
120
- *
121
- * @param str Text to make white
122
- *
123
- * @returns White text for print
124
- *
125
- * @example Usage
126
- * ```ts no-assert
127
- * import { white } from "@std/internal/styles";
128
- *
129
- * console.log(white("Hello, world!")); // Prints "Hello, world!" in white
130
- * ```
131
- */
132
- export function white(str: string): string {
133
- return run(str, code([37], 39));
134
- }
135
-
136
- /**
137
- * Sets the color of text to be printed to gray.
138
- *
139
- * @param str Text to make gray
140
- *
141
- * @returns Gray text for print
142
- *
143
- * @example Usage
144
- * ```ts no-assert
145
- * import { gray } from "@std/internal/styles";
146
- *
147
- * console.log(gray("Hello, world!")); // Prints "Hello, world!" in gray
148
- * ```
149
- */
150
- export function gray(str: string): string {
151
- return brightBlack(str);
152
- }
153
-
154
- /**
155
- * Sets the color of text to be printed to bright-black.
156
- *
157
- * @param str Text to make bright-black
158
- *
159
- * @returns Bright-black text for print
160
- *
161
- * @example Usage
162
- * ```ts no-assert
163
- * import { brightBlack } from "@std/internal/styles";
164
- *
165
- * console.log(brightBlack("Hello, world!")); // Prints "Hello, world!" in bright-black
166
- * ```
167
- */
168
- export function brightBlack(str: string): string {
169
- return run(str, code([90], 39));
170
- }
171
-
172
- /**
173
- * Sets the background color of text to be printed to red.
174
- *
175
- * @param str Text to make its background red
176
- *
177
- * @returns Red background text for print
178
- *
179
- * @example Usage
180
- * ```ts no-assert
181
- * import { bgRed } from "@std/internal/styles";
182
- *
183
- * console.log(bgRed("Hello, world!")); // Prints "Hello, world!" with red background
184
- * ```
185
- */
186
- export function bgRed(str: string): string {
187
- return run(str, code([41], 49));
188
- }
189
-
190
- /**
191
- * Sets the background color of text to be printed to green.
192
- *
193
- * @param str Text to make its background green
194
- *
195
- * @returns Green background text for print
196
- *
197
- * @example Usage
198
- * ```ts no-assert
199
- * import { bgGreen } from "@std/internal/styles";
200
- *
201
- * console.log(bgGreen("Hello, world!")); // Prints "Hello, world!" with green background
202
- * ```
203
- */
204
- export function bgGreen(str: string): string {
205
- return run(str, code([42], 49));
206
- }
207
-
208
- // https://github.com/chalk/ansi-regex/blob/02fa893d619d3da85411acc8fd4e2eea0e95a9d9/index.js
209
- const ANSI_PATTERN = new RegExp(
210
- [
211
- "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
212
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TXZcf-nq-uy=><~]))",
213
- ].join("|"),
214
- "g",
215
- );
216
-
217
- /**
218
- * Remove ANSI escape codes from the string.
219
- *
220
- * @param string Text to remove ANSI escape codes from
221
- *
222
- * @returns Text without ANSI escape codes
223
- *
224
- * @example Usage
225
- * ```ts no-assert
226
- * import { red, stripAnsiCode } from "@std/internal/styles";
227
- *
228
- * console.log(stripAnsiCode(red("Hello, world!"))); // Prints "Hello, world!"
229
- * ```
230
- */
231
- export function stripAnsiCode(string: string): string {
232
- return string.replace(ANSI_PATTERN, "");
233
- }
@@ -1,18 +0,0 @@
1
- // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
-
3
- /** Ways that lines in a diff can be different. */
4
- export type DiffType = "removed" | "common" | "added";
5
-
6
- /**
7
- * Represents the result of a diff operation.
8
- *
9
- * @typeParam T The type of the value in the diff result.
10
- */
11
- export interface DiffResult<T> {
12
- /** The type of the diff. */
13
- type: DiffType;
14
- /** The value of the diff. */
15
- value: T;
16
- /** The details of the diff. */
17
- details?: DiffResult<T>[];
18
- }
@@ -1,21 +0,0 @@
1
- import { Ty } from "./Ty.js"
2
-
3
- export const none: Ty<null, never> = Ty((description) => ({
4
- type: "null",
5
- description,
6
- }))
7
-
8
- export const boolean: Ty<boolean, never> = Ty((description) => ({
9
- type: "boolean",
10
- description,
11
- }))
12
-
13
- export const number: Ty<number, never> = Ty((description) => ({
14
- type: "number",
15
- description,
16
- }))
17
-
18
- export const string: Ty<string, never> = Ty((description) => ({
19
- type: "string",
20
- description,
21
- }))
@@ -1,26 +0,0 @@
1
- import type Openai from "openai";
2
- import type { ResponseFormatJSONSchema } from "openai/resources/index.js";
3
- import type { RootTy } from "./types/mod.js";
4
- export declare function ResponseFormat<T>(name: string, ty: RootTy<T, never>): ResponseFormat<T>;
5
- export interface ResponseFormat<T> {
6
- (template: TemplateStringsArray, ...quasis: Array<string>): ResponseFormat<T>;
7
- type: "json_schema";
8
- /** The desired return type in JSON Schema. */
9
- json_schema: ResponseFormatJSONSchema.JSONSchema;
10
- /** Parse inner responses into a typed object. */
11
- parse(completion: ChatCompletion): TypedChatCompletion<T>;
12
- /** Parse and return the first inner response into a typed object. */
13
- parseFirstOrThrow(completion: ChatCompletion): T;
14
- }
15
- export type TypedChatCompletion<T> = Omit<ChatCompletion, "choices"> & {
16
- choices: Array<Omit<ChatCompletionChoice, "message"> & {
17
- message: Omit<ChatCompletionMessage, "content"> & {
18
- content: T;
19
- };
20
- }>;
21
- };
22
- type ChatCompletion = Openai.Chat.ChatCompletion;
23
- type ChatCompletionChoice = Openai.Chat.ChatCompletion.Choice;
24
- type ChatCompletionMessage = Openai.Chat.Completions.ChatCompletionMessage;
25
- export {};
26
- //# sourceMappingURL=ResponseFormat.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ResponseFormat.d.ts","sourceRoot":"","sources":["../src/ResponseFormat.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAChC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAG5C,wBAAgB,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAEvF;AAkDD,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B,CAAC,QAAQ,EAAE,oBAAoB,EAAE,GAAG,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAA;IAC7E,IAAI,EAAE,aAAa,CAAA;IACnB,8CAA8C;IAC9C,WAAW,EAAE,wBAAwB,CAAC,UAAU,CAAA;IAChD,iDAAiD;IACjD,KAAK,CAAC,UAAU,EAAE,cAAc,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAA;IACzD,qEAAqE;IACrE,iBAAiB,CAAC,UAAU,EAAE,cAAc,GAAG,CAAC,CAAA;CACjD;AAED,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,GAAG;IACrE,OAAO,EAAE,KAAK,CACZ,IAAI,CAAC,oBAAoB,EAAE,SAAS,CAAC,GAAG;QACtC,OAAO,EAAE,IAAI,CAAC,qBAAqB,EAAE,SAAS,CAAC,GAAG;YAChD,OAAO,EAAE,CAAC,CAAA;SACX,CAAA;KACF,CACF,CAAA;CACF,CAAA;AAED,KAAK,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,cAAc,CAAA;AAChD,KAAK,oBAAoB,GAAG,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAA;AAC7D,KAAK,qBAAqB,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tool.d.ts","sourceRoot":"","sources":["../src/Tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAGpD,wBAAgB,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAEnE;AAuBD,MAAM,WAAW,IAAI,CAAC,CAAC,GAAG,GAAG;IAC3B,CAAC,QAAQ,EAAE,oBAAoB,EAAE,GAAG,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;IACnE,IAAI,EAAE,UAAU,CAAA;IAChB,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAA;IACZ,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB"}
@@ -1,2 +0,0 @@
1
- export declare const dntGlobalThis: Omit<typeof globalThis, never>;
2
- //# sourceMappingURL=_dnt.shims.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_dnt.shims.d.ts","sourceRoot":"","sources":["../src/_dnt.shims.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,gCAA2C,CAAC"}
@@ -1,29 +0,0 @@
1
- /**
2
- * Make an assertion that `actual` and `expected` are almost equal numbers
3
- * through a given tolerance. It can be used to take into account IEEE-754
4
- * double-precision floating-point representation limitations. If the values
5
- * are not almost equal then throw.
6
- *
7
- * The default tolerance is one hundred thousandth of a percent of the
8
- * expected value.
9
- *
10
- * @example Usage
11
- * ```ts ignore
12
- * import { assertAlmostEquals } from "@std/assert";
13
- *
14
- * assertAlmostEquals(0.01, 0.02); // Throws
15
- * assertAlmostEquals(1e-8, 1e-9); // Throws
16
- * assertAlmostEquals(1.000000001e-8, 1.000000002e-8); // Doesn't throw
17
- * assertAlmostEquals(0.01, 0.02, 0.1); // Doesn't throw
18
- * assertAlmostEquals(0.1 + 0.2, 0.3, 1e-16); // Doesn't throw
19
- * assertAlmostEquals(0.1 + 0.2, 0.3, 1e-17); // Throws
20
- * ```
21
- *
22
- * @param actual The actual value to compare.
23
- * @param expected The expected value to compare.
24
- * @param tolerance The tolerance to consider the values almost equal. The
25
- * default is one hundred thousandth of a percent of the expected value.
26
- * @param msg The optional message to include in the error.
27
- */
28
- export declare function assertAlmostEquals(actual: number, expected: number, tolerance?: number, msg?: string): void;
29
- //# sourceMappingURL=almost_equals.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"almost_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.8/almost_equals.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,MAAM,EAClB,GAAG,CAAC,EAAE,MAAM,QAmBb"}
@@ -1,24 +0,0 @@
1
- /** An array-like object (`Array`, `Uint8Array`, `NodeList`, etc.) that is not a string */
2
- export type ArrayLikeArg<T> = ArrayLike<T> & object;
3
- /**
4
- * Make an assertion that `actual` includes the `expected` values. If not then
5
- * an error will be thrown.
6
- *
7
- * Type parameter can be specified to ensure values under comparison have the
8
- * same type.
9
- *
10
- * @example Usage
11
- * ```ts ignore
12
- * import { assertArrayIncludes } from "@std/assert";
13
- *
14
- * assertArrayIncludes([1, 2], [2]); // Doesn't throw
15
- * assertArrayIncludes([1, 2], [3]); // Throws
16
- * ```
17
- *
18
- * @typeParam T The type of the elements in the array to compare.
19
- * @param actual The array-like object to check for.
20
- * @param expected The array-like object to check for.
21
- * @param msg The optional message to display if the assertion fails.
22
- */
23
- export declare function assertArrayIncludes<T>(actual: ArrayLikeArg<T>, expected: ArrayLikeArg<T>, msg?: string): void;
24
- //# sourceMappingURL=array_includes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"array_includes.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.8/array_includes.ts"],"names":[],"mappings":"AAMA,0FAA0F;AAC1F,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,EACvB,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,EACzB,GAAG,CAAC,EAAE,MAAM,QAwBb"}
@@ -1,16 +0,0 @@
1
- /**
2
- * Make an assertion, error will be thrown if `expr` does not have truthy value.
3
- *
4
- * @example Usage
5
- * ```ts ignore
6
- * import { assert } from "@std/assert";
7
- *
8
- * assert("hello".includes("ello")); // Doesn't throw
9
- * assert("hello".includes("world")); // Throws
10
- * ```
11
- *
12
- * @param expr The expression to test.
13
- * @param msg The optional message to display if the assertion fails.
14
- */
15
- export declare function assert(expr: unknown, msg?: string): asserts expr;
16
- //# sourceMappingURL=assert.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.8/assert.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,SAAK,GAAG,OAAO,CAAC,IAAI,CAI5D"}
@@ -1,26 +0,0 @@
1
- /**
2
- * Error thrown when an assertion fails.
3
- *
4
- * @example Usage
5
- * ```ts ignore
6
- * import { AssertionError } from "@std/assert";
7
- *
8
- * try {
9
- * throw new AssertionError("foo", { cause: "bar" });
10
- * } catch (error) {
11
- * if (error instanceof AssertionError) {
12
- * error.message === "foo"; // true
13
- * error.cause === "bar"; // true
14
- * }
15
- * }
16
- * ```
17
- */
18
- export declare class AssertionError extends Error {
19
- /** Constructs a new instance.
20
- *
21
- * @param message The error message.
22
- * @param options Additional options. This argument is still unstable. It may change in the future release.
23
- */
24
- constructor(message: string, options?: ErrorOptions);
25
- }
26
- //# sourceMappingURL=assertion_error.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assertion_error.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.8/assertion_error.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC;;;;OAIG;gBACS,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAIpD"}