liminal 0.1.0-beta.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (519) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +26 -0
  3. package/esm/_dnt.shims.d.ts +2 -0
  4. package/esm/_dnt.shims.d.ts.map +1 -0
  5. package/esm/_dnt.shims.js +58 -0
  6. package/esm/_dnt.shims.js.map +1 -0
  7. package/esm/client/Adapter.d.ts +46 -0
  8. package/esm/client/Adapter.d.ts.map +1 -0
  9. package/esm/client/Adapter.js +2 -0
  10. package/esm/client/Adapter.js.map +1 -0
  11. package/esm/client/Liminal.d.ts +19 -0
  12. package/esm/client/Liminal.d.ts.map +1 -0
  13. package/esm/client/Liminal.js +154 -0
  14. package/esm/client/Liminal.js.map +1 -0
  15. package/esm/client/Tool.d.ts +15 -0
  16. package/esm/client/Tool.d.ts.map +1 -0
  17. package/esm/client/Tool.js +23 -0
  18. package/esm/client/Tool.js.map +1 -0
  19. package/esm/client/constants.d.ts +2 -0
  20. package/esm/client/constants.d.ts.map +1 -0
  21. package/esm/client/constants.js +7 -0
  22. package/esm/client/constants.js.map +1 -0
  23. package/esm/client/mod.d.ts +5 -0
  24. package/esm/client/mod.d.ts.map +1 -0
  25. package/esm/client/mod.js +6 -0
  26. package/esm/client/mod.js.map +1 -0
  27. package/esm/core/DescriptionContext.d.ts +11 -0
  28. package/esm/core/DescriptionContext.d.ts.map +1 -0
  29. package/esm/core/DescriptionContext.js +103 -0
  30. package/esm/core/DescriptionContext.js.map +1 -0
  31. package/esm/core/L.d.ts +4 -0
  32. package/esm/core/L.d.ts.map +1 -0
  33. package/esm/core/L.js +4 -0
  34. package/esm/core/L.js.map +1 -0
  35. package/esm/core/ReduceDependencies.d.ts +6 -0
  36. package/esm/core/ReduceDependencies.d.ts.map +1 -0
  37. package/esm/core/ReduceDependencies.js +2 -0
  38. package/esm/core/ReduceDependencies.js.map +1 -0
  39. package/esm/core/Type.d.ts +30 -0
  40. package/esm/core/Type.d.ts.map +1 -0
  41. package/esm/core/Type.js +2 -0
  42. package/esm/core/Type.js.map +1 -0
  43. package/esm/core/TypeVisitor.d.ts +15 -0
  44. package/esm/core/TypeVisitor.d.ts.map +1 -0
  45. package/esm/core/TypeVisitor.js +12 -0
  46. package/esm/core/TypeVisitor.js.map +1 -0
  47. package/esm/core/annotations/Annotation.d.ts +7 -0
  48. package/esm/core/annotations/Annotation.d.ts.map +1 -0
  49. package/esm/core/annotations/Annotation.js +2 -0
  50. package/esm/core/annotations/Annotation.js.map +1 -0
  51. package/esm/core/annotations/Assertion.d.ts +8 -0
  52. package/esm/core/annotations/Assertion.d.ts.map +1 -0
  53. package/esm/core/annotations/Assertion.js +8 -0
  54. package/esm/core/annotations/Assertion.js.map +1 -0
  55. package/esm/core/annotations/Description.d.ts +7 -0
  56. package/esm/core/annotations/Description.d.ts.map +1 -0
  57. package/esm/core/annotations/Description.js +8 -0
  58. package/esm/core/annotations/Description.js.map +1 -0
  59. package/esm/core/annotations/Param.d.ts +13 -0
  60. package/esm/core/annotations/Param.d.ts.map +1 -0
  61. package/esm/core/annotations/Param.js +11 -0
  62. package/esm/core/annotations/Param.js.map +1 -0
  63. package/esm/core/annotations/Template.d.ts +10 -0
  64. package/esm/core/annotations/Template.d.ts.map +1 -0
  65. package/esm/core/annotations/Template.js +2 -0
  66. package/esm/core/annotations/Template.js.map +1 -0
  67. package/esm/core/annotations/mod.d.ts +6 -0
  68. package/esm/core/annotations/mod.d.ts.map +1 -0
  69. package/esm/core/annotations/mod.js +7 -0
  70. package/esm/core/annotations/mod.js.map +1 -0
  71. package/esm/core/assert.d.ts +22 -0
  72. package/esm/core/assert.d.ts.map +1 -0
  73. package/esm/core/assert.js +155 -0
  74. package/esm/core/assert.js.map +1 -0
  75. package/esm/core/declareIntrinsic.d.ts +4 -0
  76. package/esm/core/declareIntrinsic.d.ts.map +1 -0
  77. package/esm/core/declareIntrinsic.js +26 -0
  78. package/esm/core/declareIntrinsic.js.map +1 -0
  79. package/esm/core/deserialize.d.ts +3 -0
  80. package/esm/core/deserialize.d.ts.map +1 -0
  81. package/esm/core/deserialize.js +32 -0
  82. package/esm/core/deserialize.js.map +1 -0
  83. package/esm/core/display.d.ts +3 -0
  84. package/esm/core/display.d.ts.map +1 -0
  85. package/esm/core/display.js +75 -0
  86. package/esm/core/display.js.map +1 -0
  87. package/esm/core/inspect.node.d.ts +5 -0
  88. package/esm/core/inspect.node.d.ts.map +1 -0
  89. package/esm/core/inspect.node.js +7 -0
  90. package/esm/core/inspect.node.js.map +1 -0
  91. package/esm/core/intrinsics.d.ts +19 -0
  92. package/esm/core/intrinsics.d.ts.map +1 -0
  93. package/esm/core/intrinsics.js +64 -0
  94. package/esm/core/intrinsics.js.map +1 -0
  95. package/esm/core/intrinsics_util.d.ts +6 -0
  96. package/esm/core/intrinsics_util.d.ts.map +1 -0
  97. package/esm/core/intrinsics_util.js +46 -0
  98. package/esm/core/intrinsics_util.js.map +1 -0
  99. package/esm/core/isType.d.ts +4 -0
  100. package/esm/core/isType.d.ts.map +1 -0
  101. package/esm/core/isType.js +18 -0
  102. package/esm/core/isType.js.map +1 -0
  103. package/esm/core/mod.d.ts +13 -0
  104. package/esm/core/mod.d.ts.map +1 -0
  105. package/esm/core/mod.js +14 -0
  106. package/esm/core/mod.js.map +1 -0
  107. package/esm/core/signature.d.ts +4 -0
  108. package/esm/core/signature.d.ts.map +1 -0
  109. package/esm/core/signature.js +93 -0
  110. package/esm/core/signature.js.map +1 -0
  111. package/esm/core/utility/Flatten.d.ts +8 -0
  112. package/esm/core/utility/Flatten.d.ts.map +1 -0
  113. package/esm/core/utility/Flatten.js +6 -0
  114. package/esm/core/utility/Flatten.js.map +1 -0
  115. package/esm/core/utility/Intersection.d.ts +12 -0
  116. package/esm/core/utility/Intersection.d.ts.map +1 -0
  117. package/esm/core/utility/Intersection.js +5 -0
  118. package/esm/core/utility/Intersection.js.map +1 -0
  119. package/esm/core/utility/Option.d.ts +3 -0
  120. package/esm/core/utility/Option.d.ts.map +1 -0
  121. package/esm/core/utility/Option.js +5 -0
  122. package/esm/core/utility/Option.js.map +1 -0
  123. package/esm/core/utility/Record.d.ts +3 -0
  124. package/esm/core/utility/Record.d.ts.map +1 -0
  125. package/esm/core/utility/Record.js +6 -0
  126. package/esm/core/utility/Record.js.map +1 -0
  127. package/esm/core/utility/Set.d.ts +4 -0
  128. package/esm/core/utility/Set.d.ts.map +1 -0
  129. package/esm/core/utility/Set.js +7 -0
  130. package/esm/core/utility/Set.js.map +1 -0
  131. package/esm/core/utility/TaggedUnion.d.ts +13 -0
  132. package/esm/core/utility/TaggedUnion.d.ts.map +1 -0
  133. package/esm/core/utility/TaggedUnion.js +8 -0
  134. package/esm/core/utility/TaggedUnion.js.map +1 -0
  135. package/esm/core/utility/Tuple.d.ts +9 -0
  136. package/esm/core/utility/Tuple.d.ts.map +1 -0
  137. package/esm/core/utility/Tuple.js +11 -0
  138. package/esm/core/utility/Tuple.js.map +1 -0
  139. package/esm/core/utility/mod.d.ts +8 -0
  140. package/esm/core/utility/mod.d.ts.map +1 -0
  141. package/esm/core/utility/mod.js +9 -0
  142. package/esm/core/utility/mod.js.map +1 -0
  143. package/esm/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts +29 -0
  144. package/esm/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts.map +1 -0
  145. package/esm/deps/jsr.io/@std/assert/1.0.10/almost_equals.js +47 -0
  146. package/esm/deps/jsr.io/@std/assert/1.0.10/almost_equals.js.map +1 -0
  147. package/esm/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts +24 -0
  148. package/esm/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts.map +1 -0
  149. package/esm/deps/jsr.io/@std/assert/1.0.10/array_includes.js +47 -0
  150. package/esm/deps/jsr.io/@std/assert/1.0.10/array_includes.js.map +1 -0
  151. package/esm/deps/jsr.io/@std/assert/1.0.10/assert.d.ts +16 -0
  152. package/esm/deps/jsr.io/@std/assert/1.0.10/assert.d.ts.map +1 -0
  153. package/esm/deps/jsr.io/@std/assert/1.0.10/assert.js +23 -0
  154. package/esm/deps/jsr.io/@std/assert/1.0.10/assert.js.map +1 -0
  155. package/esm/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts +26 -0
  156. package/esm/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts.map +1 -0
  157. package/esm/deps/jsr.io/@std/assert/1.0.10/assertion_error.js +31 -0
  158. package/esm/deps/jsr.io/@std/assert/1.0.10/assertion_error.js.map +1 -0
  159. package/esm/deps/jsr.io/@std/assert/1.0.10/equal.d.ts +17 -0
  160. package/esm/deps/jsr.io/@std/assert/1.0.10/equal.d.ts.map +1 -0
  161. package/esm/deps/jsr.io/@std/assert/1.0.10/equal.js +184 -0
  162. package/esm/deps/jsr.io/@std/assert/1.0.10/equal.js.map +1 -0
  163. package/esm/deps/jsr.io/@std/assert/1.0.10/equals.d.ts +35 -0
  164. package/esm/deps/jsr.io/@std/assert/1.0.10/equals.d.ts.map +1 -0
  165. package/esm/deps/jsr.io/@std/assert/1.0.10/equals.js +59 -0
  166. package/esm/deps/jsr.io/@std/assert/1.0.10/equals.js.map +1 -0
  167. package/esm/deps/jsr.io/@std/assert/1.0.10/exists.d.ts +18 -0
  168. package/esm/deps/jsr.io/@std/assert/1.0.10/exists.d.ts.map +1 -0
  169. package/esm/deps/jsr.io/@std/assert/1.0.10/exists.js +28 -0
  170. package/esm/deps/jsr.io/@std/assert/1.0.10/exists.js.map +1 -0
  171. package/esm/deps/jsr.io/@std/assert/1.0.10/fail.d.ts +15 -0
  172. package/esm/deps/jsr.io/@std/assert/1.0.10/fail.d.ts.map +1 -0
  173. package/esm/deps/jsr.io/@std/assert/1.0.10/fail.js +21 -0
  174. package/esm/deps/jsr.io/@std/assert/1.0.10/fail.js.map +1 -0
  175. package/esm/deps/jsr.io/@std/assert/1.0.10/false.d.ts +18 -0
  176. package/esm/deps/jsr.io/@std/assert/1.0.10/false.d.ts.map +1 -0
  177. package/esm/deps/jsr.io/@std/assert/1.0.10/false.js +23 -0
  178. package/esm/deps/jsr.io/@std/assert/1.0.10/false.js.map +1 -0
  179. package/esm/deps/jsr.io/@std/assert/1.0.10/greater.d.ts +20 -0
  180. package/esm/deps/jsr.io/@std/assert/1.0.10/greater.d.ts.map +1 -0
  181. package/esm/deps/jsr.io/@std/assert/1.0.10/greater.js +30 -0
  182. package/esm/deps/jsr.io/@std/assert/1.0.10/greater.js.map +1 -0
  183. package/esm/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts +20 -0
  184. package/esm/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts.map +1 -0
  185. package/esm/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.js +30 -0
  186. package/esm/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.js.map +1 -0
  187. package/esm/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts +23 -0
  188. package/esm/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts.map +1 -0
  189. package/esm/deps/jsr.io/@std/assert/1.0.10/instance_of.js +53 -0
  190. package/esm/deps/jsr.io/@std/assert/1.0.10/instance_of.js.map +1 -0
  191. package/esm/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts +25 -0
  192. package/esm/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts.map +1 -0
  193. package/esm/deps/jsr.io/@std/assert/1.0.10/is_error.js +54 -0
  194. package/esm/deps/jsr.io/@std/assert/1.0.10/is_error.js.map +1 -0
  195. package/esm/deps/jsr.io/@std/assert/1.0.10/less.d.ts +19 -0
  196. package/esm/deps/jsr.io/@std/assert/1.0.10/less.d.ts.map +1 -0
  197. package/esm/deps/jsr.io/@std/assert/1.0.10/less.js +29 -0
  198. package/esm/deps/jsr.io/@std/assert/1.0.10/less.js.map +1 -0
  199. package/esm/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts +20 -0
  200. package/esm/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts.map +1 -0
  201. package/esm/deps/jsr.io/@std/assert/1.0.10/less_or_equal.js +30 -0
  202. package/esm/deps/jsr.io/@std/assert/1.0.10/less_or_equal.js.map +1 -0
  203. package/esm/deps/jsr.io/@std/assert/1.0.10/match.d.ts +18 -0
  204. package/esm/deps/jsr.io/@std/assert/1.0.10/match.d.ts.map +1 -0
  205. package/esm/deps/jsr.io/@std/assert/1.0.10/match.js +27 -0
  206. package/esm/deps/jsr.io/@std/assert/1.0.10/match.js.map +1 -0
  207. package/esm/deps/jsr.io/@std/assert/1.0.10/mod.d.ts +44 -0
  208. package/esm/deps/jsr.io/@std/assert/1.0.10/mod.d.ts.map +1 -0
  209. package/esm/deps/jsr.io/@std/assert/1.0.10/mod.js +46 -0
  210. package/esm/deps/jsr.io/@std/assert/1.0.10/mod.js.map +1 -0
  211. package/esm/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts +21 -0
  212. package/esm/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts.map +1 -0
  213. package/esm/deps/jsr.io/@std/assert/1.0.10/not_equals.js +34 -0
  214. package/esm/deps/jsr.io/@std/assert/1.0.10/not_equals.js.map +1 -0
  215. package/esm/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts +20 -0
  216. package/esm/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts.map +1 -0
  217. package/esm/deps/jsr.io/@std/assert/1.0.10/not_instance_of.js +30 -0
  218. package/esm/deps/jsr.io/@std/assert/1.0.10/not_instance_of.js.map +1 -0
  219. package/esm/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts +18 -0
  220. package/esm/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts.map +1 -0
  221. package/esm/deps/jsr.io/@std/assert/1.0.10/not_match.js +27 -0
  222. package/esm/deps/jsr.io/@std/assert/1.0.10/not_match.js.map +1 -0
  223. package/esm/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts +23 -0
  224. package/esm/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts.map +1 -0
  225. package/esm/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.js +33 -0
  226. package/esm/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.js.map +1 -0
  227. package/esm/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts +29 -0
  228. package/esm/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts.map +1 -0
  229. package/esm/deps/jsr.io/@std/assert/1.0.10/object_match.js +161 -0
  230. package/esm/deps/jsr.io/@std/assert/1.0.10/object_match.js.map +1 -0
  231. package/esm/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts +42 -0
  232. package/esm/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts.map +1 -0
  233. package/esm/deps/jsr.io/@std/assert/1.0.10/rejects.js +54 -0
  234. package/esm/deps/jsr.io/@std/assert/1.0.10/rejects.js.map +1 -0
  235. package/esm/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts +24 -0
  236. package/esm/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts.map +1 -0
  237. package/esm/deps/jsr.io/@std/assert/1.0.10/strict_equals.js +58 -0
  238. package/esm/deps/jsr.io/@std/assert/1.0.10/strict_equals.js.map +1 -0
  239. package/esm/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts +18 -0
  240. package/esm/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts.map +1 -0
  241. package/esm/deps/jsr.io/@std/assert/1.0.10/string_includes.js +27 -0
  242. package/esm/deps/jsr.io/@std/assert/1.0.10/string_includes.js.map +1 -0
  243. package/esm/deps/jsr.io/@std/assert/1.0.10/throws.d.ts +45 -0
  244. package/esm/deps/jsr.io/@std/assert/1.0.10/throws.d.ts.map +1 -0
  245. package/esm/deps/jsr.io/@std/assert/1.0.10/throws.js +45 -0
  246. package/esm/deps/jsr.io/@std/assert/1.0.10/throws.js.map +1 -0
  247. package/esm/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts +15 -0
  248. package/esm/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts.map +1 -0
  249. package/esm/deps/jsr.io/@std/assert/1.0.10/unimplemented.js +21 -0
  250. package/esm/deps/jsr.io/@std/assert/1.0.10/unimplemented.js.map +1 -0
  251. package/esm/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts +15 -0
  252. package/esm/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts.map +1 -0
  253. package/esm/deps/jsr.io/@std/assert/1.0.10/unreachable.js +21 -0
  254. package/esm/deps/jsr.io/@std/assert/1.0.10/unreachable.js.map +1 -0
  255. package/esm/deps/jsr.io/@std/encoding/1.0.6/_base32_common.d.ts +17 -0
  256. package/esm/deps/jsr.io/@std/encoding/1.0.6/_base32_common.d.ts.map +1 -0
  257. package/esm/deps/jsr.io/@std/encoding/1.0.6/_base32_common.js +184 -0
  258. package/esm/deps/jsr.io/@std/encoding/1.0.6/_base32_common.js.map +1 -0
  259. package/esm/deps/jsr.io/@std/encoding/1.0.6/_validate_binary_like.d.ts +2 -0
  260. package/esm/deps/jsr.io/@std/encoding/1.0.6/_validate_binary_like.d.ts.map +1 -0
  261. package/esm/deps/jsr.io/@std/encoding/1.0.6/_validate_binary_like.js +27 -0
  262. package/esm/deps/jsr.io/@std/encoding/1.0.6/_validate_binary_like.js.map +1 -0
  263. package/esm/deps/jsr.io/@std/encoding/1.0.6/ascii85.d.ts +59 -0
  264. package/esm/deps/jsr.io/@std/encoding/1.0.6/ascii85.d.ts.map +1 -0
  265. package/esm/deps/jsr.io/@std/encoding/1.0.6/ascii85.js +153 -0
  266. package/esm/deps/jsr.io/@std/encoding/1.0.6/ascii85.js.map +1 -0
  267. package/esm/deps/jsr.io/@std/encoding/1.0.6/base32.d.ts +38 -0
  268. package/esm/deps/jsr.io/@std/encoding/1.0.6/base32.d.ts.map +1 -0
  269. package/esm/deps/jsr.io/@std/encoding/1.0.6/base32.js +70 -0
  270. package/esm/deps/jsr.io/@std/encoding/1.0.6/base32.js.map +1 -0
  271. package/esm/deps/jsr.io/@std/encoding/1.0.6/base58.d.ts +38 -0
  272. package/esm/deps/jsr.io/@std/encoding/1.0.6/base58.d.ts.map +1 -0
  273. package/esm/deps/jsr.io/@std/encoding/1.0.6/base58.js +132 -0
  274. package/esm/deps/jsr.io/@std/encoding/1.0.6/base58.js.map +1 -0
  275. package/esm/deps/jsr.io/@std/encoding/1.0.6/base64.d.ts +38 -0
  276. package/esm/deps/jsr.io/@std/encoding/1.0.6/base64.d.ts.map +1 -0
  277. package/esm/deps/jsr.io/@std/encoding/1.0.6/base64.js +164 -0
  278. package/esm/deps/jsr.io/@std/encoding/1.0.6/base64.js.map +1 -0
  279. package/esm/deps/jsr.io/@std/encoding/1.0.6/base64url.d.ts +38 -0
  280. package/esm/deps/jsr.io/@std/encoding/1.0.6/base64url.d.ts.map +1 -0
  281. package/esm/deps/jsr.io/@std/encoding/1.0.6/base64url.js +82 -0
  282. package/esm/deps/jsr.io/@std/encoding/1.0.6/base64url.js.map +1 -0
  283. package/esm/deps/jsr.io/@std/encoding/1.0.6/hex.d.ts +37 -0
  284. package/esm/deps/jsr.io/@std/encoding/1.0.6/hex.d.ts.map +1 -0
  285. package/esm/deps/jsr.io/@std/encoding/1.0.6/hex.js +110 -0
  286. package/esm/deps/jsr.io/@std/encoding/1.0.6/hex.js.map +1 -0
  287. package/esm/deps/jsr.io/@std/encoding/1.0.6/mod.d.ts +22 -0
  288. package/esm/deps/jsr.io/@std/encoding/1.0.6/mod.d.ts.map +1 -0
  289. package/esm/deps/jsr.io/@std/encoding/1.0.6/mod.js +23 -0
  290. package/esm/deps/jsr.io/@std/encoding/1.0.6/mod.js.map +1 -0
  291. package/esm/deps/jsr.io/@std/encoding/1.0.6/varint.d.ts +118 -0
  292. package/esm/deps/jsr.io/@std/encoding/1.0.6/varint.d.ts.map +1 -0
  293. package/esm/deps/jsr.io/@std/encoding/1.0.6/varint.js +208 -0
  294. package/esm/deps/jsr.io/@std/encoding/1.0.6/varint.js.map +1 -0
  295. package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts +82 -0
  296. package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +1 -0
  297. package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.js +111 -0
  298. package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.js.map +1 -0
  299. package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts +140 -0
  300. package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +1 -0
  301. package/esm/deps/jsr.io/@std/internal/1.0.5/diff.js +277 -0
  302. package/esm/deps/jsr.io/@std/internal/1.0.5/diff.js.map +1 -0
  303. package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts +99 -0
  304. package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +1 -0
  305. package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.js +180 -0
  306. package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.js.map +1 -0
  307. package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts +2 -0
  308. package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +1 -0
  309. package/esm/deps/jsr.io/@std/internal/1.0.5/format.js +38 -0
  310. package/esm/deps/jsr.io/@std/internal/1.0.5/format.js.map +1 -0
  311. package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts +159 -0
  312. package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +1 -0
  313. package/esm/deps/jsr.io/@std/internal/1.0.5/styles.js +208 -0
  314. package/esm/deps/jsr.io/@std/internal/1.0.5/styles.js.map +1 -0
  315. package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts +16 -0
  316. package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +1 -0
  317. package/esm/deps/jsr.io/@std/internal/1.0.5/types.js +3 -0
  318. package/esm/deps/jsr.io/@std/internal/1.0.5/types.js.map +1 -0
  319. package/esm/json_schema/Hydrated.d.ts +4 -0
  320. package/esm/json_schema/Hydrated.d.ts.map +1 -0
  321. package/esm/json_schema/Hydrated.js +49 -0
  322. package/esm/json_schema/Hydrated.js.map +1 -0
  323. package/esm/json_schema/JSONSchema.d.ts +50 -0
  324. package/esm/json_schema/JSONSchema.d.ts.map +1 -0
  325. package/esm/json_schema/JSONSchema.js +46 -0
  326. package/esm/json_schema/JSONSchema.js.map +1 -0
  327. package/esm/json_schema/MetaType.d.ts +4 -0
  328. package/esm/json_schema/MetaType.d.ts.map +1 -0
  329. package/esm/json_schema/MetaType.js +25 -0
  330. package/esm/json_schema/MetaType.js.map +1 -0
  331. package/esm/json_schema/MetaTypeMigration.d.ts +19 -0
  332. package/esm/json_schema/MetaTypeMigration.d.ts.map +1 -0
  333. package/esm/json_schema/MetaTypeMigration.js +15 -0
  334. package/esm/json_schema/MetaTypeMigration.js.map +1 -0
  335. package/esm/json_schema/PathLike.d.ts +4 -0
  336. package/esm/json_schema/PathLike.d.ts.map +1 -0
  337. package/esm/json_schema/PathLike.js +3 -0
  338. package/esm/json_schema/PathLike.js.map +1 -0
  339. package/esm/json_schema/mod.d.ts +7 -0
  340. package/esm/json_schema/mod.d.ts.map +1 -0
  341. package/esm/json_schema/mod.js +8 -0
  342. package/esm/json_schema/mod.js.map +1 -0
  343. package/esm/json_schema/toJSONSchema.d.ts +4 -0
  344. package/esm/json_schema/toJSONSchema.d.ts.map +1 -0
  345. package/esm/json_schema/toJSONSchema.js +117 -0
  346. package/esm/json_schema/toJSONSchema.js.map +1 -0
  347. package/esm/mod.d.ts +4 -0
  348. package/esm/mod.d.ts.map +1 -0
  349. package/esm/mod.js +4 -0
  350. package/esm/mod.js.map +1 -0
  351. package/esm/package.json +3 -0
  352. package/esm/providers/OpenAI/OpenAIAdapter.d.ts +17 -0
  353. package/esm/providers/OpenAI/OpenAIAdapter.d.ts.map +1 -0
  354. package/esm/providers/OpenAI/OpenAIAdapter.js +56 -0
  355. package/esm/providers/OpenAI/OpenAIAdapter.js.map +1 -0
  356. package/esm/providers/OpenAI/OpenAIResponseFormat.d.ts +18 -0
  357. package/esm/providers/OpenAI/OpenAIResponseFormat.d.ts.map +1 -0
  358. package/esm/providers/OpenAI/OpenAIResponseFormat.js +26 -0
  359. package/esm/providers/OpenAI/OpenAIResponseFormat.js.map +1 -0
  360. package/esm/providers/OpenAI/TokenAllowance.d.ts +17 -0
  361. package/esm/providers/OpenAI/TokenAllowance.d.ts.map +1 -0
  362. package/esm/providers/OpenAI/TokenAllowance.js +32 -0
  363. package/esm/providers/OpenAI/TokenAllowance.js.map +1 -0
  364. package/esm/providers/OpenAI/mod.d.ts +6 -0
  365. package/esm/providers/OpenAI/mod.d.ts.map +1 -0
  366. package/esm/providers/OpenAI/mod.js +7 -0
  367. package/esm/providers/OpenAI/mod.js.map +1 -0
  368. package/esm/providers/OpenAI/openai_util.d.ts +4 -0
  369. package/esm/providers/OpenAI/openai_util.d.ts.map +1 -0
  370. package/esm/providers/OpenAI/openai_util.js +14 -0
  371. package/esm/providers/OpenAI/openai_util.js.map +1 -0
  372. package/esm/providers/OpenAI/refine.d.ts +2 -0
  373. package/esm/providers/OpenAI/refine.d.ts.map +1 -0
  374. package/esm/providers/OpenAI/refine.js +166 -0
  375. package/esm/providers/OpenAI/refine.js.map +1 -0
  376. package/esm/util/ArrayOfLength.d.ts +2 -0
  377. package/esm/util/ArrayOfLength.d.ts.map +1 -0
  378. package/esm/util/ArrayOfLength.js +2 -0
  379. package/esm/util/ArrayOfLength.js.map +1 -0
  380. package/esm/util/PromiseOr.d.ts +2 -0
  381. package/esm/util/PromiseOr.d.ts.map +1 -0
  382. package/esm/util/PromiseOr.js +2 -0
  383. package/esm/util/PromiseOr.js.map +1 -0
  384. package/esm/util/WeakMemo.d.ts +7 -0
  385. package/esm/util/WeakMemo.d.ts.map +1 -0
  386. package/esm/util/WeakMemo.js +32 -0
  387. package/esm/util/WeakMemo.js.map +1 -0
  388. package/esm/util/collect.d.ts +2 -0
  389. package/esm/util/collect.d.ts.map +1 -0
  390. package/esm/util/collect.js +8 -0
  391. package/esm/util/collect.js.map +1 -0
  392. package/esm/util/isPromise.d.ts +2 -0
  393. package/esm/util/isPromise.d.ts.map +1 -0
  394. package/esm/util/isPromise.js +7 -0
  395. package/esm/util/isPromise.js.map +1 -0
  396. package/esm/util/isTemplateStringsArray.d.ts +2 -0
  397. package/esm/util/isTemplateStringsArray.d.ts.map +1 -0
  398. package/esm/util/isTemplateStringsArray.js +4 -0
  399. package/esm/util/isTemplateStringsArray.js.map +1 -0
  400. package/esm/util/mod.d.ts +10 -0
  401. package/esm/util/mod.d.ts.map +1 -0
  402. package/esm/util/mod.js +11 -0
  403. package/esm/util/mod.js.map +1 -0
  404. package/esm/util/recombine.d.ts +2 -0
  405. package/esm/util/recombine.d.ts.map +1 -0
  406. package/esm/util/recombine.js +11 -0
  407. package/esm/util/recombine.js.map +1 -0
  408. package/esm/util/splitLast.d.ts +2 -0
  409. package/esm/util/splitLast.d.ts.map +1 -0
  410. package/esm/util/splitLast.js +8 -0
  411. package/esm/util/splitLast.js.map +1 -0
  412. package/esm/util/type_util.d.ts +5 -0
  413. package/esm/util/type_util.d.ts.map +1 -0
  414. package/esm/util/type_util.js +2 -0
  415. package/esm/util/type_util.js.map +1 -0
  416. package/package.json +22 -0
  417. package/src/_dnt.shims.ts +60 -0
  418. package/src/client/Adapter.ts +50 -0
  419. package/src/client/Liminal.ts +113 -0
  420. package/src/client/Tool.ts +17 -0
  421. package/src/client/constants.ts +6 -0
  422. package/src/client/mod.ts +6 -0
  423. package/src/core/DescriptionContext.ts +89 -0
  424. package/src/core/L.ts +3 -0
  425. package/src/core/ReduceDependencies.ts +9 -0
  426. package/src/core/Type.ts +45 -0
  427. package/src/core/TypeVisitor.ts +44 -0
  428. package/src/core/annotations/Annotation.ts +14 -0
  429. package/src/core/annotations/Assertion.ts +18 -0
  430. package/src/core/annotations/Description.ts +16 -0
  431. package/src/core/annotations/Param.ts +30 -0
  432. package/src/core/annotations/Template.ts +11 -0
  433. package/src/core/annotations/mod.ts +7 -0
  434. package/src/core/assert.ts +145 -0
  435. package/src/core/declareIntrinsic.ts +45 -0
  436. package/src/core/deserialize.ts +36 -0
  437. package/src/core/display.ts +68 -0
  438. package/src/core/inspect.node.ts +13 -0
  439. package/src/core/intrinsics.ts +86 -0
  440. package/src/core/intrinsics_util.ts +50 -0
  441. package/src/core/isType.ts +20 -0
  442. package/src/core/mod.ts +15 -0
  443. package/src/core/signature.ts +90 -0
  444. package/src/core/utility/Flatten.ts +14 -0
  445. package/src/core/utility/Intersection.ts +24 -0
  446. package/src/core/utility/Option.ts +6 -0
  447. package/src/core/utility/Record.ts +7 -0
  448. package/src/core/utility/Set.ts +8 -0
  449. package/src/core/utility/TaggedUnion.ts +23 -0
  450. package/src/core/utility/Tuple.ts +24 -0
  451. package/src/core/utility/mod.ts +9 -0
  452. package/src/deps/jsr.io/@std/assert/1.0.10/almost_equals.ts +55 -0
  453. package/src/deps/jsr.io/@std/assert/1.0.10/array_includes.ts +57 -0
  454. package/src/deps/jsr.io/@std/assert/1.0.10/assert.ts +23 -0
  455. package/src/deps/jsr.io/@std/assert/1.0.10/assertion_error.ts +31 -0
  456. package/src/deps/jsr.io/@std/assert/1.0.10/equal.ts +210 -0
  457. package/src/deps/jsr.io/@std/assert/1.0.10/equals.ts +65 -0
  458. package/src/deps/jsr.io/@std/assert/1.0.10/exists.ts +31 -0
  459. package/src/deps/jsr.io/@std/assert/1.0.10/fail.ts +21 -0
  460. package/src/deps/jsr.io/@std/assert/1.0.10/false.ts +26 -0
  461. package/src/deps/jsr.io/@std/assert/1.0.10/greater.ts +30 -0
  462. package/src/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.ts +36 -0
  463. package/src/deps/jsr.io/@std/assert/1.0.10/instance_of.ts +64 -0
  464. package/src/deps/jsr.io/@std/assert/1.0.10/is_error.ts +65 -0
  465. package/src/deps/jsr.io/@std/assert/1.0.10/less.ts +29 -0
  466. package/src/deps/jsr.io/@std/assert/1.0.10/less_or_equal.ts +36 -0
  467. package/src/deps/jsr.io/@std/assert/1.0.10/match.ts +30 -0
  468. package/src/deps/jsr.io/@std/assert/1.0.10/mod.ts +47 -0
  469. package/src/deps/jsr.io/@std/assert/1.0.10/not_equals.ts +37 -0
  470. package/src/deps/jsr.io/@std/assert/1.0.10/not_instance_of.ts +33 -0
  471. package/src/deps/jsr.io/@std/assert/1.0.10/not_match.ts +30 -0
  472. package/src/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.ts +42 -0
  473. package/src/deps/jsr.io/@std/assert/1.0.10/object_match.ts +203 -0
  474. package/src/deps/jsr.io/@std/assert/1.0.10/rejects.ts +123 -0
  475. package/src/deps/jsr.io/@std/assert/1.0.10/strict_equals.ts +67 -0
  476. package/src/deps/jsr.io/@std/assert/1.0.10/string_includes.ts +30 -0
  477. package/src/deps/jsr.io/@std/assert/1.0.10/throws.ts +111 -0
  478. package/src/deps/jsr.io/@std/assert/1.0.10/unimplemented.ts +21 -0
  479. package/src/deps/jsr.io/@std/assert/1.0.10/unreachable.ts +21 -0
  480. package/src/deps/jsr.io/@std/encoding/1.0.6/_base32_common.ts +218 -0
  481. package/src/deps/jsr.io/@std/encoding/1.0.6/_validate_binary_like.ts +29 -0
  482. package/src/deps/jsr.io/@std/encoding/1.0.6/ascii85.ts +203 -0
  483. package/src/deps/jsr.io/@std/encoding/1.0.6/base32.ts +73 -0
  484. package/src/deps/jsr.io/@std/encoding/1.0.6/base58.ts +173 -0
  485. package/src/deps/jsr.io/@std/encoding/1.0.6/base64.ts +174 -0
  486. package/src/deps/jsr.io/@std/encoding/1.0.6/base64url.ts +88 -0
  487. package/src/deps/jsr.io/@std/encoding/1.0.6/hex.ts +120 -0
  488. package/src/deps/jsr.io/@std/encoding/1.0.6/mod.ts +24 -0
  489. package/src/deps/jsr.io/@std/encoding/1.0.6/varint.ts +242 -0
  490. package/src/deps/jsr.io/@std/internal/1.0.5/build_message.ts +134 -0
  491. package/src/deps/jsr.io/@std/internal/1.0.5/diff.ts +317 -0
  492. package/src/deps/jsr.io/@std/internal/1.0.5/diff_str.ts +204 -0
  493. package/src/deps/jsr.io/@std/internal/1.0.5/format.ts +39 -0
  494. package/src/deps/jsr.io/@std/internal/1.0.5/styles.ts +233 -0
  495. package/src/deps/jsr.io/@std/internal/1.0.5/types.ts +18 -0
  496. package/src/json_schema/Hydrated.ts +52 -0
  497. package/src/json_schema/JSONSchema.ts +95 -0
  498. package/src/json_schema/MetaType.ts +32 -0
  499. package/src/json_schema/MetaTypeMigration.ts +31 -0
  500. package/src/json_schema/PathLike.ts +9 -0
  501. package/src/json_schema/mod.ts +8 -0
  502. package/src/json_schema/toJSONSchema.ts +114 -0
  503. package/src/mod.ts +3 -0
  504. package/src/providers/OpenAI/OpenAIAdapter.ts +89 -0
  505. package/src/providers/OpenAI/OpenAIResponseFormat.ts +54 -0
  506. package/src/providers/OpenAI/TokenAllowance.ts +29 -0
  507. package/src/providers/OpenAI/mod.ts +7 -0
  508. package/src/providers/OpenAI/openai_util.ts +19 -0
  509. package/src/providers/OpenAI/refine.ts +171 -0
  510. package/src/util/ArrayOfLength.ts +5 -0
  511. package/src/util/PromiseOr.ts +1 -0
  512. package/src/util/WeakMemo.ts +13 -0
  513. package/src/util/collect.ts +7 -0
  514. package/src/util/isPromise.ts +8 -0
  515. package/src/util/isTemplateStringsArray.ts +3 -0
  516. package/src/util/mod.ts +11 -0
  517. package/src/util/recombine.ts +10 -0
  518. package/src/util/splitLast.ts +7 -0
  519. package/src/util/type_util.ts +3 -0
@@ -0,0 +1,164 @@
1
+ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ /**
4
+ * Utilities for
5
+ * {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-4 | base64}
6
+ * encoding and decoding.
7
+ *
8
+ * ```ts
9
+ * import {
10
+ * encodeBase64,
11
+ * decodeBase64,
12
+ * } from "@std/encoding/base64";
13
+ * import { assertEquals } from "@std/assert";
14
+ *
15
+ * const foobar = new TextEncoder().encode("foobar");
16
+ *
17
+ * assertEquals(encodeBase64(foobar), "Zm9vYmFy");
18
+ * assertEquals(decodeBase64("Zm9vYmFy"), foobar);
19
+ * ```
20
+ *
21
+ * @module
22
+ */
23
+ import { validateBinaryLike } from "./_validate_binary_like.js";
24
+ const base64abc = [
25
+ "A",
26
+ "B",
27
+ "C",
28
+ "D",
29
+ "E",
30
+ "F",
31
+ "G",
32
+ "H",
33
+ "I",
34
+ "J",
35
+ "K",
36
+ "L",
37
+ "M",
38
+ "N",
39
+ "O",
40
+ "P",
41
+ "Q",
42
+ "R",
43
+ "S",
44
+ "T",
45
+ "U",
46
+ "V",
47
+ "W",
48
+ "X",
49
+ "Y",
50
+ "Z",
51
+ "a",
52
+ "b",
53
+ "c",
54
+ "d",
55
+ "e",
56
+ "f",
57
+ "g",
58
+ "h",
59
+ "i",
60
+ "j",
61
+ "k",
62
+ "l",
63
+ "m",
64
+ "n",
65
+ "o",
66
+ "p",
67
+ "q",
68
+ "r",
69
+ "s",
70
+ "t",
71
+ "u",
72
+ "v",
73
+ "w",
74
+ "x",
75
+ "y",
76
+ "z",
77
+ "0",
78
+ "1",
79
+ "2",
80
+ "3",
81
+ "4",
82
+ "5",
83
+ "6",
84
+ "7",
85
+ "8",
86
+ "9",
87
+ "+",
88
+ "/",
89
+ ];
90
+ /**
91
+ * Converts data into a base64-encoded string.
92
+ *
93
+ * @see {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-4}
94
+ *
95
+ * @param data The data to encode.
96
+ * @returns The base64-encoded string.
97
+ *
98
+ * @example Usage
99
+ * ```ts
100
+ * import { encodeBase64 } from "@std/encoding/base64";
101
+ * import { assertEquals } from "@std/assert";
102
+ *
103
+ * assertEquals(encodeBase64("foobar"), "Zm9vYmFy");
104
+ * ```
105
+ */
106
+ export function encodeBase64(data) {
107
+ // CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727
108
+ const uint8 = validateBinaryLike(data);
109
+ let result = "";
110
+ let i;
111
+ const l = uint8.length;
112
+ for (i = 2; i < l; i += 3) {
113
+ result += base64abc[(uint8[i - 2]) >> 2];
114
+ result += base64abc[(((uint8[i - 2]) & 0x03) << 4) |
115
+ ((uint8[i - 1]) >> 4)];
116
+ result += base64abc[(((uint8[i - 1]) & 0x0f) << 2) |
117
+ ((uint8[i]) >> 6)];
118
+ result += base64abc[(uint8[i]) & 0x3f];
119
+ }
120
+ if (i === l + 1) {
121
+ // 1 octet yet to write
122
+ result += base64abc[(uint8[i - 2]) >> 2];
123
+ result += base64abc[((uint8[i - 2]) & 0x03) << 4];
124
+ result += "==";
125
+ }
126
+ if (i === l) {
127
+ // 2 octets yet to write
128
+ result += base64abc[(uint8[i - 2]) >> 2];
129
+ result += base64abc[(((uint8[i - 2]) & 0x03) << 4) |
130
+ ((uint8[i - 1]) >> 4)];
131
+ result += base64abc[((uint8[i - 1]) & 0x0f) << 2];
132
+ result += "=";
133
+ }
134
+ return result;
135
+ }
136
+ /**
137
+ * Decodes a base64-encoded string.
138
+ *
139
+ * @see {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-4}
140
+ *
141
+ * @param b64 The base64-encoded string to decode.
142
+ * @returns The decoded data.
143
+ *
144
+ * @example Usage
145
+ * ```ts
146
+ * import { decodeBase64 } from "@std/encoding/base64";
147
+ * import { assertEquals } from "@std/assert";
148
+ *
149
+ * assertEquals(
150
+ * decodeBase64("Zm9vYmFy"),
151
+ * new TextEncoder().encode("foobar")
152
+ * );
153
+ * ```
154
+ */
155
+ export function decodeBase64(b64) {
156
+ const binString = atob(b64);
157
+ const size = binString.length;
158
+ const bytes = new Uint8Array(size);
159
+ for (let i = 0; i < size; i++) {
160
+ bytes[i] = binString.charCodeAt(i);
161
+ }
162
+ return bytes;
163
+ }
164
+ //# sourceMappingURL=base64.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base64.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1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YAC/B,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAE,CAAC,IAAI,CAAC,CAAC,CACvB,CAAC;QACF,MAAM,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACnD,MAAM,IAAI,GAAG,CAAC;IAChB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5B,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,CAAC;IAC9B,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;IACnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC;QAC9B,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Convert data into a base64url-encoded string.
3
+ *
4
+ * @see {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-5}
5
+ *
6
+ * @param data The data to encode.
7
+ * @returns The base64url-encoded string.
8
+ *
9
+ * @example Usage
10
+ * ```ts
11
+ * import { encodeBase64Url } from "@std/encoding/base64url";
12
+ * import { assertEquals } from "@std/assert";
13
+ *
14
+ * assertEquals(encodeBase64Url("foobar"), "Zm9vYmFy");
15
+ * ```
16
+ */
17
+ export declare function encodeBase64Url(data: ArrayBuffer | Uint8Array | string): string;
18
+ /**
19
+ * Decodes a given base64url-encoded string.
20
+ *
21
+ * @see {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-5}
22
+ *
23
+ * @param b64url The base64url-encoded string to decode.
24
+ * @returns The decoded data.
25
+ *
26
+ * @example Usage
27
+ * ```ts
28
+ * import { decodeBase64Url } from "@std/encoding/base64url";
29
+ * import { assertEquals } from "@std/assert";
30
+ *
31
+ * assertEquals(
32
+ * decodeBase64Url("Zm9vYmFy"),
33
+ * new TextEncoder().encode("foobar")
34
+ * );
35
+ * ```
36
+ */
37
+ export declare function decodeBase64Url(b64url: string): Uint8Array;
38
+ //# sourceMappingURL=base64url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base64url.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.6/base64url.ts"],"names":[],"mappings":"AA4CA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,WAAW,GAAG,UAAU,GAAG,MAAM,GACtC,MAAM,CAER;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAE1D"}
@@ -0,0 +1,82 @@
1
+ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ /**
4
+ * Utilities for
5
+ * {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-5 | base64url}
6
+ * encoding and decoding.
7
+ *
8
+ * @module
9
+ */
10
+ import * as base64 from "./base64.js";
11
+ /**
12
+ * Some variants allow or require omitting the padding '=' signs:
13
+ * https://en.wikipedia.org/wiki/Base64#The_URL_applications
14
+ *
15
+ * @param base64url
16
+ */
17
+ function addPaddingToBase64url(base64url) {
18
+ if (base64url.length % 4 === 2)
19
+ return base64url + "==";
20
+ if (base64url.length % 4 === 3)
21
+ return base64url + "=";
22
+ if (base64url.length % 4 === 1) {
23
+ throw new TypeError("Illegal base64url string");
24
+ }
25
+ return base64url;
26
+ }
27
+ function convertBase64urlToBase64(b64url) {
28
+ if (!/^[-_A-Z0-9]*?={0,2}$/i.test(b64url)) {
29
+ // Contains characters not part of base64url spec.
30
+ throw new TypeError("Failed to decode base64url: invalid character");
31
+ }
32
+ return addPaddingToBase64url(b64url).replace(/\-/g, "+").replace(/_/g, "/");
33
+ }
34
+ function convertBase64ToBase64url(b64) {
35
+ return b64.endsWith("=")
36
+ ? b64.endsWith("==")
37
+ ? b64.replace(/\+/g, "-").replace(/\//g, "_").slice(0, -2)
38
+ : b64.replace(/\+/g, "-").replace(/\//g, "_").slice(0, -1)
39
+ : b64.replace(/\+/g, "-").replace(/\//g, "_");
40
+ }
41
+ /**
42
+ * Convert data into a base64url-encoded string.
43
+ *
44
+ * @see {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-5}
45
+ *
46
+ * @param data The data to encode.
47
+ * @returns The base64url-encoded string.
48
+ *
49
+ * @example Usage
50
+ * ```ts
51
+ * import { encodeBase64Url } from "@std/encoding/base64url";
52
+ * import { assertEquals } from "@std/assert";
53
+ *
54
+ * assertEquals(encodeBase64Url("foobar"), "Zm9vYmFy");
55
+ * ```
56
+ */
57
+ export function encodeBase64Url(data) {
58
+ return convertBase64ToBase64url(base64.encodeBase64(data));
59
+ }
60
+ /**
61
+ * Decodes a given base64url-encoded string.
62
+ *
63
+ * @see {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-5}
64
+ *
65
+ * @param b64url The base64url-encoded string to decode.
66
+ * @returns The decoded data.
67
+ *
68
+ * @example Usage
69
+ * ```ts
70
+ * import { decodeBase64Url } from "@std/encoding/base64url";
71
+ * import { assertEquals } from "@std/assert";
72
+ *
73
+ * assertEquals(
74
+ * decodeBase64Url("Zm9vYmFy"),
75
+ * new TextEncoder().encode("foobar")
76
+ * );
77
+ * ```
78
+ */
79
+ export function decodeBase64Url(b64url) {
80
+ return base64.decodeBase64(convertBase64urlToBase64(b64url));
81
+ }
82
+ //# sourceMappingURL=base64url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base64url.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.6/base64url.ts"],"names":[],"mappings":"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C,EAAE,CAAC,CAAC,CAAC;QAC5D,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAClD,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,eAAe,CAC7B,IAAuC;IAEvC,OAAO,wBAAwB,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,eAAe,CAAC,MAAc;IAC5C,OAAO,MAAM,CAAC,YAAY,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Converts data into a hex-encoded string.
3
+ *
4
+ * @param src The data to encode.
5
+ *
6
+ * @returns The hex-encoded string.
7
+ *
8
+ * @example Usage
9
+ * ```ts
10
+ * import { encodeHex } from "@std/encoding/hex";
11
+ * import { assertEquals } from "@std/assert";
12
+ *
13
+ * assertEquals(encodeHex("abc"), "616263");
14
+ * ```
15
+ */
16
+ export declare function encodeHex(src: string | Uint8Array | ArrayBuffer): string;
17
+ /**
18
+ * Decodes the given hex-encoded string. If the input is malformed, an error is
19
+ * thrown.
20
+ *
21
+ * @param src The hex-encoded string to decode.
22
+ *
23
+ * @returns The decoded data.
24
+ *
25
+ * @example Usage
26
+ * ```ts
27
+ * import { decodeHex } from "@std/encoding/hex";
28
+ * import { assertEquals } from "@std/assert";
29
+ *
30
+ * assertEquals(
31
+ * decodeHex("616263"),
32
+ * new TextEncoder().encode("abc"),
33
+ * );
34
+ * ```
35
+ */
36
+ export declare function decodeHex(src: string): Uint8Array;
37
+ //# sourceMappingURL=hex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hex.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.6/hex.ts"],"names":[],"mappings":"AAwDA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,MAAM,CAUxE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAiBjD"}
@@ -0,0 +1,110 @@
1
+ // Copyright 2009 The Go Authors. All rights reserved.
2
+ // https://github.com/golang/go/blob/master/LICENSE
3
+ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
4
+ // This module is browser compatible.
5
+ /**
6
+ * Port of the Go
7
+ * {@link https://github.com/golang/go/blob/go1.12.5/src/encoding/hex/hex.go | encoding/hex}
8
+ * library.
9
+ *
10
+ * ```ts
11
+ * import {
12
+ * decodeHex,
13
+ * encodeHex,
14
+ * } from "@std/encoding/hex";
15
+ * import { assertEquals } from "@std/assert";
16
+ *
17
+ * assertEquals(encodeHex("abc"), "616263");
18
+ *
19
+ * assertEquals(
20
+ * decodeHex("616263"),
21
+ * new TextEncoder().encode("abc"),
22
+ * );
23
+ * ```
24
+ *
25
+ * @module
26
+ */
27
+ import { validateBinaryLike } from "./_validate_binary_like.js";
28
+ const hexTable = new TextEncoder().encode("0123456789abcdef");
29
+ const textEncoder = new TextEncoder();
30
+ const textDecoder = new TextDecoder();
31
+ function errInvalidByte(byte) {
32
+ return new TypeError(`Invalid byte '${String.fromCharCode(byte)}'`);
33
+ }
34
+ function errLength(len) {
35
+ return new RangeError(`Cannot decode the hex string as the input length should be even: length is ${len}`);
36
+ }
37
+ /** Converts a hex character into its value. */
38
+ function fromHexChar(byte) {
39
+ // '0' <= byte && byte <= '9'
40
+ if (48 <= byte && byte <= 57)
41
+ return byte - 48;
42
+ // 'a' <= byte && byte <= 'f'
43
+ if (97 <= byte && byte <= 102)
44
+ return byte - 97 + 10;
45
+ // 'A' <= byte && byte <= 'F'
46
+ if (65 <= byte && byte <= 70)
47
+ return byte - 65 + 10;
48
+ throw errInvalidByte(byte);
49
+ }
50
+ /**
51
+ * Converts data into a hex-encoded string.
52
+ *
53
+ * @param src The data to encode.
54
+ *
55
+ * @returns The hex-encoded string.
56
+ *
57
+ * @example Usage
58
+ * ```ts
59
+ * import { encodeHex } from "@std/encoding/hex";
60
+ * import { assertEquals } from "@std/assert";
61
+ *
62
+ * assertEquals(encodeHex("abc"), "616263");
63
+ * ```
64
+ */
65
+ export function encodeHex(src) {
66
+ const u8 = validateBinaryLike(src);
67
+ const dst = new Uint8Array(u8.length * 2);
68
+ for (let i = 0; i < u8.length; i++) {
69
+ const v = u8[i];
70
+ dst[i * 2] = hexTable[v >> 4];
71
+ dst[i * 2 + 1] = hexTable[v & 0x0f];
72
+ }
73
+ return textDecoder.decode(dst);
74
+ }
75
+ /**
76
+ * Decodes the given hex-encoded string. If the input is malformed, an error is
77
+ * thrown.
78
+ *
79
+ * @param src The hex-encoded string to decode.
80
+ *
81
+ * @returns The decoded data.
82
+ *
83
+ * @example Usage
84
+ * ```ts
85
+ * import { decodeHex } from "@std/encoding/hex";
86
+ * import { assertEquals } from "@std/assert";
87
+ *
88
+ * assertEquals(
89
+ * decodeHex("616263"),
90
+ * new TextEncoder().encode("abc"),
91
+ * );
92
+ * ```
93
+ */
94
+ export function decodeHex(src) {
95
+ const u8 = textEncoder.encode(src);
96
+ const dst = new Uint8Array(u8.length / 2);
97
+ for (let i = 0; i < dst.length; i++) {
98
+ const a = fromHexChar(u8[i * 2]);
99
+ const b = fromHexChar(u8[i * 2 + 1]);
100
+ dst[i] = (a << 4) | b;
101
+ }
102
+ if (u8.length % 2 === 1) {
103
+ // Check for invalid char before reporting bad length,
104
+ // since the invalid char (if present) is an earlier problem.
105
+ fromHexChar(u8[dst.length * 2]);
106
+ throw errLength(u8.length);
107
+ }
108
+ return dst;
109
+ }
110
+ //# sourceMappingURL=hex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hex.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/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C,MAAM,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Utilities for encoding and decoding common formats like hex, base64, and varint.
3
+ *
4
+ * ```ts
5
+ * import { encodeBase64, decodeBase64 } from "@std/encoding";
6
+ * import { assertEquals } from "@std/assert";
7
+ *
8
+ * const foobar = new TextEncoder().encode("foobar");
9
+ * assertEquals(encodeBase64(foobar), "Zm9vYmFy");
10
+ * assertEquals(decodeBase64("Zm9vYmFy"), foobar);
11
+ * ```
12
+ *
13
+ * @module
14
+ */
15
+ export * from "./ascii85.js";
16
+ export * from "./base32.js";
17
+ export * from "./base58.js";
18
+ export * from "./base64.js";
19
+ export * from "./base64url.js";
20
+ export * from "./hex.js";
21
+ export * from "./varint.js";
22
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.6/mod.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC"}
@@ -0,0 +1,23 @@
1
+ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
+ /**
3
+ * Utilities for encoding and decoding common formats like hex, base64, and varint.
4
+ *
5
+ * ```ts
6
+ * import { encodeBase64, decodeBase64 } from "@std/encoding";
7
+ * import { assertEquals } from "@std/assert";
8
+ *
9
+ * const foobar = new TextEncoder().encode("foobar");
10
+ * assertEquals(encodeBase64(foobar), "Zm9vYmFy");
11
+ * assertEquals(decodeBase64("Zm9vYmFy"), foobar);
12
+ * ```
13
+ *
14
+ * @module
15
+ */
16
+ export * from "./ascii85.js";
17
+ export * from "./base32.js";
18
+ export * from "./base58.js";
19
+ export * from "./base64.js";
20
+ export * from "./base64url.js";
21
+ export * from "./hex.js";
22
+ export * from "./varint.js";
23
+ //# sourceMappingURL=mod.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.6/mod.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAE1E;;;;;;;;;;;;;GAaG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC"}
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Utilities for {@link https://protobuf.dev/programming-guides/encoding/#varints Varint} encoding
3
+ * of typed integers. Varint encoding represents integers using a variable number of bytes, with
4
+ * smaller values requiring fewer bytes.
5
+ *
6
+ * ```ts
7
+ * import { encodeVarint, decodeVarint } from "@std/encoding/varint";
8
+ * import { assertEquals } from "@std/assert";
9
+ *
10
+ * const buf = new Uint8Array(10);
11
+ * assertEquals(
12
+ * encodeVarint(42n, buf),
13
+ * [new Uint8Array([42]), 1]
14
+ * );
15
+ *
16
+ * assertEquals(
17
+ * decodeVarint(new Uint8Array([42])),
18
+ * [ 42n, 1 ]
19
+ * );
20
+ * ```
21
+ *
22
+ * @module
23
+ */
24
+ /**
25
+ * The maximum value of an unsigned 64-bit integer.
26
+ * Equivalent to `2n**64n - 1n`
27
+ */
28
+ export declare const MaxUint64 = 18446744073709551615n;
29
+ /**
30
+ * The maximum length, in bytes, of a Varint encoded 64-bit integer.
31
+ */
32
+ export declare const MaxVarintLen64 = 10;
33
+ /**
34
+ * The maximum length, in bytes, of a Varint encoded 32-bit integer.
35
+ */
36
+ export declare const MaxVarintLen32 = 5;
37
+ /**
38
+ * Given a non empty `buf`, starting at `offset` (default: 0), begin decoding bytes as
39
+ * Varint encoded bytes, for a maximum of 10 bytes (offset + 10). The returned
40
+ * tuple is of the decoded varint 32-bit number, and the new offset with which
41
+ * to continue decoding other data.
42
+ *
43
+ * If a `bigint` in return is undesired, the `decode32` function will return a
44
+ * `number`, but this should only be used in cases where the varint is
45
+ * _assured_ to be 32-bits. If in doubt, use `decode()`.
46
+ *
47
+ * To know how many bytes the Varint took to encode, simply negate `offset`
48
+ * from the returned new `offset`.
49
+ *
50
+ * @param buf The buffer to decode from.
51
+ * @param offset The offset to start decoding from.
52
+ * @returns A tuple of the decoded varint 64-bit number, and the new offset.
53
+ *
54
+ * @example Usage
55
+ * ```ts
56
+ * import { decodeVarint } from "@std/encoding/varint";
57
+ * import { assertEquals } from "@std/assert";
58
+ *
59
+ * const buf = new Uint8Array([0x8E, 0x02]);
60
+ * assertEquals(decodeVarint(buf), [270n, 2]);
61
+ * ```
62
+ */
63
+ export declare function decodeVarint(buf: Uint8Array, offset?: number): [bigint, number];
64
+ /**
65
+ * Given a `buf`, starting at `offset` (default: 0), begin decoding bytes as
66
+ * Varint encoded bytes, for a maximum of 5 bytes (offset + 5). The returned
67
+ * tuple is of the decoded varint 32-bit number, and the new offset with which
68
+ * to continue decoding other data.
69
+ *
70
+ * Varints are _not 32-bit by default_ so this should only be used in cases
71
+ * where the varint is _assured_ to be 32-bits. If in doubt, use `decode()`.
72
+ *
73
+ * To know how many bytes the Varint took to encode, simply negate `offset`
74
+ * from the returned new `offset`.
75
+ *
76
+ * @param buf The buffer to decode from.
77
+ * @param offset The offset to start decoding from.
78
+ * @returns A tuple of the decoded varint 32-bit number, and the new offset.
79
+ *
80
+ * @example Usage
81
+ * ```ts
82
+ * import { decodeVarint32 } from "@std/encoding/varint";
83
+ * import { assertEquals } from "@std/assert";
84
+ *
85
+ * const buf = new Uint8Array([0x8E, 0x02]);
86
+ * assertEquals(decodeVarint32(buf), [270, 2]);
87
+ * ```
88
+ */
89
+ export declare function decodeVarint32(buf: Uint8Array, offset?: number): [number, number];
90
+ /**
91
+ * Takes unsigned number `num` and converts it into a Varint encoded
92
+ * `Uint8Array`, returning a tuple consisting of a `Uint8Array` slice of the
93
+ * encoded Varint, and an offset where the Varint encoded bytes end within the
94
+ * `Uint8Array`.
95
+ *
96
+ * If `buf` is not given then a Uint8Array will be created.
97
+ * `offset` defaults to `0`.
98
+ *
99
+ * If passed `buf` then that will be written into, starting at `offset`. The
100
+ * resulting returned `Uint8Array` will be a slice of `buf`. The resulting
101
+ * returned number is effectively `offset + bytesWritten`.
102
+ *
103
+ * @param num The number to encode.
104
+ * @param buf The buffer to write into.
105
+ * @param offset The offset to start writing at.
106
+ * @returns A tuple of the encoded Varint `Uint8Array` and the new offset.
107
+ *
108
+ * @example Usage
109
+ * ```ts
110
+ * import { encodeVarint } from "@std/encoding/varint";
111
+ * import { assertEquals } from "@std/assert";
112
+ *
113
+ * const buf = new Uint8Array(10);
114
+ * assertEquals(encodeVarint(42n, buf), [new Uint8Array([42]), 1]);
115
+ * ```
116
+ */
117
+ export declare function encodeVarint(num: bigint | number, buf?: Uint8Array, offset?: number): [Uint8Array, number];
118
+ //# sourceMappingURL=varint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"varint.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.6/varint.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH;;;GAGG;AACH,eAAO,MAAM,SAAS,wBAAwB,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC;;GAEG;AACH,eAAO,MAAM,cAAc,IAAI,CAAC;AAahC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,SAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CA6D1E;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,SAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAe5E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,MAAM,GAAG,MAAM,EACpB,GAAG,GAAE,UAA2C,EAChD,MAAM,SAAI,GACT,CAAC,UAAU,EAAE,MAAM,CAAC,CAuBtB"}