@fedify/fedify 0.9.0-dev.177 → 0.9.0-dev.181

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of @fedify/fedify might be problematic. Click here for more details.

Files changed (271) hide show
  1. package/CHANGES.md +13 -0
  2. package/esm/deps/jsr.io/@std/encoding/{0.224.2 → 0.224.3}/base64.js +14 -7
  3. package/esm/deps/jsr.io/@std/encoding/{0.224.2 → 0.224.3}/hex.js +24 -7
  4. package/esm/deps/jsr.io/@std/semver/0.224.1/can_parse.js +30 -0
  5. package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/compare.js +17 -0
  6. package/esm/deps/jsr.io/@std/semver/0.224.1/difference.js +37 -0
  7. package/esm/deps/jsr.io/@std/semver/0.224.1/equals.js +27 -0
  8. package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/format.js +14 -1
  9. package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/format_range.js +9 -1
  10. package/esm/deps/jsr.io/@std/semver/0.224.1/greater_or_equal.js +25 -0
  11. package/esm/deps/jsr.io/@std/semver/0.224.1/greater_than.js +27 -0
  12. package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/greater_than_range.js +19 -1
  13. package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/increment.js +18 -2
  14. package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/is_range.js +10 -0
  15. package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/is_semver.js +16 -0
  16. package/esm/deps/jsr.io/@std/semver/0.224.1/less_or_equal.js +25 -0
  17. package/esm/deps/jsr.io/@std/semver/0.224.1/less_than.js +25 -0
  18. package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/less_than_range.js +21 -3
  19. package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/max_satisfying.js +12 -0
  20. package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/min_satisfying.js +12 -0
  21. package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/mod.js +3 -2
  22. package/esm/deps/jsr.io/@std/semver/0.224.1/not_equals.js +24 -0
  23. package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/parse.js +16 -0
  24. package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/parse_range.js +18 -0
  25. package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/range_intersects.js +16 -1
  26. package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/range_max.js +16 -5
  27. package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/range_min.js +16 -5
  28. package/esm/deps/jsr.io/@std/semver/0.224.1/satisfies.js +26 -0
  29. package/esm/deps/jsr.io/@std/semver/0.224.1/test_range.js +28 -0
  30. package/esm/deps/jsr.io/@std/semver/0.224.1/try_parse.js +30 -0
  31. package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/try_parse_range.js +16 -1
  32. package/esm/federation/collection.js +1 -1
  33. package/esm/federation/handler.js +1 -1
  34. package/esm/federation/middleware.js +7 -3
  35. package/esm/httpsig/mod.js +60 -283
  36. package/esm/nodeinfo/types.js +1 -1
  37. package/esm/runtime/docloader.js +3 -3
  38. package/esm/runtime/key.js +1 -1
  39. package/esm/sig/http.js +229 -0
  40. package/esm/{httpsig → sig}/key.js +0 -3
  41. package/esm/sig/mod.js +8 -0
  42. package/esm/sig/owner.js +94 -0
  43. package/esm/vocab/tombstone.yaml +20 -0
  44. package/esm/vocab/vocab.js +165 -0
  45. package/package.json +7 -1
  46. package/types/deps/jsr.io/@std/assert/0.225.3/assert.d.ts.map +1 -0
  47. package/types/deps/jsr.io/@std/assert/0.225.3/assertion_error.d.ts.map +1 -0
  48. package/types/deps/jsr.io/@std/encoding/{0.224.2/_util.d.ts → 0.224.3/_validate_binary_like.d.ts} +1 -1
  49. package/types/deps/jsr.io/@std/encoding/0.224.3/_validate_binary_like.d.ts.map +1 -0
  50. package/types/deps/jsr.io/@std/encoding/{0.224.2 → 0.224.3}/base64.d.ts +9 -4
  51. package/types/deps/jsr.io/@std/encoding/0.224.3/base64.d.ts.map +1 -0
  52. package/types/deps/jsr.io/@std/encoding/0.224.3/hex.d.ts +37 -0
  53. package/types/deps/jsr.io/@std/encoding/0.224.3/hex.d.ts.map +1 -0
  54. package/types/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/_negotiation/common.d.ts.map +1 -1
  55. package/types/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/_negotiation/encoding.d.ts.map +1 -1
  56. package/types/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/_negotiation/language.d.ts.map +1 -1
  57. package/types/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/_negotiation/media_type.d.ts.map +1 -1
  58. package/types/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/negotiation.d.ts +27 -6
  59. package/types/deps/jsr.io/@std/http/0.224.2/negotiation.d.ts.map +1 -0
  60. package/types/deps/jsr.io/@std/semver/0.224.1/_constants.d.ts.map +1 -0
  61. package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/_shared.d.ts.map +1 -1
  62. package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/_test_comparator_set.d.ts.map +1 -1
  63. package/types/deps/jsr.io/@std/semver/0.224.1/can_parse.d.ts +17 -0
  64. package/types/deps/jsr.io/@std/semver/0.224.1/can_parse.d.ts.map +1 -0
  65. package/types/deps/jsr.io/@std/semver/0.224.1/compare.d.ts +28 -0
  66. package/types/deps/jsr.io/@std/semver/0.224.1/compare.d.ts.map +1 -0
  67. package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/constants.d.ts.map +1 -1
  68. package/types/deps/jsr.io/@std/semver/0.224.1/difference.d.ts +27 -0
  69. package/types/deps/jsr.io/@std/semver/0.224.1/difference.d.ts.map +1 -0
  70. package/types/deps/jsr.io/@std/semver/0.224.1/equals.d.ts +24 -0
  71. package/types/deps/jsr.io/@std/semver/0.224.1/equals.d.ts.map +1 -0
  72. package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/format.d.ts +14 -1
  73. package/types/deps/jsr.io/@std/semver/0.224.1/format.d.ts.map +1 -0
  74. package/types/deps/jsr.io/@std/semver/0.224.1/format_range.d.ts +17 -0
  75. package/types/deps/jsr.io/@std/semver/0.224.1/format_range.d.ts.map +1 -0
  76. package/types/deps/jsr.io/@std/semver/0.224.1/greater_or_equal.d.ts +24 -0
  77. package/types/deps/jsr.io/@std/semver/0.224.1/greater_or_equal.d.ts.map +1 -0
  78. package/types/deps/jsr.io/@std/semver/0.224.1/greater_than.d.ts +24 -0
  79. package/types/deps/jsr.io/@std/semver/0.224.1/greater_than.d.ts.map +1 -0
  80. package/types/deps/jsr.io/@std/semver/0.224.1/greater_than_range.d.ts +22 -0
  81. package/types/deps/jsr.io/@std/semver/0.224.1/greater_than_range.d.ts.map +1 -0
  82. package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/increment.d.ts +18 -2
  83. package/types/deps/jsr.io/@std/semver/0.224.1/increment.d.ts.map +1 -0
  84. package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/is_range.d.ts +10 -0
  85. package/types/deps/jsr.io/@std/semver/0.224.1/is_range.d.ts.map +1 -0
  86. package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/is_semver.d.ts +16 -0
  87. package/types/deps/jsr.io/@std/semver/0.224.1/is_semver.d.ts.map +1 -0
  88. package/types/deps/jsr.io/@std/semver/0.224.1/less_or_equal.d.ts +24 -0
  89. package/types/deps/jsr.io/@std/semver/0.224.1/less_or_equal.d.ts.map +1 -0
  90. package/types/deps/jsr.io/@std/semver/0.224.1/less_than.d.ts +24 -0
  91. package/types/deps/jsr.io/@std/semver/0.224.1/less_than.d.ts.map +1 -0
  92. package/types/deps/jsr.io/@std/semver/0.224.1/less_than_range.d.ts +22 -0
  93. package/types/deps/jsr.io/@std/semver/0.224.1/less_than_range.d.ts.map +1 -0
  94. package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/max_satisfying.d.ts +12 -0
  95. package/types/deps/jsr.io/@std/semver/0.224.1/max_satisfying.d.ts.map +1 -0
  96. package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/min_satisfying.d.ts +12 -0
  97. package/types/deps/jsr.io/@std/semver/0.224.1/min_satisfying.d.ts.map +1 -0
  98. package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/mod.d.ts +3 -2
  99. package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/mod.d.ts.map +1 -1
  100. package/types/deps/jsr.io/@std/semver/0.224.1/not_equals.d.ts +23 -0
  101. package/types/deps/jsr.io/@std/semver/0.224.1/not_equals.d.ts.map +1 -0
  102. package/types/deps/jsr.io/@std/semver/0.224.1/parse.d.ts +25 -0
  103. package/types/deps/jsr.io/@std/semver/0.224.1/parse.d.ts.map +1 -0
  104. package/types/deps/jsr.io/@std/semver/0.224.1/parse_range.d.ts +26 -0
  105. package/types/deps/jsr.io/@std/semver/0.224.1/parse_range.d.ts.map +1 -0
  106. package/types/deps/jsr.io/@std/semver/0.224.1/range_intersects.d.ts +24 -0
  107. package/types/deps/jsr.io/@std/semver/0.224.1/range_intersects.d.ts.map +1 -0
  108. package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/range_max.d.ts +16 -5
  109. package/types/deps/jsr.io/@std/semver/0.224.1/range_max.d.ts.map +1 -0
  110. package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/range_min.d.ts +16 -5
  111. package/types/deps/jsr.io/@std/semver/0.224.1/range_min.d.ts.map +1 -0
  112. package/types/deps/jsr.io/@std/semver/0.224.1/satisfies.d.ts +24 -0
  113. package/types/deps/jsr.io/@std/semver/0.224.1/satisfies.d.ts.map +1 -0
  114. package/types/deps/jsr.io/@std/semver/0.224.1/test_range.d.ts +27 -0
  115. package/types/deps/jsr.io/@std/semver/0.224.1/test_range.d.ts.map +1 -0
  116. package/types/deps/jsr.io/@std/semver/0.224.1/try_parse.d.ts +21 -0
  117. package/types/deps/jsr.io/@std/semver/0.224.1/try_parse.d.ts.map +1 -0
  118. package/types/deps/jsr.io/@std/semver/0.224.1/try_parse_range.d.ts +23 -0
  119. package/types/deps/jsr.io/@std/semver/0.224.1/try_parse_range.d.ts.map +1 -0
  120. package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/types.d.ts +7 -2
  121. package/types/deps/jsr.io/@std/semver/0.224.1/types.d.ts.map +1 -0
  122. package/types/deps/jsr.io/@std/text/{0.224.0 → 0.224.1}/_util.d.ts.map +1 -1
  123. package/types/deps/jsr.io/@std/text/{0.224.0 → 0.224.1}/case.d.ts.map +1 -1
  124. package/types/deps/jsr.io/@std/text/0.224.1/closest_string.d.ts.map +1 -0
  125. package/types/deps/jsr.io/@std/text/0.224.1/compare_similarity.d.ts.map +1 -0
  126. package/types/deps/jsr.io/@std/text/{0.224.0 → 0.224.1}/levenshtein_distance.d.ts.map +1 -1
  127. package/types/deps/jsr.io/@std/text/0.224.1/mod.d.ts.map +1 -0
  128. package/types/deps/jsr.io/@std/text/0.224.1/word_similarity_sort.d.ts.map +1 -0
  129. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_dumper/dumper.d.ts.map +1 -1
  130. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_dumper/dumper_state.d.ts.map +1 -1
  131. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_error.d.ts.map +1 -1
  132. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_loader/loader.d.ts.map +1 -1
  133. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_loader/loader_state.d.ts.map +1 -1
  134. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_mark.d.ts.map +1 -1
  135. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_state.d.ts.map +1 -1
  136. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/binary.d.ts.map +1 -1
  137. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/bool.d.ts.map +1 -1
  138. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/float.d.ts.map +1 -1
  139. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/function.d.ts.map +1 -1
  140. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/int.d.ts.map +1 -1
  141. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/map.d.ts.map +1 -1
  142. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/merge.d.ts.map +1 -1
  143. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/mod.d.ts.map +1 -1
  144. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/nil.d.ts.map +1 -1
  145. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/omap.d.ts.map +1 -1
  146. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/pairs.d.ts.map +1 -1
  147. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/regexp.d.ts.map +1 -1
  148. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/seq.d.ts.map +1 -1
  149. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/set.d.ts.map +1 -1
  150. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/str.d.ts.map +1 -1
  151. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/timestamp.d.ts.map +1 -1
  152. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/_type/undefined.d.ts.map +1 -1
  153. package/types/deps/jsr.io/@std/yaml/0.224.1/_utils.d.ts.map +1 -0
  154. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/mod.d.ts.map +1 -1
  155. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/parse.d.ts.map +1 -1
  156. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/schema/core.d.ts.map +1 -1
  157. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/schema/default.d.ts.map +1 -1
  158. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/schema/extended.d.ts.map +1 -1
  159. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/schema/failsafe.d.ts.map +1 -1
  160. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/schema/json.d.ts.map +1 -1
  161. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/schema/mod.d.ts.map +1 -1
  162. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/schema.d.ts.map +1 -1
  163. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/stringify.d.ts.map +1 -1
  164. package/types/deps/jsr.io/@std/yaml/{0.224.0 → 0.224.1}/type.d.ts.map +1 -1
  165. package/types/federation/middleware.d.ts.map +1 -1
  166. package/types/httpsig/mod.d.ts +45 -48
  167. package/types/httpsig/mod.d.ts.map +1 -1
  168. package/types/nodeinfo/types.d.ts +1 -1
  169. package/types/sig/http.d.ts +54 -0
  170. package/types/sig/http.d.ts.map +1 -0
  171. package/types/sig/http.test.d.ts.map +1 -0
  172. package/types/{httpsig → sig}/key.d.ts +0 -3
  173. package/types/sig/key.d.ts.map +1 -0
  174. package/types/sig/key.test.d.ts.map +1 -0
  175. package/types/sig/mod.d.ts +9 -0
  176. package/types/sig/mod.d.ts.map +1 -0
  177. package/types/sig/owner.d.ts +50 -0
  178. package/types/sig/owner.d.ts.map +1 -0
  179. package/types/sig/owner.test.d.ts.map +1 -0
  180. package/types/vocab/vocab.d.ts +143 -0
  181. package/types/vocab/vocab.d.ts.map +1 -1
  182. package/esm/deps/jsr.io/@std/semver/0.224.0/can_parse.js +0 -15
  183. package/esm/deps/jsr.io/@std/semver/0.224.0/difference.js +0 -16
  184. package/esm/deps/jsr.io/@std/semver/0.224.0/equals.js +0 -11
  185. package/esm/deps/jsr.io/@std/semver/0.224.0/greater_or_equal.js +0 -9
  186. package/esm/deps/jsr.io/@std/semver/0.224.0/greater_than.js +0 -11
  187. package/esm/deps/jsr.io/@std/semver/0.224.0/less_or_equal.js +0 -9
  188. package/esm/deps/jsr.io/@std/semver/0.224.0/less_than.js +0 -9
  189. package/esm/deps/jsr.io/@std/semver/0.224.0/not_equals.js +0 -9
  190. package/esm/deps/jsr.io/@std/semver/0.224.0/satisfies.js +0 -11
  191. package/esm/deps/jsr.io/@std/semver/0.224.0/test_range.js +0 -13
  192. package/esm/deps/jsr.io/@std/semver/0.224.0/try_parse.js +0 -17
  193. package/types/deps/jsr.io/@std/encoding/0.224.2/_util.d.ts.map +0 -1
  194. package/types/deps/jsr.io/@std/encoding/0.224.2/base64.d.ts.map +0 -1
  195. package/types/deps/jsr.io/@std/encoding/0.224.2/hex.d.ts +0 -24
  196. package/types/deps/jsr.io/@std/encoding/0.224.2/hex.d.ts.map +0 -1
  197. package/types/deps/jsr.io/@std/http/0.224.1/negotiation.d.ts.map +0 -1
  198. package/types/deps/jsr.io/@std/semver/0.224.0/_constants.d.ts.map +0 -1
  199. package/types/deps/jsr.io/@std/semver/0.224.0/can_parse.d.ts +0 -2
  200. package/types/deps/jsr.io/@std/semver/0.224.0/can_parse.d.ts.map +0 -1
  201. package/types/deps/jsr.io/@std/semver/0.224.0/compare.d.ts +0 -11
  202. package/types/deps/jsr.io/@std/semver/0.224.0/compare.d.ts.map +0 -1
  203. package/types/deps/jsr.io/@std/semver/0.224.0/difference.d.ts +0 -6
  204. package/types/deps/jsr.io/@std/semver/0.224.0/difference.d.ts.map +0 -1
  205. package/types/deps/jsr.io/@std/semver/0.224.0/equals.d.ts +0 -8
  206. package/types/deps/jsr.io/@std/semver/0.224.0/equals.d.ts.map +0 -1
  207. package/types/deps/jsr.io/@std/semver/0.224.0/format.d.ts.map +0 -1
  208. package/types/deps/jsr.io/@std/semver/0.224.0/format_range.d.ts +0 -9
  209. package/types/deps/jsr.io/@std/semver/0.224.0/format_range.d.ts.map +0 -1
  210. package/types/deps/jsr.io/@std/semver/0.224.0/greater_or_equal.d.ts +0 -8
  211. package/types/deps/jsr.io/@std/semver/0.224.0/greater_or_equal.d.ts.map +0 -1
  212. package/types/deps/jsr.io/@std/semver/0.224.0/greater_than.d.ts +0 -8
  213. package/types/deps/jsr.io/@std/semver/0.224.0/greater_than.d.ts.map +0 -1
  214. package/types/deps/jsr.io/@std/semver/0.224.0/greater_than_range.d.ts +0 -4
  215. package/types/deps/jsr.io/@std/semver/0.224.0/greater_than_range.d.ts.map +0 -1
  216. package/types/deps/jsr.io/@std/semver/0.224.0/increment.d.ts.map +0 -1
  217. package/types/deps/jsr.io/@std/semver/0.224.0/is_range.d.ts.map +0 -1
  218. package/types/deps/jsr.io/@std/semver/0.224.0/is_semver.d.ts.map +0 -1
  219. package/types/deps/jsr.io/@std/semver/0.224.0/less_or_equal.d.ts +0 -8
  220. package/types/deps/jsr.io/@std/semver/0.224.0/less_or_equal.d.ts.map +0 -1
  221. package/types/deps/jsr.io/@std/semver/0.224.0/less_than.d.ts +0 -8
  222. package/types/deps/jsr.io/@std/semver/0.224.0/less_than.d.ts.map +0 -1
  223. package/types/deps/jsr.io/@std/semver/0.224.0/less_than_range.d.ts +0 -4
  224. package/types/deps/jsr.io/@std/semver/0.224.0/less_than_range.d.ts.map +0 -1
  225. package/types/deps/jsr.io/@std/semver/0.224.0/max_satisfying.d.ts.map +0 -1
  226. package/types/deps/jsr.io/@std/semver/0.224.0/min_satisfying.d.ts.map +0 -1
  227. package/types/deps/jsr.io/@std/semver/0.224.0/not_equals.d.ts +0 -8
  228. package/types/deps/jsr.io/@std/semver/0.224.0/not_equals.d.ts.map +0 -1
  229. package/types/deps/jsr.io/@std/semver/0.224.0/parse.d.ts +0 -9
  230. package/types/deps/jsr.io/@std/semver/0.224.0/parse.d.ts.map +0 -1
  231. package/types/deps/jsr.io/@std/semver/0.224.0/parse_range.d.ts +0 -8
  232. package/types/deps/jsr.io/@std/semver/0.224.0/parse_range.d.ts.map +0 -1
  233. package/types/deps/jsr.io/@std/semver/0.224.0/range_intersects.d.ts +0 -9
  234. package/types/deps/jsr.io/@std/semver/0.224.0/range_intersects.d.ts.map +0 -1
  235. package/types/deps/jsr.io/@std/semver/0.224.0/range_max.d.ts.map +0 -1
  236. package/types/deps/jsr.io/@std/semver/0.224.0/range_min.d.ts.map +0 -1
  237. package/types/deps/jsr.io/@std/semver/0.224.0/satisfies.d.ts +0 -9
  238. package/types/deps/jsr.io/@std/semver/0.224.0/satisfies.d.ts.map +0 -1
  239. package/types/deps/jsr.io/@std/semver/0.224.0/test_range.d.ts +0 -12
  240. package/types/deps/jsr.io/@std/semver/0.224.0/test_range.d.ts.map +0 -1
  241. package/types/deps/jsr.io/@std/semver/0.224.0/try_parse.d.ts +0 -8
  242. package/types/deps/jsr.io/@std/semver/0.224.0/try_parse.d.ts.map +0 -1
  243. package/types/deps/jsr.io/@std/semver/0.224.0/try_parse_range.d.ts +0 -8
  244. package/types/deps/jsr.io/@std/semver/0.224.0/try_parse_range.d.ts.map +0 -1
  245. package/types/deps/jsr.io/@std/semver/0.224.0/types.d.ts.map +0 -1
  246. package/types/deps/jsr.io/@std/text/0.224.0/closest_string.d.ts.map +0 -1
  247. package/types/deps/jsr.io/@std/text/0.224.0/compare_similarity.d.ts.map +0 -1
  248. package/types/deps/jsr.io/@std/text/0.224.0/mod.d.ts.map +0 -1
  249. package/types/deps/jsr.io/@std/text/0.224.0/word_similarity_sort.d.ts.map +0 -1
  250. package/types/deps/jsr.io/@std/yaml/0.224.0/_utils.d.ts.map +0 -1
  251. package/types/httpsig/key.d.ts.map +0 -1
  252. package/types/httpsig/key.test.d.ts.map +0 -1
  253. /package/esm/deps/jsr.io/@std/encoding/{0.224.2/_util.js → 0.224.3/_validate_binary_like.js} +0 -0
  254. /package/esm/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/_negotiation/common.js +0 -0
  255. /package/esm/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/_negotiation/encoding.js +0 -0
  256. /package/esm/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/_negotiation/language.js +0 -0
  257. /package/esm/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/_negotiation/media_type.js +0 -0
  258. /package/esm/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/negotiation.js +0 -0
  259. /package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/_constants.js +0 -0
  260. /package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/_shared.js +0 -0
  261. /package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/_test_comparator_set.js +0 -0
  262. /package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/constants.js +0 -0
  263. /package/esm/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/types.js +0 -0
  264. /package/types/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/_negotiation/common.d.ts +0 -0
  265. /package/types/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/_negotiation/encoding.d.ts +0 -0
  266. /package/types/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/_negotiation/language.d.ts +0 -0
  267. /package/types/deps/jsr.io/@std/http/{0.224.1 → 0.224.2}/_negotiation/media_type.d.ts +0 -0
  268. /package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/_constants.d.ts +0 -0
  269. /package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/_shared.d.ts +0 -0
  270. /package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/_test_comparator_set.d.ts +0 -0
  271. /package/types/deps/jsr.io/@std/semver/{0.224.0 → 0.224.1}/constants.d.ts +0 -0
package/CHANGES.md CHANGED
@@ -8,6 +8,8 @@ Version 0.9.0
8
8
 
9
9
  To be released.
10
10
 
11
+ - Added `Tombstone` class to Activity Vocabulary API.
12
+
11
13
  - Added `Hashtag` class to Activity Vocabulary API. [[#48]]
12
14
 
13
15
  - Added `Emoji` class to Activity Vocabulary API. [[#48]]
@@ -45,11 +47,22 @@ To be released.
45
47
  - The signature of the `verify()` function is revamped; it now optionally
46
48
  takes a `VerifyOptions` object as the second parameter.
47
49
 
50
+ - Renamed the `@fedify/fedify/httpsig` module to `@fedify/fedify/sig`, and
51
+ also:
52
+
53
+ - Deprecated `sign()` function. Use `signRequest()` instead.
54
+ - Deprecated `verify()` function. Use `verifyRequest()` instead.
55
+ - Deprecated `VerifyOptions` interface. Use `VerifyRequestOptions`
56
+ instead.
57
+
48
58
  - Added more log messages using the [LogTape] library. Currently the below
49
59
  logger categories are used:
50
60
 
51
61
  - `["fedify", "federation", "actor"]`
52
62
  - `["fedify", "federation", "http"]`
63
+ - `["fedify", "sig", "http"]`
64
+ - `["fedify", "sig", "key"]`
65
+ - `["fedify", "sig", "owner"]`
53
66
 
54
67
  [#48]: https://github.com/dahlia/fedify/issues/48
55
68
  [#52]: https://github.com/dahlia/fedify/issues/52
@@ -12,15 +12,17 @@
12
12
  * encodeBase64,
13
13
  * decodeBase64,
14
14
  * } from "@std/encoding/base64";
15
+ * import { assertEquals } from "@std/assert/assert-equals";
15
16
  *
16
- * const encoded = encodeBase64("foobar"); // "Zm9vYmFy"
17
+ * const foobar = new TextEncoder().encode("foobar");
17
18
  *
18
- * decodeBase64(encoded); // Uint8Array(6) [ 102, 111, 111, 98, 97, 114 ]
19
+ * assertEquals(encodeBase64(foobar), "Zm9vYmFy");
20
+ * assertEquals(decodeBase64("Zm9vYmFy"), foobar);
19
21
  * ```
20
22
  *
21
23
  * @module
22
24
  */
23
- import { validateBinaryLike } from "./_util.js";
25
+ import { validateBinaryLike } from "./_validate_binary_like.js";
24
26
  const base64abc = [
25
27
  "A",
26
28
  "B",
@@ -95,11 +97,12 @@ const base64abc = [
95
97
  * @param data The data to encode.
96
98
  * @returns The base64-encoded string.
97
99
  *
98
- * @example
100
+ * @example Usage
99
101
  * ```ts
100
102
  * import { encodeBase64 } from "@std/encoding/base64";
103
+ * import { assertEquals } from "@std/assert/assert-equals";
101
104
  *
102
- * encodeBase64("foobar"); // "Zm9vYmFy"
105
+ * assertEquals(encodeBase64("foobar"), "Zm9vYmFy");
103
106
  * ```
104
107
  */
105
108
  export function encodeBase64(data) {
@@ -140,11 +143,15 @@ export function encodeBase64(data) {
140
143
  * @param b64 The base64-encoded string to decode.
141
144
  * @returns The decoded data.
142
145
  *
143
- * @example
146
+ * @example Usage
144
147
  * ```ts
145
148
  * import { decodeBase64 } from "@std/encoding/base64";
149
+ * import { assertEquals } from "@std/assert/assert-equals";
146
150
  *
147
- * decodeBase64("Zm9vYmFy"); // Uint8Array(6) [ 102, 111, 111, 98, 97, 114 ]
151
+ * assertEquals(
152
+ * decodeBase64("Zm9vYmFy"),
153
+ * new TextEncoder().encode("foobar")
154
+ * );
148
155
  * ```
149
156
  */
150
157
  export function decodeBase64(b64) {
@@ -14,15 +14,19 @@
14
14
  * decodeHex,
15
15
  * encodeHex,
16
16
  * } from "@std/encoding/hex";
17
+ * import { assertEquals } from "@std/assert/assert-equals";
17
18
  *
18
- * const encoded = encodeHex("abc"); // "616263"
19
+ * assertEquals(encodeHex("abc"), "616263");
19
20
  *
20
- * decodeHex(encoded); // Uint8Array(3) [ 97, 98, 99 ]
21
+ * assertEquals(
22
+ * decodeHex("616263"),
23
+ * new TextEncoder().encode("abc"),
24
+ * );
21
25
  * ```
22
26
  *
23
27
  * @module
24
28
  */
25
- import { validateBinaryLike } from "./_util.js";
29
+ import { validateBinaryLike } from "./_validate_binary_like.js";
26
30
  const hexTable = new TextEncoder().encode("0123456789abcdef");
27
31
  const textEncoder = new TextEncoder();
28
32
  const textDecoder = new TextDecoder();
@@ -48,11 +52,16 @@ function fromHexChar(byte) {
48
52
  /**
49
53
  * Converts data into a hex-encoded string.
50
54
  *
51
- * @example
55
+ * @param src The data to encode.
56
+ *
57
+ * @returns The hex-encoded string.
58
+ *
59
+ * @example Usage
52
60
  * ```ts
53
61
  * import { encodeHex } from "@std/encoding/hex";
62
+ * import { assertEquals } from "@std/assert/assert-equals";
54
63
  *
55
- * encodeHex("abc"); // "616263"
64
+ * assertEquals(encodeHex("abc"), "616263");
56
65
  * ```
57
66
  */
58
67
  export function encodeHex(src) {
@@ -69,11 +78,19 @@ export function encodeHex(src) {
69
78
  * Decodes the given hex-encoded string. If the input is malformed, an error is
70
79
  * thrown.
71
80
  *
72
- * @example
81
+ * @param src The hex-encoded string to decode.
82
+ *
83
+ * @returns The decoded data.
84
+ *
85
+ * @example Usage
73
86
  * ```ts
74
87
  * import { decodeHex } from "@std/encoding/hex";
88
+ * import { assertEquals } from "@std/assert/assert-equals";
75
89
  *
76
- * decodeHex("616263"); // Uint8Array(3) [ 97, 98, 99 ]
90
+ * assertEquals(
91
+ * decodeHex("616263"),
92
+ * new TextEncoder().encode("abc"),
93
+ * );
77
94
  * ```
78
95
  */
79
96
  export function decodeHex(src) {
@@ -0,0 +1,30 @@
1
+ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ import { parse } from "./parse.js";
4
+ /**
5
+ * Returns true if the string can be parsed as SemVer.
6
+ *
7
+ * @example Usage
8
+ * ```ts
9
+ * import { canParse } from "@std/semver/can-parse";
10
+ * import { assert, assertFalse } from "@std/assert";
11
+ *
12
+ * assert(canParse("1.2.3"));
13
+ * assertFalse(canParse("invalid"));
14
+ * ```
15
+ *
16
+ * @param version The version string to check
17
+ * @returns `true` if the string can be parsed as SemVer, `false` otherwise
18
+ */
19
+ export function canParse(version) {
20
+ try {
21
+ parse(version);
22
+ return true;
23
+ }
24
+ catch (err) {
25
+ if (!(err instanceof TypeError)) {
26
+ throw err;
27
+ }
28
+ return false;
29
+ }
30
+ }
@@ -6,6 +6,23 @@ import { checkIdentifier, compareIdentifier, compareNumber, } from "./_shared.js
6
6
  * greater.
7
7
  *
8
8
  * Sorts in ascending order if passed to `Array.sort()`,
9
+ *
10
+ * @example Usage
11
+ * ```ts
12
+ * import { parse, compare } from "@std/semver";
13
+ * import { assertEquals } from "@std/assert/assert-equals";
14
+ *
15
+ * const s0 = parse("1.2.3");
16
+ * const s1 = parse("1.2.4");
17
+ *
18
+ * assertEquals(compare(s0, s1), -1);
19
+ * assertEquals(compare(s1, s0), 1);
20
+ * assertEquals(compare(s0, s0), 0);
21
+ * ```
22
+ *
23
+ * @param s0 The first SemVer to compare
24
+ * @param s1 The second SemVer to compare
25
+ * @returns `1` if `s0` is greater, `0` if equal, or `-1` if `s1` is greater
9
26
  */
10
27
  export function compare(s0, s1) {
11
28
  if (s0 === s1)
@@ -0,0 +1,37 @@
1
+ import { compareIdentifier } from "./_shared.js";
2
+ /**
3
+ * Returns difference between two versions by the release type,
4
+ * or `undefined` if the versions are the same.
5
+ *
6
+ * @example Usage
7
+ * ```ts
8
+ * import { parse, difference } from "@std/semver";
9
+ * import { assertEquals } from "@std/assert/assert-equals";
10
+ *
11
+ * const s0 = parse("1.2.3");
12
+ * const s1 = parse("1.2.4");
13
+ * const s2 = parse("1.3.0");
14
+ * const s3 = parse("2.0.0");
15
+ *
16
+ * assertEquals(difference(s0, s1), "patch");
17
+ * assertEquals(difference(s0, s2), "minor");
18
+ * assertEquals(difference(s0, s3), "major");
19
+ * assertEquals(difference(s0, s0), undefined);
20
+ * ```
21
+ *
22
+ * @param s0 The first SemVer to compare
23
+ * @param s1 The second SemVer to compare
24
+ * @returns The release type difference or `undefined` if the versions are the same
25
+ */
26
+ export function difference(s0, s1) {
27
+ const hasPrerelease = s0.prerelease?.length || s1.prerelease?.length;
28
+ if (s0.major !== s1.major)
29
+ return hasPrerelease ? "premajor" : "major";
30
+ if (s0.minor !== s1.minor)
31
+ return hasPrerelease ? "preminor" : "minor";
32
+ if (s0.patch !== s1.patch)
33
+ return hasPrerelease ? "prepatch" : "patch";
34
+ if (compareIdentifier(s0.prerelease, s1.prerelease) !== 0) {
35
+ return "prerelease";
36
+ }
37
+ }
@@ -0,0 +1,27 @@
1
+ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ import { compare } from "./compare.js";
4
+ /**
5
+ * Returns `true` if both semantic versions are logically equivalent, even if they're not the exact same version object.
6
+ *
7
+ * This is equal to `compare(s0, s1) === 0`.
8
+ *
9
+ * @example Usage
10
+ * ```ts
11
+ * import { parse, equals } from "@std/semver";
12
+ * import { assert, assertFalse } from "@std/assert";
13
+ *
14
+ * const s0 = parse("1.2.3");
15
+ * const s1 = parse("1.2.3");
16
+ *
17
+ * assert(equals(s0, s1));
18
+ * assertFalse(equals(s0, parse("1.2.4")));
19
+ * ```
20
+ *
21
+ * @param s0 The first SemVer to compare
22
+ * @param s1 The second SemVer to compare
23
+ * @returns `true` if `s0` is equal to `s1`, `false` otherwise
24
+ */
25
+ export function equals(s0, s1) {
26
+ return compare(s0, s1) === 0;
27
+ }
@@ -17,7 +17,20 @@ function formatNumber(value) {
17
17
  *
18
18
  * If any number is positive or negative infinity then '∞' or '⧞' will be printed instead.
19
19
  *
20
- * @param semver The semantic version to format
20
+ * @example Usage
21
+ * ```ts
22
+ * import { format } from "@std/semver/format";
23
+ * import { assertEquals } from "@std/assert/assert-equals";
24
+ *
25
+ * const semver = {
26
+ * major: 1,
27
+ * minor: 2,
28
+ * patch: 3,
29
+ * };
30
+ * assertEquals(format(semver), "1.2.3");
31
+ * ```
32
+ *
33
+ * @param semver The SemVer to format
21
34
  * @returns The string representation of a semantic version.
22
35
  */
23
36
  export function format(semver) {
@@ -7,7 +7,15 @@ function formatComparator(comparator) {
7
7
  }
8
8
  /**
9
9
  * Formats the range into a string
10
- * @example >=0.0.0 || <1.0.0
10
+ * @example Usage
11
+ * ```ts
12
+ * import { formatRange, parseRange } from "@std/semver";
13
+ * import { assertEquals } from "@std/assert";
14
+ *
15
+ * const range = parseRange(">=1.2.3 <1.2.4");
16
+ * assertEquals(formatRange(range), ">=1.2.3 <1.2.4");
17
+ * ```
18
+ *
11
19
  * @param range The range to format
12
20
  * @returns A string representation of the range
13
21
  */
@@ -0,0 +1,25 @@
1
+ import { compare } from "./compare.js";
2
+ /**
3
+ * Greater than or equal to comparison
4
+ *
5
+ * This is equal to `compare(s0, s1) >= 0`.
6
+ *
7
+ * @example Usage
8
+ * ```ts
9
+ * import { parse, greaterOrEqual } from "@std/semver";
10
+ * import { assert, assertFalse } from "@std/assert";
11
+ *
12
+ * const s0 = parse("1.2.3");
13
+ * const s1 = parse("1.2.4");
14
+ * assert(greaterOrEqual(s1, s0));
15
+ * assertFalse(greaterOrEqual(s0, s1));
16
+ * assert(greaterOrEqual(s0, s0));
17
+ * ```
18
+ *
19
+ * @param s0 The first version to compare
20
+ * @param s1 The second version to compare
21
+ * @returns `true` if `s0` is greater than or equal to `s1`, `false` otherwise
22
+ */
23
+ export function greaterOrEqual(s0, s1) {
24
+ return compare(s0, s1) >= 0;
25
+ }
@@ -0,0 +1,27 @@
1
+ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
+ // This module is browser compatible.
3
+ import { compare } from "./compare.js";
4
+ /**
5
+ * Greater than comparison
6
+ *
7
+ * This is equal to `compare(s0, s1) > 0`.
8
+ *
9
+ * @example Usage
10
+ * ```ts
11
+ * import { parse, greaterThan } from "@std/semver";
12
+ * import { assert, assertFalse } from "@std/assert";
13
+ *
14
+ * const s0 = parse("1.2.3");
15
+ * const s1 = parse("1.2.4");
16
+ * assert(greaterThan(s1, s0));
17
+ * assertFalse(greaterThan(s0, s1));
18
+ * assertFalse(greaterThan(s0, s0));
19
+ * ```
20
+ *
21
+ * @param s0 The first version to compare
22
+ * @param s1 The second version to compare
23
+ * @returns `true` if `s0` is greater than `s1`, `false` otherwise
24
+ */
25
+ export function greaterThan(s0, s1) {
26
+ return compare(s0, s1) > 0;
27
+ }
@@ -3,7 +3,25 @@
3
3
  import { testComparatorSet } from "./_test_comparator_set.js";
4
4
  import { isWildcardComparator } from "./_shared.js";
5
5
  import { compare } from "./compare.js";
6
- /** Check if the semver is greater than the range. */
6
+ /**
7
+ * Check if the SemVer is greater than the range.
8
+ *
9
+ * @example Usage
10
+ * ```ts
11
+ * import { parse, parseRange, greaterThanRange } from "@std/semver";
12
+ * import { assert, assertFalse } from "@std/assert";
13
+ *
14
+ * const v0 = parse("1.2.3");
15
+ * const v1 = parse("1.2.4");
16
+ * const range = parseRange(">=1.2.3 <1.2.4");
17
+ * assertFalse(greaterThanRange(v0, range));
18
+ * assert(greaterThanRange(v1, range));
19
+ * ```
20
+ *
21
+ * @param semver The version to check.
22
+ * @param range The range to check against.
23
+ * @returns `true` if the semver is greater than the range, `false` otherwise.
24
+ */
7
25
  export function greaterThanRange(semver, range) {
8
26
  return range.every((comparatorSet) => greaterThanComparatorSet(semver, comparatorSet));
9
27
  }
@@ -48,11 +48,27 @@ function bumpPrerelease(prerelease = [], identifier) {
48
48
  * If the input version has build metadata it will be preserved on the resulting version
49
49
  * unless a new build parameter is specified. Specifying `""` will unset existing build
50
50
  * metadata.
51
+ *
52
+ * @example Usage
53
+ * ```ts
54
+ * import { increment, parse } from "@std/semver";
55
+ * import { assertEquals } from "@std/assert/assert-equals";
56
+ *
57
+ * const version = parse("1.2.3");
58
+ * assertEquals(increment(version, "major"), parse("2.0.0"));
59
+ * assertEquals(increment(version, "minor"), parse("1.3.0"));
60
+ * assertEquals(increment(version, "patch"), parse("1.2.4"));
61
+ * assertEquals(increment(version, "prerelease"), parse("1.2.4-0"));
62
+ *
63
+ * const prerelease = parse("1.2.3-beta.0");
64
+ * assertEquals(increment(prerelease, "prerelease"), parse("1.2.3-beta.1"));
65
+ * ```
66
+ *
51
67
  * @param version The version to increment
52
68
  * @param release The type of increment to perform
53
69
  * @param prerelease The pre-release metadata of the new version
54
- * @param build The build metadata of the new version
55
- * @returns
70
+ * @param buildmetadata The build metadata of the new version
71
+ * @returns The new version
56
72
  */
57
73
  export function increment(version, release, prerelease, buildmetadata) {
58
74
  const build = buildmetadata !== undefined
@@ -19,6 +19,16 @@ function isComparator(value) {
19
19
  * least the correct fields.
20
20
  *
21
21
  * Adds a type assertion if true.
22
+ *
23
+ * @example Usage
24
+ * ```ts
25
+ * import { isRange } from "@std/semver/is-range";
26
+ * import { assert, assertFalse } from "@std/assert";
27
+ *
28
+ * const range = [[{ major: 1, minor: 2, patch: 3 }]];
29
+ * assert(isRange(range));
30
+ * assertFalse(isRange({}));
31
+ * ```
22
32
  * @param value The value to check if its a valid Range
23
33
  * @returns True if its a valid Range otherwise false.
24
34
  */
@@ -14,6 +14,22 @@ import { isValidNumber, isValidString } from "./_shared.js";
14
14
  * considered SemVer objects and this will return true.
15
15
  *
16
16
  * A type assertion is added to the value.
17
+ *
18
+ * @example Usage
19
+ * ```ts
20
+ * import { isSemVer } from "@std/semver/is-semver";
21
+ * import { assert, assertFalse } from "@std/assert";
22
+ *
23
+ * const value = {
24
+ * major: 1,
25
+ * minor: 2,
26
+ * patch: 3,
27
+ * };
28
+ *
29
+ * assert(isSemVer(value));
30
+ * assertFalse(isSemVer({ major: 1, minor: 2 }));
31
+ * ```
32
+ *
17
33
  * @param value The value to check to see if its a valid SemVer object
18
34
  * @returns True if value is a valid SemVer otherwise false
19
35
  */
@@ -0,0 +1,25 @@
1
+ import { compare } from "./compare.js";
2
+ /**
3
+ * Less than or equal to comparison
4
+ *
5
+ * This is equal to `compare(s0, s1) <= 0`.
6
+ *
7
+ * @example Usage
8
+ * ```ts
9
+ * import { parse, lessOrEqual } from "@std/semver";
10
+ * import { assert, assertFalse } from "@std/assert";
11
+ *
12
+ * const s0 = parse("1.2.3");
13
+ * const s1 = parse("1.2.4");
14
+ * assert(lessOrEqual(s0, s1));
15
+ * assertFalse(lessOrEqual(s1, s0));
16
+ * assert(lessOrEqual(s0, s0));
17
+ * ```
18
+ *
19
+ * @param s0 the first version to compare
20
+ * @param s1 the second version to compare
21
+ * @returns `true` if `s0` is less than or equal to `s1`, `false` otherwise
22
+ */
23
+ export function lessOrEqual(s0, s1) {
24
+ return compare(s0, s1) <= 0;
25
+ }
@@ -0,0 +1,25 @@
1
+ import { compare } from "./compare.js";
2
+ /**
3
+ * Less than comparison
4
+ *
5
+ * This is equal to `compare(s0, s1) < 0`.
6
+ *
7
+ * @example Usage
8
+ * ```ts
9
+ * import { parse, lessThan } from "@std/semver";
10
+ * import { assert, assertFalse } from "@std/assert";
11
+ *
12
+ * const s0 = parse("1.2.3");
13
+ * const s1 = parse("1.2.4");
14
+ * assert(lessThan(s0, s1));
15
+ * assertFalse(lessThan(s1, s0));
16
+ * assertFalse(lessThan(s0, s0));
17
+ * ```
18
+ *
19
+ * @param s0 the first version to compare
20
+ * @param s1 the second version to compare
21
+ * @returns `true` if `s0` is less than `s1`, `false` otherwise
22
+ */
23
+ export function lessThan(s0, s1) {
24
+ return compare(s0, s1) < 0;
25
+ }
@@ -3,7 +3,25 @@
3
3
  import { testComparatorSet } from "./_test_comparator_set.js";
4
4
  import { isWildcardComparator } from "./_shared.js";
5
5
  import { compare } from "./compare.js";
6
- /** Check if the semver is less than the range. */
6
+ /**
7
+ * Check if the SemVer is less than the range.
8
+ *
9
+ * @example Usage
10
+ * ```ts
11
+ * import { parse, parseRange, lessThanRange } from "@std/semver";
12
+ * import { assert, assertFalse } from "@std/assert";
13
+ *
14
+ * const v0 = parse("1.2.3");
15
+ * const v1 = parse("1.0.0");
16
+ * const range = parseRange(">=1.2.3 <1.2.4");
17
+ * assertFalse(lessThanRange(v0, range));
18
+ * assert(lessThanRange(v1, range));
19
+ * ```
20
+ *
21
+ * @param semver The version to check.
22
+ * @param range The range to check against.
23
+ * @returns `true` if the SemVer is less than the range, `false` otherwise.
24
+ */
7
25
  export function lessThanRange(semver, range) {
8
26
  return range.every((comparatorSet) => lessThanComparatorSet(semver, comparatorSet));
9
27
  }
@@ -11,10 +29,10 @@ function lessThanComparatorSet(semver, comparatorSet) {
11
29
  // If the comparator set contains wildcard, then the semver is not greater than the range.
12
30
  if (comparatorSet.some(isWildcardComparator))
13
31
  return false;
14
- // If the semver satisfies the comparator set, then it's not less than the range.
32
+ // If the SemVer satisfies the comparator set, then it's not less than the range.
15
33
  if (testComparatorSet(semver, comparatorSet))
16
34
  return false;
17
- // If the semver is greater than any of the comparator set, then it's not less than the range.
35
+ // If the SemVer is greater than any of the comparator set, then it's not less than the range.
18
36
  if (comparatorSet.some((comparator) => greaterThanComparator(semver, comparator)))
19
37
  return false;
20
38
  return true;
@@ -3,6 +3,18 @@ import { greaterThan } from "./greater_than.js";
3
3
  /**
4
4
  * Returns the highest version in the list that satisfies the range, or `undefined`
5
5
  * if none of them do.
6
+ *
7
+ * @example Usage
8
+ * ```ts
9
+ * import { parse, parseRange, maxSatisfying } from "@std/semver";
10
+ * import { assertEquals } from "@std/assert/assert-equals";
11
+ *
12
+ * const versions = ["1.2.3", "1.2.4", "1.3.0", "2.0.0", "2.1.0"].map(parse);
13
+ * const range = parseRange(">=1.0.0 <2.0.0");
14
+ *
15
+ * assertEquals(maxSatisfying(versions, range), parse("1.3.0"));
16
+ * ```
17
+ *
6
18
  * @param versions The versions to check.
7
19
  * @param range The range of possible versions to compare to.
8
20
  * @returns The highest version in versions that satisfies the range.
@@ -3,6 +3,18 @@ import { lessThan } from "./less_than.js";
3
3
  /**
4
4
  * Returns the lowest version in the list that satisfies the range, or `undefined` if
5
5
  * none of them do.
6
+ *
7
+ * @example Usage
8
+ * ```ts
9
+ * import { parse, parseRange, minSatisfying } from "@std/semver";
10
+ * import { assertEquals } from "@std/assert/assert-equals";
11
+ *
12
+ * const versions = ["0.2.0", "1.2.3", "1.3.0", "2.0.0", "2.1.0"].map(parse);
13
+ * const range = parseRange(">=1.0.0 <2.0.0");
14
+ *
15
+ * assertEquals(minSatisfying(versions, range), parse("1.2.3"));
16
+ * ```
17
+ *
6
18
  * @param versions The versions to check.
7
19
  * @param range The range of possible versions to compare to.
8
20
  * @returns The lowest version in versions that satisfies the range.
@@ -104,8 +104,8 @@
104
104
  *
105
105
  * Build metadata is `.` delimited alpha-numeric string.
106
106
  * When parsing a version it is retained on the `build: string[]` field
107
- * of the semver instance. When incrementing there is an additional parameter that
108
- * can set the build metadata on the semver instance.
107
+ * of the SemVer instance. When incrementing there is an additional parameter that
108
+ * can set the build metadata on the SemVer instance.
109
109
  *
110
110
  * ### Advanced Range Syntax
111
111
  *
@@ -293,4 +293,5 @@ export * from "./greater_or_equal.js";
293
293
  export * from "./less_than.js";
294
294
  export * from "./less_than_range.js";
295
295
  export * from "./less_or_equal.js";
296
+ /** The SemVer spec version */
296
297
  export const SEMVER_SPEC_VERSION = "2.0.0";
@@ -0,0 +1,24 @@
1
+ import { compare } from "./compare.js";
2
+ /**
3
+ * Not equal comparison
4
+ *
5
+ * This is equal to `compare(s0, s1) !== 0`.
6
+ *
7
+ * @example Usage
8
+ * ```ts
9
+ * import { parse, notEquals } from "@std/semver";
10
+ * import { assert, assertFalse } from "@std/assert";
11
+ *
12
+ * const s0 = parse("1.2.3");
13
+ * const s1 = parse("1.2.4");
14
+ * assert(notEquals(s0, s1));
15
+ * assertFalse(notEquals(s0, s0));
16
+ * ```
17
+ *
18
+ * @param s0 The first version to compare
19
+ * @param s1 The second version to compare
20
+ * @returns `true` if `s0` is not equal to `s1`, `false` otherwise
21
+ */
22
+ export function notEquals(s0, s1) {
23
+ return compare(s0, s1) !== 0;
24
+ }
@@ -3,6 +3,22 @@ import { FULL_REGEXP, MAX_LENGTH } from "./_shared.js";
3
3
  /**
4
4
  * Attempt to parse a string as a semantic version, returning either a `SemVer`
5
5
  * object or throws a TypeError.
6
+ *
7
+ * @example Usage
8
+ * ```ts
9
+ * import { parse } from "@std/semver/parse";
10
+ * import { assertEquals } from "@std/assert/assert-equals";
11
+ *
12
+ * const version = parse("1.2.3");
13
+ * assertEquals(version, {
14
+ * major: 1,
15
+ * minor: 2,
16
+ * patch: 3,
17
+ * prerelease: [],
18
+ * build: [],
19
+ * });
20
+ * ```
21
+ *
6
22
  * @param version The version string to parse
7
23
  * @returns A valid SemVer
8
24
  */