@fedify/fedify 1.0.0-dev.410 → 1.0.0-dev.411

Sign up to get free protection for your applications and to get access to all the features.
Files changed (195) hide show
  1. package/CHANGES.md +12 -0
  2. package/esm/deps/jsr.io/@std/encoding/{0.224.3 → 1.0.5}/_validate_binary_like.js +1 -1
  3. package/esm/deps/jsr.io/@std/encoding/{0.224.3 → 1.0.5}/base64.js +3 -5
  4. package/esm/deps/jsr.io/@std/encoding/{0.224.3 → 1.0.5}/base64url.js +3 -5
  5. package/esm/deps/jsr.io/@std/encoding/{0.224.3 → 1.0.5}/hex.js +7 -9
  6. package/esm/deps/jsr.io/@std/http/{0.224.5 → 1.0.6}/_negotiation/encoding.js +3 -1
  7. package/esm/deps/jsr.io/@std/http/{0.224.5 → 1.0.6}/_negotiation/language.js +2 -2
  8. package/esm/deps/jsr.io/@std/http/{0.224.5 → 1.0.6}/_negotiation/media_type.js +7 -7
  9. package/esm/deps/jsr.io/@std/semver/1.0.3/_constants.js +38 -0
  10. package/esm/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/_shared.js +3 -2
  11. package/esm/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/can_parse.js +4 -7
  12. package/esm/deps/jsr.io/@std/semver/1.0.3/compare.js +35 -0
  13. package/esm/deps/jsr.io/@std/semver/1.0.3/difference.js +41 -0
  14. package/esm/deps/jsr.io/@std/semver/1.0.3/equals.js +27 -0
  15. package/esm/deps/jsr.io/@std/semver/1.0.3/format.js +32 -0
  16. package/esm/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/format_range.js +5 -3
  17. package/esm/deps/jsr.io/@std/semver/1.0.3/greater_or_equal.js +26 -0
  18. package/esm/deps/jsr.io/@std/semver/1.0.3/greater_than.js +28 -0
  19. package/esm/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/greater_than_range.js +14 -13
  20. package/esm/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/increment.js +13 -14
  21. package/esm/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/is_range.js +4 -4
  22. package/esm/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/is_semver.js +3 -5
  23. package/esm/deps/jsr.io/@std/semver/1.0.3/less_or_equal.js +26 -0
  24. package/esm/deps/jsr.io/@std/semver/1.0.3/less_than.js +26 -0
  25. package/esm/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/less_than_range.js +14 -13
  26. package/esm/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/max_satisfying.js +2 -2
  27. package/esm/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/min_satisfying.js +2 -2
  28. package/esm/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/mod.js +25 -33
  29. package/esm/deps/jsr.io/@std/semver/1.0.3/not_equals.js +25 -0
  30. package/esm/deps/jsr.io/@std/semver/1.0.3/parse.js +44 -0
  31. package/esm/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/parse_range.js +18 -13
  32. package/esm/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/range_intersects.js +29 -28
  33. package/esm/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/satisfies.js +3 -3
  34. package/esm/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/try_parse.js +5 -8
  35. package/esm/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/try_parse_range.js +3 -3
  36. package/esm/federation/collection.js +1 -1
  37. package/esm/federation/handler.js +1 -1
  38. package/esm/nodeinfo/types.js +1 -1
  39. package/esm/runtime/key.js +3 -3
  40. package/esm/sig/http.js +1 -1
  41. package/esm/sig/ld.js +2 -2
  42. package/package.json +4 -4
  43. package/types/deps/jsr.io/@std/encoding/1.0.5/_validate_binary_like.d.ts.map +1 -0
  44. package/types/deps/jsr.io/@std/encoding/{0.224.3 → 1.0.5}/base64.d.ts +2 -2
  45. package/types/deps/jsr.io/@std/encoding/1.0.5/base64.d.ts.map +1 -0
  46. package/types/deps/jsr.io/@std/encoding/{0.224.3 → 1.0.5}/base64url.d.ts +2 -2
  47. package/types/deps/jsr.io/@std/encoding/1.0.5/base64url.d.ts.map +1 -0
  48. package/types/deps/jsr.io/@std/encoding/{0.224.3 → 1.0.5}/hex.d.ts +2 -2
  49. package/types/deps/jsr.io/@std/encoding/1.0.5/hex.d.ts.map +1 -0
  50. package/types/deps/jsr.io/@std/http/{0.224.5 → 1.0.6}/_negotiation/common.d.ts +2 -2
  51. package/types/deps/jsr.io/@std/http/1.0.6/_negotiation/common.d.ts.map +1 -0
  52. package/types/deps/jsr.io/@std/http/1.0.6/_negotiation/encoding.d.ts.map +1 -0
  53. package/types/deps/jsr.io/@std/http/1.0.6/_negotiation/language.d.ts.map +1 -0
  54. package/types/deps/jsr.io/@std/http/1.0.6/_negotiation/media_type.d.ts.map +1 -0
  55. package/types/deps/jsr.io/@std/http/{0.224.5 → 1.0.6}/negotiation.d.ts +13 -18
  56. package/types/deps/jsr.io/@std/http/1.0.6/negotiation.d.ts.map +1 -0
  57. package/types/deps/jsr.io/@std/semver/1.0.3/_constants.d.ts +16 -0
  58. package/types/deps/jsr.io/@std/semver/1.0.3/_constants.d.ts.map +1 -0
  59. package/types/deps/jsr.io/@std/semver/1.0.3/_shared.d.ts.map +1 -0
  60. package/types/deps/jsr.io/@std/semver/1.0.3/_test_comparator_set.d.ts.map +1 -0
  61. package/types/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/can_parse.d.ts +2 -2
  62. package/types/deps/jsr.io/@std/semver/1.0.3/can_parse.d.ts.map +1 -0
  63. package/types/deps/jsr.io/@std/semver/1.0.3/compare.d.ts +28 -0
  64. package/types/deps/jsr.io/@std/semver/1.0.3/compare.d.ts.map +1 -0
  65. package/types/deps/jsr.io/@std/semver/1.0.3/difference.d.ts +27 -0
  66. package/types/deps/jsr.io/@std/semver/1.0.3/difference.d.ts.map +1 -0
  67. package/types/deps/jsr.io/@std/semver/1.0.3/equals.d.ts +24 -0
  68. package/types/deps/jsr.io/@std/semver/1.0.3/equals.d.ts.map +1 -0
  69. package/types/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/format.d.ts +3 -7
  70. package/types/deps/jsr.io/@std/semver/1.0.3/format.d.ts.map +1 -0
  71. package/types/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/format_range.d.ts +3 -2
  72. package/types/deps/jsr.io/@std/semver/1.0.3/format_range.d.ts.map +1 -0
  73. package/types/deps/jsr.io/@std/semver/1.0.3/greater_or_equal.d.ts +25 -0
  74. package/types/deps/jsr.io/@std/semver/1.0.3/greater_or_equal.d.ts.map +1 -0
  75. package/types/deps/jsr.io/@std/semver/1.0.3/greater_than.d.ts +25 -0
  76. package/types/deps/jsr.io/@std/semver/1.0.3/greater_than.d.ts.map +1 -0
  77. package/types/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/greater_than_range.d.ts +8 -7
  78. package/types/deps/jsr.io/@std/semver/1.0.3/greater_than_range.d.ts.map +1 -0
  79. package/types/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/increment.d.ts +11 -5
  80. package/types/deps/jsr.io/@std/semver/1.0.3/increment.d.ts.map +1 -0
  81. package/types/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/is_range.d.ts +2 -2
  82. package/types/deps/jsr.io/@std/semver/1.0.3/is_range.d.ts.map +1 -0
  83. package/types/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/is_semver.d.ts +2 -2
  84. package/types/deps/jsr.io/@std/semver/1.0.3/is_semver.d.ts.map +1 -0
  85. package/types/deps/jsr.io/@std/semver/1.0.3/less_or_equal.d.ts +25 -0
  86. package/types/deps/jsr.io/@std/semver/1.0.3/less_or_equal.d.ts.map +1 -0
  87. package/types/deps/jsr.io/@std/semver/1.0.3/less_than.d.ts +25 -0
  88. package/types/deps/jsr.io/@std/semver/1.0.3/less_than.d.ts.map +1 -0
  89. package/types/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/less_than_range.d.ts +8 -7
  90. package/types/deps/jsr.io/@std/semver/1.0.3/less_than_range.d.ts.map +1 -0
  91. package/types/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/max_satisfying.d.ts +2 -2
  92. package/types/deps/jsr.io/@std/semver/1.0.3/max_satisfying.d.ts.map +1 -0
  93. package/types/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/min_satisfying.d.ts +2 -2
  94. package/types/deps/jsr.io/@std/semver/1.0.3/min_satisfying.d.ts.map +1 -0
  95. package/types/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/mod.d.ts +25 -33
  96. package/types/deps/jsr.io/@std/semver/1.0.3/mod.d.ts.map +1 -0
  97. package/types/deps/jsr.io/@std/semver/1.0.3/not_equals.d.ts +24 -0
  98. package/types/deps/jsr.io/@std/semver/1.0.3/not_equals.d.ts.map +1 -0
  99. package/types/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/parse.d.ts +5 -5
  100. package/types/deps/jsr.io/@std/semver/1.0.3/parse.d.ts.map +1 -0
  101. package/types/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/parse_range.d.ts +6 -5
  102. package/types/deps/jsr.io/@std/semver/1.0.3/parse_range.d.ts.map +1 -0
  103. package/types/deps/jsr.io/@std/semver/1.0.3/range_intersects.d.ts +25 -0
  104. package/types/deps/jsr.io/@std/semver/1.0.3/range_intersects.d.ts.map +1 -0
  105. package/types/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/satisfies.d.ts +3 -3
  106. package/types/deps/jsr.io/@std/semver/1.0.3/satisfies.d.ts.map +1 -0
  107. package/types/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/try_parse.d.ts +4 -4
  108. package/types/deps/jsr.io/@std/semver/1.0.3/try_parse.d.ts.map +1 -0
  109. package/types/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/try_parse_range.d.ts +2 -2
  110. package/types/deps/jsr.io/@std/semver/1.0.3/try_parse_range.d.ts.map +1 -0
  111. package/types/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/types.d.ts +23 -4
  112. package/types/deps/jsr.io/@std/semver/1.0.3/types.d.ts.map +1 -0
  113. package/types/nodeinfo/types.d.ts +1 -1
  114. package/types/nodeinfo/types.d.ts.map +1 -1
  115. package/esm/deps/jsr.io/@std/semver/0.224.3/_constants.js +0 -10
  116. package/esm/deps/jsr.io/@std/semver/0.224.3/compare.js +0 -35
  117. package/esm/deps/jsr.io/@std/semver/0.224.3/constants.js +0 -71
  118. package/esm/deps/jsr.io/@std/semver/0.224.3/difference.js +0 -37
  119. package/esm/deps/jsr.io/@std/semver/0.224.3/equals.js +0 -27
  120. package/esm/deps/jsr.io/@std/semver/0.224.3/format.js +0 -48
  121. package/esm/deps/jsr.io/@std/semver/0.224.3/greater_or_equal.js +0 -25
  122. package/esm/deps/jsr.io/@std/semver/0.224.3/greater_than.js +0 -27
  123. package/esm/deps/jsr.io/@std/semver/0.224.3/less_or_equal.js +0 -25
  124. package/esm/deps/jsr.io/@std/semver/0.224.3/less_than.js +0 -25
  125. package/esm/deps/jsr.io/@std/semver/0.224.3/not_equals.js +0 -24
  126. package/esm/deps/jsr.io/@std/semver/0.224.3/parse.js +0 -50
  127. package/esm/deps/jsr.io/@std/semver/0.224.3/range_max.js +0 -77
  128. package/esm/deps/jsr.io/@std/semver/0.224.3/range_min.js +0 -68
  129. package/esm/deps/jsr.io/@std/semver/0.224.3/test_range.js +0 -28
  130. package/types/deps/jsr.io/@std/encoding/0.224.3/_validate_binary_like.d.ts.map +0 -1
  131. package/types/deps/jsr.io/@std/encoding/0.224.3/base64.d.ts.map +0 -1
  132. package/types/deps/jsr.io/@std/encoding/0.224.3/base64url.d.ts.map +0 -1
  133. package/types/deps/jsr.io/@std/encoding/0.224.3/hex.d.ts.map +0 -1
  134. package/types/deps/jsr.io/@std/http/0.224.5/_negotiation/common.d.ts.map +0 -1
  135. package/types/deps/jsr.io/@std/http/0.224.5/_negotiation/encoding.d.ts.map +0 -1
  136. package/types/deps/jsr.io/@std/http/0.224.5/_negotiation/language.d.ts.map +0 -1
  137. package/types/deps/jsr.io/@std/http/0.224.5/_negotiation/media_type.d.ts.map +0 -1
  138. package/types/deps/jsr.io/@std/http/0.224.5/negotiation.d.ts.map +0 -1
  139. package/types/deps/jsr.io/@std/semver/0.224.3/_constants.d.ts +0 -2
  140. package/types/deps/jsr.io/@std/semver/0.224.3/_constants.d.ts.map +0 -1
  141. package/types/deps/jsr.io/@std/semver/0.224.3/_shared.d.ts.map +0 -1
  142. package/types/deps/jsr.io/@std/semver/0.224.3/_test_comparator_set.d.ts.map +0 -1
  143. package/types/deps/jsr.io/@std/semver/0.224.3/can_parse.d.ts.map +0 -1
  144. package/types/deps/jsr.io/@std/semver/0.224.3/compare.d.ts +0 -28
  145. package/types/deps/jsr.io/@std/semver/0.224.3/compare.d.ts.map +0 -1
  146. package/types/deps/jsr.io/@std/semver/0.224.3/constants.d.ts +0 -43
  147. package/types/deps/jsr.io/@std/semver/0.224.3/constants.d.ts.map +0 -1
  148. package/types/deps/jsr.io/@std/semver/0.224.3/difference.d.ts +0 -27
  149. package/types/deps/jsr.io/@std/semver/0.224.3/difference.d.ts.map +0 -1
  150. package/types/deps/jsr.io/@std/semver/0.224.3/equals.d.ts +0 -24
  151. package/types/deps/jsr.io/@std/semver/0.224.3/equals.d.ts.map +0 -1
  152. package/types/deps/jsr.io/@std/semver/0.224.3/format.d.ts.map +0 -1
  153. package/types/deps/jsr.io/@std/semver/0.224.3/format_range.d.ts.map +0 -1
  154. package/types/deps/jsr.io/@std/semver/0.224.3/greater_or_equal.d.ts +0 -24
  155. package/types/deps/jsr.io/@std/semver/0.224.3/greater_or_equal.d.ts.map +0 -1
  156. package/types/deps/jsr.io/@std/semver/0.224.3/greater_than.d.ts +0 -24
  157. package/types/deps/jsr.io/@std/semver/0.224.3/greater_than.d.ts.map +0 -1
  158. package/types/deps/jsr.io/@std/semver/0.224.3/greater_than_range.d.ts.map +0 -1
  159. package/types/deps/jsr.io/@std/semver/0.224.3/increment.d.ts.map +0 -1
  160. package/types/deps/jsr.io/@std/semver/0.224.3/is_range.d.ts.map +0 -1
  161. package/types/deps/jsr.io/@std/semver/0.224.3/is_semver.d.ts.map +0 -1
  162. package/types/deps/jsr.io/@std/semver/0.224.3/less_or_equal.d.ts +0 -24
  163. package/types/deps/jsr.io/@std/semver/0.224.3/less_or_equal.d.ts.map +0 -1
  164. package/types/deps/jsr.io/@std/semver/0.224.3/less_than.d.ts +0 -24
  165. package/types/deps/jsr.io/@std/semver/0.224.3/less_than.d.ts.map +0 -1
  166. package/types/deps/jsr.io/@std/semver/0.224.3/less_than_range.d.ts.map +0 -1
  167. package/types/deps/jsr.io/@std/semver/0.224.3/max_satisfying.d.ts.map +0 -1
  168. package/types/deps/jsr.io/@std/semver/0.224.3/min_satisfying.d.ts.map +0 -1
  169. package/types/deps/jsr.io/@std/semver/0.224.3/mod.d.ts.map +0 -1
  170. package/types/deps/jsr.io/@std/semver/0.224.3/not_equals.d.ts +0 -23
  171. package/types/deps/jsr.io/@std/semver/0.224.3/not_equals.d.ts.map +0 -1
  172. package/types/deps/jsr.io/@std/semver/0.224.3/parse.d.ts.map +0 -1
  173. package/types/deps/jsr.io/@std/semver/0.224.3/parse_range.d.ts.map +0 -1
  174. package/types/deps/jsr.io/@std/semver/0.224.3/range_intersects.d.ts +0 -24
  175. package/types/deps/jsr.io/@std/semver/0.224.3/range_intersects.d.ts.map +0 -1
  176. package/types/deps/jsr.io/@std/semver/0.224.3/range_max.d.ts +0 -25
  177. package/types/deps/jsr.io/@std/semver/0.224.3/range_max.d.ts.map +0 -1
  178. package/types/deps/jsr.io/@std/semver/0.224.3/range_min.d.ts +0 -25
  179. package/types/deps/jsr.io/@std/semver/0.224.3/range_min.d.ts.map +0 -1
  180. package/types/deps/jsr.io/@std/semver/0.224.3/satisfies.d.ts.map +0 -1
  181. package/types/deps/jsr.io/@std/semver/0.224.3/test_range.d.ts +0 -27
  182. package/types/deps/jsr.io/@std/semver/0.224.3/test_range.d.ts.map +0 -1
  183. package/types/deps/jsr.io/@std/semver/0.224.3/try_parse.d.ts.map +0 -1
  184. package/types/deps/jsr.io/@std/semver/0.224.3/try_parse_range.d.ts.map +0 -1
  185. package/types/deps/jsr.io/@std/semver/0.224.3/types.d.ts.map +0 -1
  186. /package/esm/deps/jsr.io/@std/http/{0.224.5 → 1.0.6}/_negotiation/common.js +0 -0
  187. /package/esm/deps/jsr.io/@std/http/{0.224.5 → 1.0.6}/negotiation.js +0 -0
  188. /package/esm/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/_test_comparator_set.js +0 -0
  189. /package/esm/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/types.js +0 -0
  190. /package/types/deps/jsr.io/@std/encoding/{0.224.3 → 1.0.5}/_validate_binary_like.d.ts +0 -0
  191. /package/types/deps/jsr.io/@std/http/{0.224.5 → 1.0.6}/_negotiation/encoding.d.ts +0 -0
  192. /package/types/deps/jsr.io/@std/http/{0.224.5 → 1.0.6}/_negotiation/language.d.ts +0 -0
  193. /package/types/deps/jsr.io/@std/http/{0.224.5 → 1.0.6}/_negotiation/media_type.d.ts +0 -0
  194. /package/types/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/_shared.d.ts +0 -0
  195. /package/types/deps/jsr.io/@std/semver/{0.224.3 → 1.0.3}/_test_comparator_set.d.ts +0 -0
@@ -29,7 +29,7 @@ function bumpPrerelease(prerelease = [], identifier) {
29
29
  return values;
30
30
  }
31
31
  /**
32
- * Returns the new version resulting from an increment by release type.
32
+ * Returns the new SemVer resulting from an increment by release type.
33
33
  *
34
34
  * `premajor`, `preminor` and `prepatch` will bump the version up to the next version,
35
35
  * based on the type, and will also add prerelease metadata.
@@ -52,7 +52,7 @@ function bumpPrerelease(prerelease = [], identifier) {
52
52
  * @example Usage
53
53
  * ```ts
54
54
  * import { increment, parse } from "@std/semver";
55
- * import { assertEquals } from "@std/assert/assert-equals";
55
+ * import { assertEquals } from "@std/assert";
56
56
  *
57
57
  * const version = parse("1.2.3");
58
58
  * assertEquals(increment(version, "major"), parse("2.0.0"));
@@ -66,21 +66,20 @@ function bumpPrerelease(prerelease = [], identifier) {
66
66
  *
67
67
  * @param version The version to increment
68
68
  * @param release The type of increment to perform
69
- * @param prerelease The pre-release metadata of the new version
70
- * @param buildmetadata The build metadata of the new version
69
+ * @param options Additional options
71
70
  * @returns The new version
72
71
  */
73
- export function increment(version, release, prerelease, buildmetadata) {
74
- const build = buildmetadata !== undefined
75
- ? parseBuild(buildmetadata)
76
- : version.build;
72
+ export function increment(version, release, options = {}) {
73
+ const build = options.build !== undefined
74
+ ? parseBuild(options.build)
75
+ : version.build ?? [];
77
76
  switch (release) {
78
77
  case "premajor":
79
78
  return {
80
79
  major: version.major + 1,
81
80
  minor: 0,
82
81
  patch: 0,
83
- prerelease: bumpPrerelease(version.prerelease, prerelease),
82
+ prerelease: bumpPrerelease(version.prerelease, options.prerelease),
84
83
  build,
85
84
  };
86
85
  case "preminor":
@@ -88,7 +87,7 @@ export function increment(version, release, prerelease, buildmetadata) {
88
87
  major: version.major,
89
88
  minor: version.minor + 1,
90
89
  patch: 0,
91
- prerelease: bumpPrerelease(version.prerelease, prerelease),
90
+ prerelease: bumpPrerelease(version.prerelease, options.prerelease),
92
91
  build,
93
92
  };
94
93
  case "prepatch":
@@ -96,7 +95,7 @@ export function increment(version, release, prerelease, buildmetadata) {
96
95
  major: version.major,
97
96
  minor: version.minor,
98
97
  patch: version.patch + 1,
99
- prerelease: bumpPrerelease(version.prerelease, prerelease),
98
+ prerelease: bumpPrerelease(version.prerelease, options.prerelease),
100
99
  build,
101
100
  };
102
101
  case "prerelease": {
@@ -107,7 +106,7 @@ export function increment(version, release, prerelease, buildmetadata) {
107
106
  major: version.major,
108
107
  minor: version.minor,
109
108
  patch,
110
- prerelease: bumpPrerelease(version.prerelease, prerelease),
109
+ prerelease: bumpPrerelease(version.prerelease, options.prerelease),
111
110
  build,
112
111
  };
113
112
  }
@@ -167,11 +166,11 @@ export function increment(version, release, prerelease, buildmetadata) {
167
166
  major: version.major,
168
167
  minor: version.minor,
169
168
  patch: version.patch,
170
- prerelease: bumpPrerelease(version.prerelease, prerelease),
169
+ prerelease: bumpPrerelease(version.prerelease, options.prerelease),
171
170
  build,
172
171
  };
173
172
  }
174
173
  default:
175
- throw new Error(`invalid increment argument: ${release}`);
174
+ throw new TypeError(`Cannot increment version: invalid argument ${release}`);
176
175
  }
177
176
  }
@@ -1,11 +1,11 @@
1
1
  import { OPERATORS } from "./_constants.js";
2
- import { ALL, NONE } from "./constants.js";
2
+ import { ALL } from "./_constants.js";
3
3
  import { isSemVer } from "./is_semver.js";
4
4
  function isComparator(value) {
5
5
  if (value === null || value === undefined || Array.isArray(value) ||
6
6
  typeof value !== "object")
7
7
  return false;
8
- if (value === NONE || value === ALL)
8
+ if (value === ALL)
9
9
  return true;
10
10
  const { operator } = value;
11
11
  return ((operator === undefined ||
@@ -23,11 +23,11 @@ function isComparator(value) {
23
23
  * @example Usage
24
24
  * ```ts
25
25
  * import { isRange } from "@std/semver/is-range";
26
- * import { assert, assertFalse } from "@std/assert";
26
+ * import { assert } from "@std/assert";
27
27
  *
28
28
  * const range = [[{ major: 1, minor: 2, patch: 3 }]];
29
29
  * assert(isRange(range));
30
- * assertFalse(isRange({}));
30
+ * assert(!isRange({}));
31
31
  * ```
32
32
  * @param value The value to check if its a valid Range
33
33
  * @returns True if its a valid Range otherwise false.
@@ -1,6 +1,6 @@
1
1
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
2
  // This module is browser compatible.
3
- import { ANY, INVALID } from "./constants.js";
3
+ import { ANY } from "./_constants.js";
4
4
  import { isValidNumber, isValidString } from "./_shared.js";
5
5
  /**
6
6
  * Checks to see if value is a valid SemVer object. It does a check
@@ -18,7 +18,7 @@ import { isValidNumber, isValidString } from "./_shared.js";
18
18
  * @example Usage
19
19
  * ```ts
20
20
  * import { isSemVer } from "@std/semver/is-semver";
21
- * import { assert, assertFalse } from "@std/assert";
21
+ * import { assert } from "@std/assert";
22
22
  *
23
23
  * const value = {
24
24
  * major: 1,
@@ -27,7 +27,7 @@ import { isValidNumber, isValidString } from "./_shared.js";
27
27
  * };
28
28
  *
29
29
  * assert(isSemVer(value));
30
- * assertFalse(isSemVer({ major: 1, minor: 2 }));
30
+ * assert(!isSemVer({ major: 1, minor: 2 }));
31
31
  * ```
32
32
  *
33
33
  * @param value The value to check to see if its a valid SemVer object
@@ -40,8 +40,6 @@ export function isSemVer(value) {
40
40
  return false;
41
41
  if (typeof value !== "object")
42
42
  return false;
43
- if (value === INVALID)
44
- return true;
45
43
  if (value === ANY)
46
44
  return true;
47
45
  const { major, minor, patch, build = [], prerelease = [], } = value;
@@ -0,0 +1,26 @@
1
+ import { compare } from "./compare.js";
2
+ /**
3
+ * Less than or equal to comparison for two SemVers.
4
+ *
5
+ * This is equal to `compare(version1, version2) <= 0`.
6
+ *
7
+ * @example Usage
8
+ * ```ts
9
+ * import { parse, lessOrEqual } from "@std/semver";
10
+ * import { assert } from "@std/assert";
11
+ *
12
+ * const version1 = parse("1.2.3");
13
+ * const version2 = parse("1.2.4");
14
+ *
15
+ * assert(lessOrEqual(version1, version2));
16
+ * assert(!lessOrEqual(version2, version1));
17
+ * assert(lessOrEqual(version1, version1));
18
+ * ```
19
+ *
20
+ * @param version1 the first version to compare
21
+ * @param version2 the second version to compare
22
+ * @returns `true` if `version1` is less than or equal to `version2`, `false` otherwise
23
+ */
24
+ export function lessOrEqual(version1, version2) {
25
+ return compare(version1, version2) <= 0;
26
+ }
@@ -0,0 +1,26 @@
1
+ import { compare } from "./compare.js";
2
+ /**
3
+ * Less than comparison for two SemVers.
4
+ *
5
+ * This is equal to `compare(version1, version2) < 0`.
6
+ *
7
+ * @example Usage
8
+ * ```ts
9
+ * import { parse, lessThan } from "@std/semver";
10
+ * import { assert } from "@std/assert";
11
+ *
12
+ * const version1 = parse("1.2.3");
13
+ * const version2 = parse("1.2.4");
14
+ *
15
+ * assert(lessThan(version1, version2));
16
+ * assert(!lessThan(version2, version1));
17
+ * assert(!lessThan(version1, version1));
18
+ * ```
19
+ *
20
+ * @param version1 the first version to compare
21
+ * @param version2 the second version to compare
22
+ * @returns `true` if `version1` is less than `version2`, `false` otherwise
23
+ */
24
+ export function lessThan(version1, version2) {
25
+ return compare(version1, version2) < 0;
26
+ }
@@ -9,36 +9,37 @@ import { compare } from "./compare.js";
9
9
  * @example Usage
10
10
  * ```ts
11
11
  * import { parse, parseRange, lessThanRange } from "@std/semver";
12
- * import { assert, assertFalse } from "@std/assert";
12
+ * import { assert } from "@std/assert";
13
13
  *
14
- * const v0 = parse("1.2.3");
15
- * const v1 = parse("1.0.0");
14
+ * const version1 = parse("1.2.3");
15
+ * const version2 = parse("1.0.0");
16
16
  * const range = parseRange(">=1.2.3 <1.2.4");
17
- * assertFalse(lessThanRange(v0, range));
18
- * assert(lessThanRange(v1, range));
17
+ *
18
+ * assert(!lessThanRange(version1, range));
19
+ * assert(lessThanRange(version2, range));
19
20
  * ```
20
21
  *
21
- * @param semver The version to check.
22
+ * @param version The version to check.
22
23
  * @param range The range to check against.
23
24
  * @returns `true` if the SemVer is less than the range, `false` otherwise.
24
25
  */
25
- export function lessThanRange(semver, range) {
26
- return range.every((comparatorSet) => lessThanComparatorSet(semver, comparatorSet));
26
+ export function lessThanRange(version, range) {
27
+ return range.every((comparatorSet) => lessThanComparatorSet(version, comparatorSet));
27
28
  }
28
- function lessThanComparatorSet(semver, comparatorSet) {
29
+ function lessThanComparatorSet(version, comparatorSet) {
29
30
  // If the comparator set contains wildcard, then the semver is not greater than the range.
30
31
  if (comparatorSet.some(isWildcardComparator))
31
32
  return false;
32
33
  // If the SemVer satisfies the comparator set, then it's not less than the range.
33
- if (testComparatorSet(semver, comparatorSet))
34
+ if (testComparatorSet(version, comparatorSet))
34
35
  return false;
35
36
  // If the SemVer is greater than any of the comparator set, then it's not less than the range.
36
- if (comparatorSet.some((comparator) => greaterThanComparator(semver, comparator)))
37
+ if (comparatorSet.some((comparator) => greaterThanComparator(version, comparator)))
37
38
  return false;
38
39
  return true;
39
40
  }
40
- function greaterThanComparator(semver, comparator) {
41
- const cmp = compare(semver, comparator);
41
+ function greaterThanComparator(version, comparator) {
42
+ const cmp = compare(version, comparator);
42
43
  switch (comparator.operator) {
43
44
  case "=":
44
45
  case undefined:
@@ -1,13 +1,13 @@
1
1
  import { satisfies } from "./satisfies.js";
2
2
  import { greaterThan } from "./greater_than.js";
3
3
  /**
4
- * Returns the highest version in the list that satisfies the range, or `undefined`
4
+ * Returns the highest SemVer in the list that satisfies the range, or `undefined`
5
5
  * if none of them do.
6
6
  *
7
7
  * @example Usage
8
8
  * ```ts
9
9
  * import { parse, parseRange, maxSatisfying } from "@std/semver";
10
- * import { assertEquals } from "@std/assert/assert-equals";
10
+ * import { assertEquals } from "@std/assert";
11
11
  *
12
12
  * const versions = ["1.2.3", "1.2.4", "1.3.0", "2.0.0", "2.1.0"].map(parse);
13
13
  * const range = parseRange(">=1.0.0 <2.0.0");
@@ -1,13 +1,13 @@
1
1
  import { satisfies } from "./satisfies.js";
2
2
  import { lessThan } from "./less_than.js";
3
3
  /**
4
- * Returns the lowest version in the list that satisfies the range, or `undefined` if
4
+ * Returns the lowest SemVer in the list that satisfies the range, or `undefined` if
5
5
  * none of them do.
6
6
  *
7
7
  * @example Usage
8
8
  * ```ts
9
9
  * import { parse, parseRange, minSatisfying } from "@std/semver";
10
- * import { assertEquals } from "@std/assert/assert-equals";
10
+ * import { assertEquals } from "@std/assert";
11
11
  *
12
12
  * const versions = ["0.2.0", "1.2.3", "1.3.0", "2.0.0", "2.1.0"].map(parse);
13
13
  * const range = parseRange(">=1.0.0 <2.0.0");
@@ -14,7 +14,7 @@
14
14
  * lessThan,
15
15
  * format
16
16
  * } from "@std/semver";
17
- * import { assertEquals } from "@std/assert/assert-equals";
17
+ * import { assertEquals } from "@std/assert";
18
18
  *
19
19
  * const semver = parse("1.2.3");
20
20
  * assertEquals(semver, {
@@ -50,28 +50,28 @@
50
50
  * formatting options.
51
51
  *
52
52
  * ```
53
- * ┌───── full
54
- * ┌───┴───┐
55
- * ├───────── release
56
- * ┌───┴───┐ │
57
- * ├───────────── primary
58
- * ┌─┴─┐ │ │
59
- * 1.2.3-pre.1+b.1
60
- * │ │ │ └─┬─┘ └┬┘
61
- * │ │ │ │ └── build
62
- * │ │ │ └─────── pre
63
- * │ │ └─────────── patch
64
- * │ └───────────── minor
65
- * └─────────────── major
53
+ * full
54
+ * ┌───┴───┐
55
+ * release
56
+ * ┌───┴───┐ │
57
+ * primary │ │
58
+ * ┌─┴─┐ │ │
59
+ * 1.2.3-pre.1+b.1
60
+ * │ │ │ └─┬─┘ └┬┘
61
+ * │ │ │ │ └── build
62
+ * │ │ │ └─────── pre
63
+ * │ │ └─────────── patch
64
+ * │ └───────────── minor
65
+ * └─────────────── major
66
66
  * ```
67
67
  *
68
68
  * ## Ranges
69
69
  *
70
- * A `version range` is a set of `comparators` which specify versions that satisfy
71
- * the range.
70
+ * A version {@linkcode Range} is a set of {@linkcode Comparator}s which specify
71
+ * versions that satisfy the range.
72
72
  *
73
- * A `comparator` is composed of an `operator` and a `version`. The set of
74
- * primitive `operators` is:
73
+ * A {@linkcode Comparator} is composed of an {@linkcode Operator} and a
74
+ * {@link SemVer}. The set of primitive `operators` is:
75
75
  *
76
76
  * - `<` Less than
77
77
  * - `<=` Less than or equal to
@@ -122,12 +122,14 @@
122
122
  *
123
123
  * #### Prerelease Identifiers
124
124
  *
125
- * The method `.increment` takes an additional `identifier` string argument that
126
- * will append the value of the string as a prerelease identifier:
125
+ * The method {@linkcode increment} takes an additional `identifier` string
126
+ * argument that will append the value of the string as a prerelease identifier:
127
127
  *
128
- * ```javascript
129
- * semver.increment(parse("1.2.3"), "prerelease", "beta");
130
- * // "1.2.4-beta.0"
128
+ * ```ts
129
+ * import { increment, parse } from "@std/semver";
130
+ * import { assertEquals } from "@std/assert";
131
+ *
132
+ * assertEquals(increment(parse("1.2.3"), "prerelease", { prerelease: "alpha" }), parse("1.2.4-alpha.0"));
131
133
  * ```
132
134
  *
133
135
  * ### Build Metadata
@@ -268,18 +270,12 @@
268
270
  *
269
271
  * If you want to know if a version satisfies or does not satisfy a range, use the
270
272
  * {@linkcode satisfies} function.
271
- *
272
- *
273
- *
274
-
275
273
  *
276
274
  * @module
277
275
  */
278
276
  export * from "./compare.js";
279
- export * from "./constants.js";
280
277
  export * from "./difference.js";
281
278
  export * from "./format.js";
282
- export * from "./test_range.js";
283
279
  export * from "./satisfies.js";
284
280
  export * from "./increment.js";
285
281
  export * from "./is_semver.js";
@@ -288,8 +284,6 @@ export * from "./min_satisfying.js";
288
284
  export * from "./parse_range.js";
289
285
  export * from "./parse.js";
290
286
  export * from "./range_intersects.js";
291
- export * from "./range_max.js";
292
- export * from "./range_min.js";
293
287
  export * from "./types.js";
294
288
  export * from "./try_parse_range.js";
295
289
  export * from "./is_range.js";
@@ -304,5 +298,3 @@ export * from "./greater_or_equal.js";
304
298
  export * from "./less_than.js";
305
299
  export * from "./less_than_range.js";
306
300
  export * from "./less_or_equal.js";
307
- /** The SemVer spec version */
308
- export const SEMVER_SPEC_VERSION = "2.0.0";
@@ -0,0 +1,25 @@
1
+ import { compare } from "./compare.js";
2
+ /**
3
+ * Not equal comparison for two SemVers.
4
+ *
5
+ * This is equal to `compare(version1, version2) !== 0`.
6
+ *
7
+ * @example Usage
8
+ * ```ts
9
+ * import { parse, notEquals } from "@std/semver";
10
+ * import { assert } from "@std/assert";
11
+ *
12
+ * const version1 = parse("1.2.3");
13
+ * const version2 = parse("1.2.4");
14
+ *
15
+ * assert(notEquals(version1, version2));
16
+ * assert(!notEquals(version1, version1));
17
+ * ```
18
+ *
19
+ * @param version1 The first version to compare
20
+ * @param version2 The second version to compare
21
+ * @returns `true` if `version1` is not equal to `version2`, `false` otherwise
22
+ */
23
+ export function notEquals(version1, version2) {
24
+ return compare(version1, version2) !== 0;
25
+ }
@@ -0,0 +1,44 @@
1
+ import { parseBuild, parseNumber, parsePrerelease } from "./_shared.js";
2
+ import { FULL_REGEXP, MAX_LENGTH } from "./_shared.js";
3
+ /**
4
+ * Attempt to parse a string as a semantic version, returning a SemVer object.
5
+ *
6
+ * @example Usage
7
+ * ```ts
8
+ * import { parse } from "@std/semver/parse";
9
+ * import { assertEquals } from "@std/assert";
10
+ *
11
+ * const version = parse("1.2.3");
12
+ * assertEquals(version, {
13
+ * major: 1,
14
+ * minor: 2,
15
+ * patch: 3,
16
+ * prerelease: [],
17
+ * build: [],
18
+ * });
19
+ * ```
20
+ *
21
+ * @throws {TypeError} If the input string is invalid.
22
+ * @param value The version string to parse
23
+ * @returns A valid SemVer
24
+ */
25
+ export function parse(value) {
26
+ if (typeof value !== "string") {
27
+ throw new TypeError(`Cannot parse version as version must be a string: received ${typeof value}`);
28
+ }
29
+ if (value.length > MAX_LENGTH) {
30
+ throw new TypeError(`Cannot parse version as version length is too long: length is ${value.length}, max length is ${MAX_LENGTH}`);
31
+ }
32
+ value = value.trim();
33
+ const groups = value.match(FULL_REGEXP)?.groups;
34
+ if (!groups)
35
+ throw new TypeError(`Cannot parse version: ${value}`);
36
+ const major = parseNumber(groups.major, `Cannot parse version ${value}: invalid major version`);
37
+ const minor = parseNumber(groups.minor, `Cannot parse version ${value}: invalid minor version`);
38
+ const patch = parseNumber(groups.patch, `Cannot parse version ${value}: invalid patch version`);
39
+ const prerelease = groups.prerelease
40
+ ? parsePrerelease(groups.prerelease)
41
+ : [];
42
+ const build = groups.buildmetadata ? parseBuild(groups.buildmetadata) : [];
43
+ return { major, minor, patch, prerelease, build };
44
+ }
@@ -1,18 +1,18 @@
1
1
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
2
  // This module is browser compatible.
3
3
  import { COMPARATOR_REGEXP, OPERATOR_XRANGE_REGEXP, parseBuild, parseNumber, parsePrerelease, XRANGE, } from "./_shared.js";
4
- import { ALL, ANY, NONE } from "./constants.js";
4
+ import { ALL, ANY } from "./_constants.js";
5
5
  function parseComparator(comparator) {
6
6
  const match = comparator.match(COMPARATOR_REGEXP);
7
7
  const groups = match?.groups;
8
8
  if (!groups)
9
- return NONE;
9
+ return null;
10
10
  const { operator, prerelease, buildmetadata } = groups;
11
11
  const semver = groups.major
12
12
  ? {
13
- major: parseNumber(groups.major, "Invalid major version"),
14
- minor: parseNumber(groups.minor, "Invalid minor version"),
15
- patch: parseNumber(groups.patch, "Invalid patch version"),
13
+ major: parseNumber(groups.major, `Cannot parse comparator ${comparator}: invalid major version`),
14
+ minor: parseNumber(groups.minor, `Cannot parse comparator ${comparator}: invalid minor version`),
15
+ patch: parseNumber(groups.patch, `Cannot parse comparator ${comparator}: invalid patch version`),
16
16
  prerelease: prerelease ? parsePrerelease(prerelease) : [],
17
17
  build: buildmetadata ? parseBuild(buildmetadata) : [],
18
18
  }
@@ -317,19 +317,19 @@ function parseOperatorRange(string) {
317
317
  case "":
318
318
  return handleEqualOperator(groups);
319
319
  default:
320
- throw new Error(`'${groups.operator}' is not a valid operator.`);
320
+ throw new Error(`Cannot parse version range: '${groups.operator}' is not a valid operator`);
321
321
  }
322
322
  }
323
323
  function parseOperatorRanges(string) {
324
324
  return string.split(/\s+/).flatMap(parseOperatorRange);
325
325
  }
326
326
  /**
327
- * Parses a range string into a Range object or throws a TypeError.
327
+ * Parses a range string into a {@linkcode Range} object.
328
328
  *
329
329
  * @example Usage
330
330
  * ```ts
331
331
  * import { parseRange } from "@std/semver/parse-range";
332
- * import { assertEquals } from "@std/assert/assert-equals";
332
+ * import { assertEquals } from "@std/assert";
333
333
  *
334
334
  * const range = parseRange(">=1.0.0 <2.0.0 || >=3.0.0");
335
335
  * assertEquals(range, [
@@ -343,13 +343,18 @@ function parseOperatorRanges(string) {
343
343
  * ]);
344
344
  * ```
345
345
  *
346
- * @param range The range set string
347
- * @returns A valid semantic range
346
+ * @throws {TypeError} If the input range is invalid.
347
+ * @param value The range set string
348
+ * @returns A valid SemVer range
348
349
  */
349
- export function parseRange(range) {
350
- return range
350
+ export function parseRange(value) {
351
+ const result = value
351
352
  // remove spaces between operators and versions
352
- .replaceAll(/(?<=<|>|=) +/g, "")
353
+ .replaceAll(/(?<=<|>|=|~|\^)(\s+)/g, "")
353
354
  .split(/\s*\|\|\s*/)
354
355
  .map((string) => parseHyphenRange(string) || parseOperatorRanges(string));
356
+ if (result.some((r) => r.includes(null))) {
357
+ throw new TypeError(`Cannot parse version range: range "${value}" is invalid`);
358
+ }
359
+ return result;
355
360
  }
@@ -3,21 +3,21 @@
3
3
  import { isWildcardComparator } from "./_shared.js";
4
4
  import { compare } from "./compare.js";
5
5
  import { satisfies } from "./satisfies.js";
6
- function comparatorIntersects(c0, c1) {
7
- const op0 = c0.operator;
8
- const op1 = c1.operator;
6
+ function comparatorIntersects(comparator1, comparator2) {
7
+ const op0 = comparator1.operator;
8
+ const op1 = comparator2.operator;
9
9
  if (op0 === undefined) {
10
- // if c0 is empty comparator, then returns true
11
- if (isWildcardComparator(c0))
10
+ // if comparator1 is empty comparator, then returns true
11
+ if (isWildcardComparator(comparator1))
12
12
  return true;
13
- return satisfies(c0, [[c1]]);
13
+ return satisfies(comparator1, [[comparator2]]);
14
14
  }
15
15
  if (op1 === undefined) {
16
- if (isWildcardComparator(c1))
16
+ if (isWildcardComparator(comparator2))
17
17
  return true;
18
- return satisfies(c1, [[c0]]);
18
+ return satisfies(comparator2, [[comparator1]]);
19
19
  }
20
- const cmp = compare(c0, c1);
20
+ const cmp = compare(comparator1, comparator2);
21
21
  const sameDirectionIncreasing = (op0 === ">=" || op0 === ">") &&
22
22
  (op1 === ">=" || op1 === ">");
23
23
  const sameDirectionDecreasing = (op0 === "<=" || op0 === "<") &&
@@ -46,9 +46,9 @@ function rangesSatisfiable(ranges) {
46
46
  function comparatorsSatisfiable(comparators) {
47
47
  // Comparators are satisfiable if they all intersect with each other
48
48
  for (let i = 0; i < comparators.length - 1; i++) {
49
- const c0 = comparators[i];
50
- for (const c1 of comparators.slice(i + 1)) {
51
- if (!comparatorIntersects(c0, c1)) {
49
+ const comparator1 = comparators[i];
50
+ for (const comparator2 of comparators.slice(i + 1)) {
51
+ if (!comparatorIntersects(comparator1, comparator2)) {
52
52
  return false;
53
53
  }
54
54
  }
@@ -56,32 +56,33 @@ function comparatorsSatisfiable(comparators) {
56
56
  return true;
57
57
  }
58
58
  /**
59
- * The ranges intersect every range of AND comparators intersects with a least one range of OR ranges.
59
+ * The ranges intersect every range of AND comparators intersects with a least
60
+ * one range of OR ranges.
60
61
  *
61
62
  * @example Usage
62
63
  * ```ts
63
64
  * import { parseRange, rangeIntersects } from "@std/semver";
64
- * import { assert, assertFalse } from "@std/assert";
65
+ * import { assert } from "@std/assert";
65
66
  *
66
- * const r0 = parseRange(">=1.0.0 <2.0.0");
67
- * const r1 = parseRange(">=1.0.0 <1.2.3");
68
- * const r2 = parseRange(">=1.2.3 <2.0.0");
67
+ * const range1 = parseRange(">=1.0.0 <2.0.0");
68
+ * const range2 = parseRange(">=1.0.0 <1.2.3");
69
+ * const range3 = parseRange(">=1.2.3 <2.0.0");
69
70
  *
70
- * assert(rangeIntersects(r0, r1));
71
- * assert(rangeIntersects(r0, r2));
72
- * assertFalse(rangeIntersects(r1, r2));
71
+ * assert(rangeIntersects(range1, range2));
72
+ * assert(rangeIntersects(range1, range3));
73
+ * assert(!rangeIntersects(range2, range3));
73
74
  * ```
74
75
  *
75
- * @param r0 range 0
76
- * @param r1 range 1
76
+ * @param range1 range 0
77
+ * @param range2 range 1
77
78
  * @returns returns true if the given ranges intersect, false otherwise
78
79
  */
79
- export function rangeIntersects(r0, r1) {
80
- return rangesSatisfiable([r0, r1]) &&
81
- r0.some((r00) => {
82
- return r1.some((r11) => {
83
- return r00.every((c0) => {
84
- return r11.every((c1) => comparatorIntersects(c0, c1));
80
+ export function rangeIntersects(range1, range2) {
81
+ return rangesSatisfiable([range1, range2]) &&
82
+ range1.some((range10) => {
83
+ return range2.some((r11) => {
84
+ return range10.every((comparator1) => {
85
+ return r11.every((comparator2) => comparatorIntersects(comparator1, comparator2));
85
86
  });
86
87
  });
87
88
  });
@@ -1,12 +1,12 @@
1
1
  // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2
2
  import { testComparatorSet } from "./_test_comparator_set.js";
3
3
  /**
4
- * Test to see if the version satisfies the range.
4
+ * Test to see if the SemVer satisfies the range.
5
5
  *
6
6
  * @example Usage
7
7
  * ```ts
8
8
  * import { parse, parseRange, satisfies } from "@std/semver";
9
- * import { assert, assertFalse } from "@std/assert";
9
+ * import { assert } from "@std/assert";
10
10
  *
11
11
  * const version = parse("1.2.3");
12
12
  * const range0 = parseRange(">=1.0.0 <2.0.0");
@@ -15,7 +15,7 @@ import { testComparatorSet } from "./_test_comparator_set.js";
15
15
  *
16
16
  * assert(satisfies(version, range0));
17
17
  * assert(satisfies(version, range1));
18
- * assertFalse(satisfies(version, range2));
18
+ * assert(!satisfies(version, range2));
19
19
  * ```
20
20
  * @param version The version to test
21
21
  * @param range The range to check