@effectionx/worker 0.1.2 → 0.3.0

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 (241) hide show
  1. package/esm/_dnt.shims.d.ts +2 -0
  2. package/esm/_dnt.shims.d.ts.map +1 -0
  3. package/esm/_dnt.shims.js +57 -0
  4. package/esm/deps/jsr.io/@std/assert/1.0.16/almost_equals.d.ts +29 -0
  5. package/esm/deps/jsr.io/@std/assert/1.0.16/almost_equals.d.ts.map +1 -0
  6. package/esm/deps/jsr.io/@std/assert/1.0.16/almost_equals.js +46 -0
  7. package/esm/deps/jsr.io/@std/assert/1.0.16/array_includes.d.ts +24 -0
  8. package/esm/deps/jsr.io/@std/assert/1.0.16/array_includes.d.ts.map +1 -0
  9. package/esm/deps/jsr.io/@std/assert/1.0.16/array_includes.js +46 -0
  10. package/esm/deps/jsr.io/@std/assert/1.0.16/assert.d.ts +16 -0
  11. package/esm/deps/jsr.io/@std/assert/1.0.16/assert.d.ts.map +1 -0
  12. package/esm/deps/jsr.io/@std/assert/1.0.16/assert.js +22 -0
  13. package/esm/deps/jsr.io/@std/assert/1.0.16/assertion_error.d.ts +26 -0
  14. package/esm/deps/jsr.io/@std/assert/1.0.16/assertion_error.d.ts.map +1 -0
  15. package/esm/deps/jsr.io/@std/assert/1.0.16/assertion_error.js +30 -0
  16. package/esm/deps/jsr.io/@std/assert/1.0.16/equal.d.ts +17 -0
  17. package/esm/deps/jsr.io/@std/assert/1.0.16/equal.d.ts.map +1 -0
  18. package/esm/deps/jsr.io/@std/assert/1.0.16/equal.js +186 -0
  19. package/esm/deps/jsr.io/@std/assert/1.0.16/equals.d.ts +35 -0
  20. package/esm/deps/jsr.io/@std/assert/1.0.16/equals.d.ts.map +1 -0
  21. package/esm/deps/jsr.io/@std/assert/1.0.16/equals.js +59 -0
  22. package/esm/deps/jsr.io/@std/assert/1.0.16/exists.d.ts +18 -0
  23. package/esm/deps/jsr.io/@std/assert/1.0.16/exists.d.ts.map +1 -0
  24. package/esm/deps/jsr.io/@std/assert/1.0.16/exists.js +27 -0
  25. package/esm/deps/jsr.io/@std/assert/1.0.16/fail.d.ts +15 -0
  26. package/esm/deps/jsr.io/@std/assert/1.0.16/fail.d.ts.map +1 -0
  27. package/esm/deps/jsr.io/@std/assert/1.0.16/fail.js +20 -0
  28. package/esm/deps/jsr.io/@std/assert/1.0.16/false.d.ts +18 -0
  29. package/esm/deps/jsr.io/@std/assert/1.0.16/false.d.ts.map +1 -0
  30. package/esm/deps/jsr.io/@std/assert/1.0.16/false.js +22 -0
  31. package/esm/deps/jsr.io/@std/assert/1.0.16/greater.d.ts +20 -0
  32. package/esm/deps/jsr.io/@std/assert/1.0.16/greater.d.ts.map +1 -0
  33. package/esm/deps/jsr.io/@std/assert/1.0.16/greater.js +29 -0
  34. package/esm/deps/jsr.io/@std/assert/1.0.16/greater_or_equal.d.ts +20 -0
  35. package/esm/deps/jsr.io/@std/assert/1.0.16/greater_or_equal.d.ts.map +1 -0
  36. package/esm/deps/jsr.io/@std/assert/1.0.16/greater_or_equal.js +29 -0
  37. package/esm/deps/jsr.io/@std/assert/1.0.16/instance_of.d.ts +23 -0
  38. package/esm/deps/jsr.io/@std/assert/1.0.16/instance_of.d.ts.map +1 -0
  39. package/esm/deps/jsr.io/@std/assert/1.0.16/instance_of.js +52 -0
  40. package/esm/deps/jsr.io/@std/assert/1.0.16/is_error.d.ts +25 -0
  41. package/esm/deps/jsr.io/@std/assert/1.0.16/is_error.d.ts.map +1 -0
  42. package/esm/deps/jsr.io/@std/assert/1.0.16/is_error.js +53 -0
  43. package/esm/deps/jsr.io/@std/assert/1.0.16/less.d.ts +19 -0
  44. package/esm/deps/jsr.io/@std/assert/1.0.16/less.d.ts.map +1 -0
  45. package/esm/deps/jsr.io/@std/assert/1.0.16/less.js +28 -0
  46. package/esm/deps/jsr.io/@std/assert/1.0.16/less_or_equal.d.ts +20 -0
  47. package/esm/deps/jsr.io/@std/assert/1.0.16/less_or_equal.d.ts.map +1 -0
  48. package/esm/deps/jsr.io/@std/assert/1.0.16/less_or_equal.js +29 -0
  49. package/esm/deps/jsr.io/@std/assert/1.0.16/match.d.ts +18 -0
  50. package/esm/deps/jsr.io/@std/assert/1.0.16/match.d.ts.map +1 -0
  51. package/esm/deps/jsr.io/@std/assert/1.0.16/match.js +26 -0
  52. package/esm/deps/jsr.io/@std/assert/1.0.16/mod.d.ts +44 -0
  53. package/esm/deps/jsr.io/@std/assert/1.0.16/mod.d.ts.map +1 -0
  54. package/esm/deps/jsr.io/@std/assert/1.0.16/mod.js +45 -0
  55. package/esm/deps/jsr.io/@std/assert/1.0.16/not_equals.d.ts +21 -0
  56. package/esm/deps/jsr.io/@std/assert/1.0.16/not_equals.d.ts.map +1 -0
  57. package/esm/deps/jsr.io/@std/assert/1.0.16/not_equals.js +33 -0
  58. package/esm/deps/jsr.io/@std/assert/1.0.16/not_instance_of.d.ts +20 -0
  59. package/esm/deps/jsr.io/@std/assert/1.0.16/not_instance_of.d.ts.map +1 -0
  60. package/esm/deps/jsr.io/@std/assert/1.0.16/not_instance_of.js +29 -0
  61. package/esm/deps/jsr.io/@std/assert/1.0.16/not_match.d.ts +18 -0
  62. package/esm/deps/jsr.io/@std/assert/1.0.16/not_match.d.ts.map +1 -0
  63. package/esm/deps/jsr.io/@std/assert/1.0.16/not_match.js +26 -0
  64. package/esm/deps/jsr.io/@std/assert/1.0.16/not_strict_equals.d.ts +23 -0
  65. package/esm/deps/jsr.io/@std/assert/1.0.16/not_strict_equals.d.ts.map +1 -0
  66. package/esm/deps/jsr.io/@std/assert/1.0.16/not_strict_equals.js +32 -0
  67. package/esm/deps/jsr.io/@std/assert/1.0.16/object_match.d.ts +29 -0
  68. package/esm/deps/jsr.io/@std/assert/1.0.16/object_match.d.ts.map +1 -0
  69. package/esm/deps/jsr.io/@std/assert/1.0.16/object_match.js +167 -0
  70. package/esm/deps/jsr.io/@std/assert/1.0.16/rejects.d.ts +42 -0
  71. package/esm/deps/jsr.io/@std/assert/1.0.16/rejects.d.ts.map +1 -0
  72. package/esm/deps/jsr.io/@std/assert/1.0.16/rejects.js +53 -0
  73. package/esm/deps/jsr.io/@std/assert/1.0.16/strict_equals.d.ts +24 -0
  74. package/esm/deps/jsr.io/@std/assert/1.0.16/strict_equals.d.ts.map +1 -0
  75. package/esm/deps/jsr.io/@std/assert/1.0.16/strict_equals.js +58 -0
  76. package/esm/deps/jsr.io/@std/assert/1.0.16/string_includes.d.ts +18 -0
  77. package/esm/deps/jsr.io/@std/assert/1.0.16/string_includes.d.ts.map +1 -0
  78. package/esm/deps/jsr.io/@std/assert/1.0.16/string_includes.js +26 -0
  79. package/esm/deps/jsr.io/@std/assert/1.0.16/throws.d.ts +45 -0
  80. package/esm/deps/jsr.io/@std/assert/1.0.16/throws.d.ts.map +1 -0
  81. package/esm/deps/jsr.io/@std/assert/1.0.16/throws.js +44 -0
  82. package/esm/deps/jsr.io/@std/assert/1.0.16/unimplemented.d.ts +15 -0
  83. package/esm/deps/jsr.io/@std/assert/1.0.16/unimplemented.d.ts.map +1 -0
  84. package/esm/deps/jsr.io/@std/assert/1.0.16/unimplemented.js +20 -0
  85. package/esm/deps/jsr.io/@std/assert/1.0.16/unreachable.d.ts +15 -0
  86. package/esm/deps/jsr.io/@std/assert/1.0.16/unreachable.d.ts.map +1 -0
  87. package/esm/deps/jsr.io/@std/assert/1.0.16/unreachable.js +20 -0
  88. package/esm/deps/jsr.io/@std/internal/1.0.12/build_message.d.ts +80 -0
  89. package/esm/deps/jsr.io/@std/internal/1.0.12/build_message.d.ts.map +1 -0
  90. package/esm/deps/jsr.io/@std/internal/1.0.12/build_message.js +116 -0
  91. package/esm/deps/jsr.io/@std/internal/1.0.12/diff.d.ts +140 -0
  92. package/esm/deps/jsr.io/@std/internal/1.0.12/diff.d.ts.map +1 -0
  93. package/esm/deps/jsr.io/@std/internal/1.0.12/diff.js +276 -0
  94. package/esm/deps/jsr.io/@std/internal/1.0.12/diff_str.d.ts +99 -0
  95. package/esm/deps/jsr.io/@std/internal/1.0.12/diff_str.d.ts.map +1 -0
  96. package/esm/deps/jsr.io/@std/internal/1.0.12/diff_str.js +182 -0
  97. package/esm/deps/jsr.io/@std/internal/1.0.12/format.d.ts +29 -0
  98. package/esm/deps/jsr.io/@std/internal/1.0.12/format.d.ts.map +1 -0
  99. package/esm/deps/jsr.io/@std/internal/1.0.12/format.js +70 -0
  100. package/esm/deps/jsr.io/@std/internal/1.0.12/styles.d.ts +159 -0
  101. package/esm/deps/jsr.io/@std/internal/1.0.12/styles.d.ts.map +1 -0
  102. package/esm/deps/jsr.io/@std/internal/1.0.12/styles.js +207 -0
  103. package/esm/deps/jsr.io/@std/internal/1.0.12/types.d.ts +25 -0
  104. package/esm/deps/jsr.io/@std/internal/1.0.12/types.d.ts.map +1 -0
  105. package/esm/deps/jsr.io/@std/internal/1.0.12/types.js +3 -0
  106. package/esm/message-channel.d.ts +3 -0
  107. package/esm/message-channel.d.ts.map +1 -0
  108. package/esm/message-channel.js +13 -0
  109. package/esm/mod.d.ts +1 -0
  110. package/esm/mod.d.ts.map +1 -1
  111. package/esm/mod.js +1 -0
  112. package/esm/types.d.ts +33 -0
  113. package/esm/types.d.ts.map +1 -0
  114. package/esm/types.js +1 -0
  115. package/esm/worker-main.d.ts +84 -0
  116. package/esm/worker-main.d.ts.map +1 -0
  117. package/esm/worker-main.js +186 -0
  118. package/esm/worker.d.ts +2 -74
  119. package/esm/worker.d.ts.map +1 -1
  120. package/esm/worker.js +4 -120
  121. package/package.json +6 -1
  122. package/script/_dnt.shims.d.ts +2 -0
  123. package/script/_dnt.shims.d.ts.map +1 -0
  124. package/script/_dnt.shims.js +60 -0
  125. package/script/deps/jsr.io/@std/assert/1.0.16/almost_equals.d.ts +29 -0
  126. package/script/deps/jsr.io/@std/assert/1.0.16/almost_equals.d.ts.map +1 -0
  127. package/script/deps/jsr.io/@std/assert/1.0.16/almost_equals.js +49 -0
  128. package/script/deps/jsr.io/@std/assert/1.0.16/array_includes.d.ts +24 -0
  129. package/script/deps/jsr.io/@std/assert/1.0.16/array_includes.d.ts.map +1 -0
  130. package/script/deps/jsr.io/@std/assert/1.0.16/array_includes.js +49 -0
  131. package/script/deps/jsr.io/@std/assert/1.0.16/assert.d.ts +16 -0
  132. package/script/deps/jsr.io/@std/assert/1.0.16/assert.d.ts.map +1 -0
  133. package/script/deps/jsr.io/@std/assert/1.0.16/assert.js +25 -0
  134. package/script/deps/jsr.io/@std/assert/1.0.16/assertion_error.d.ts +26 -0
  135. package/script/deps/jsr.io/@std/assert/1.0.16/assertion_error.d.ts.map +1 -0
  136. package/script/deps/jsr.io/@std/assert/1.0.16/assertion_error.js +34 -0
  137. package/script/deps/jsr.io/@std/assert/1.0.16/equal.d.ts +17 -0
  138. package/script/deps/jsr.io/@std/assert/1.0.16/equal.d.ts.map +1 -0
  139. package/script/deps/jsr.io/@std/assert/1.0.16/equal.js +222 -0
  140. package/script/deps/jsr.io/@std/assert/1.0.16/equals.d.ts +35 -0
  141. package/script/deps/jsr.io/@std/assert/1.0.16/equals.d.ts.map +1 -0
  142. package/script/deps/jsr.io/@std/assert/1.0.16/equals.js +62 -0
  143. package/script/deps/jsr.io/@std/assert/1.0.16/exists.d.ts +18 -0
  144. package/script/deps/jsr.io/@std/assert/1.0.16/exists.d.ts.map +1 -0
  145. package/script/deps/jsr.io/@std/assert/1.0.16/exists.js +30 -0
  146. package/script/deps/jsr.io/@std/assert/1.0.16/fail.d.ts +15 -0
  147. package/script/deps/jsr.io/@std/assert/1.0.16/fail.d.ts.map +1 -0
  148. package/script/deps/jsr.io/@std/assert/1.0.16/fail.js +23 -0
  149. package/script/deps/jsr.io/@std/assert/1.0.16/false.d.ts +18 -0
  150. package/script/deps/jsr.io/@std/assert/1.0.16/false.d.ts.map +1 -0
  151. package/script/deps/jsr.io/@std/assert/1.0.16/false.js +25 -0
  152. package/script/deps/jsr.io/@std/assert/1.0.16/greater.d.ts +20 -0
  153. package/script/deps/jsr.io/@std/assert/1.0.16/greater.d.ts.map +1 -0
  154. package/script/deps/jsr.io/@std/assert/1.0.16/greater.js +32 -0
  155. package/script/deps/jsr.io/@std/assert/1.0.16/greater_or_equal.d.ts +20 -0
  156. package/script/deps/jsr.io/@std/assert/1.0.16/greater_or_equal.d.ts.map +1 -0
  157. package/script/deps/jsr.io/@std/assert/1.0.16/greater_or_equal.js +32 -0
  158. package/script/deps/jsr.io/@std/assert/1.0.16/instance_of.d.ts +23 -0
  159. package/script/deps/jsr.io/@std/assert/1.0.16/instance_of.d.ts.map +1 -0
  160. package/script/deps/jsr.io/@std/assert/1.0.16/instance_of.js +55 -0
  161. package/script/deps/jsr.io/@std/assert/1.0.16/is_error.d.ts +25 -0
  162. package/script/deps/jsr.io/@std/assert/1.0.16/is_error.d.ts.map +1 -0
  163. package/script/deps/jsr.io/@std/assert/1.0.16/is_error.js +56 -0
  164. package/script/deps/jsr.io/@std/assert/1.0.16/less.d.ts +19 -0
  165. package/script/deps/jsr.io/@std/assert/1.0.16/less.d.ts.map +1 -0
  166. package/script/deps/jsr.io/@std/assert/1.0.16/less.js +31 -0
  167. package/script/deps/jsr.io/@std/assert/1.0.16/less_or_equal.d.ts +20 -0
  168. package/script/deps/jsr.io/@std/assert/1.0.16/less_or_equal.d.ts.map +1 -0
  169. package/script/deps/jsr.io/@std/assert/1.0.16/less_or_equal.js +32 -0
  170. package/script/deps/jsr.io/@std/assert/1.0.16/match.d.ts +18 -0
  171. package/script/deps/jsr.io/@std/assert/1.0.16/match.d.ts.map +1 -0
  172. package/script/deps/jsr.io/@std/assert/1.0.16/match.js +29 -0
  173. package/script/deps/jsr.io/@std/assert/1.0.16/mod.d.ts +44 -0
  174. package/script/deps/jsr.io/@std/assert/1.0.16/mod.d.ts.map +1 -0
  175. package/script/deps/jsr.io/@std/assert/1.0.16/mod.js +61 -0
  176. package/script/deps/jsr.io/@std/assert/1.0.16/not_equals.d.ts +21 -0
  177. package/script/deps/jsr.io/@std/assert/1.0.16/not_equals.d.ts.map +1 -0
  178. package/script/deps/jsr.io/@std/assert/1.0.16/not_equals.js +36 -0
  179. package/script/deps/jsr.io/@std/assert/1.0.16/not_instance_of.d.ts +20 -0
  180. package/script/deps/jsr.io/@std/assert/1.0.16/not_instance_of.d.ts.map +1 -0
  181. package/script/deps/jsr.io/@std/assert/1.0.16/not_instance_of.js +32 -0
  182. package/script/deps/jsr.io/@std/assert/1.0.16/not_match.d.ts +18 -0
  183. package/script/deps/jsr.io/@std/assert/1.0.16/not_match.d.ts.map +1 -0
  184. package/script/deps/jsr.io/@std/assert/1.0.16/not_match.js +29 -0
  185. package/script/deps/jsr.io/@std/assert/1.0.16/not_strict_equals.d.ts +23 -0
  186. package/script/deps/jsr.io/@std/assert/1.0.16/not_strict_equals.d.ts.map +1 -0
  187. package/script/deps/jsr.io/@std/assert/1.0.16/not_strict_equals.js +35 -0
  188. package/script/deps/jsr.io/@std/assert/1.0.16/object_match.d.ts +29 -0
  189. package/script/deps/jsr.io/@std/assert/1.0.16/object_match.d.ts.map +1 -0
  190. package/script/deps/jsr.io/@std/assert/1.0.16/object_match.js +170 -0
  191. package/script/deps/jsr.io/@std/assert/1.0.16/rejects.d.ts +42 -0
  192. package/script/deps/jsr.io/@std/assert/1.0.16/rejects.d.ts.map +1 -0
  193. package/script/deps/jsr.io/@std/assert/1.0.16/rejects.js +56 -0
  194. package/script/deps/jsr.io/@std/assert/1.0.16/strict_equals.d.ts +24 -0
  195. package/script/deps/jsr.io/@std/assert/1.0.16/strict_equals.d.ts.map +1 -0
  196. package/script/deps/jsr.io/@std/assert/1.0.16/strict_equals.js +61 -0
  197. package/script/deps/jsr.io/@std/assert/1.0.16/string_includes.d.ts +18 -0
  198. package/script/deps/jsr.io/@std/assert/1.0.16/string_includes.d.ts.map +1 -0
  199. package/script/deps/jsr.io/@std/assert/1.0.16/string_includes.js +29 -0
  200. package/script/deps/jsr.io/@std/assert/1.0.16/throws.d.ts +45 -0
  201. package/script/deps/jsr.io/@std/assert/1.0.16/throws.d.ts.map +1 -0
  202. package/script/deps/jsr.io/@std/assert/1.0.16/throws.js +47 -0
  203. package/script/deps/jsr.io/@std/assert/1.0.16/unimplemented.d.ts +15 -0
  204. package/script/deps/jsr.io/@std/assert/1.0.16/unimplemented.d.ts.map +1 -0
  205. package/script/deps/jsr.io/@std/assert/1.0.16/unimplemented.js +23 -0
  206. package/script/deps/jsr.io/@std/assert/1.0.16/unreachable.d.ts +15 -0
  207. package/script/deps/jsr.io/@std/assert/1.0.16/unreachable.d.ts.map +1 -0
  208. package/script/deps/jsr.io/@std/assert/1.0.16/unreachable.js +23 -0
  209. package/script/deps/jsr.io/@std/internal/1.0.12/build_message.d.ts +80 -0
  210. package/script/deps/jsr.io/@std/internal/1.0.12/build_message.d.ts.map +1 -0
  211. package/script/deps/jsr.io/@std/internal/1.0.12/build_message.js +121 -0
  212. package/script/deps/jsr.io/@std/internal/1.0.12/diff.d.ts +140 -0
  213. package/script/deps/jsr.io/@std/internal/1.0.12/diff.d.ts.map +1 -0
  214. package/script/deps/jsr.io/@std/internal/1.0.12/diff.js +283 -0
  215. package/script/deps/jsr.io/@std/internal/1.0.12/diff_str.d.ts +99 -0
  216. package/script/deps/jsr.io/@std/internal/1.0.12/diff_str.d.ts.map +1 -0
  217. package/script/deps/jsr.io/@std/internal/1.0.12/diff_str.js +188 -0
  218. package/script/deps/jsr.io/@std/internal/1.0.12/format.d.ts +29 -0
  219. package/script/deps/jsr.io/@std/internal/1.0.12/format.d.ts.map +1 -0
  220. package/script/deps/jsr.io/@std/internal/1.0.12/format.js +106 -0
  221. package/script/deps/jsr.io/@std/internal/1.0.12/styles.d.ts +159 -0
  222. package/script/deps/jsr.io/@std/internal/1.0.12/styles.d.ts.map +1 -0
  223. package/script/deps/jsr.io/@std/internal/1.0.12/styles.js +252 -0
  224. package/script/deps/jsr.io/@std/internal/1.0.12/types.d.ts +25 -0
  225. package/script/deps/jsr.io/@std/internal/1.0.12/types.d.ts.map +1 -0
  226. package/script/deps/jsr.io/@std/internal/1.0.12/types.js +4 -0
  227. package/script/message-channel.d.ts +3 -0
  228. package/script/message-channel.d.ts.map +1 -0
  229. package/script/message-channel.js +16 -0
  230. package/script/mod.d.ts +1 -0
  231. package/script/mod.d.ts.map +1 -1
  232. package/script/mod.js +1 -0
  233. package/script/types.d.ts +33 -0
  234. package/script/types.d.ts.map +1 -0
  235. package/script/types.js +2 -0
  236. package/script/worker-main.d.ts +84 -0
  237. package/script/worker-main.d.ts.map +1 -0
  238. package/script/worker-main.js +190 -0
  239. package/script/worker.d.ts +2 -74
  240. package/script/worker.d.ts.map +1 -1
  241. package/script/worker.js +5 -122
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Make an assertion that `actual` and `expected` are not equal, deeply.
3
+ * If not then throw.
4
+ *
5
+ * Type parameter can be specified to ensure values under comparison have the same type.
6
+ *
7
+ * @example Usage
8
+ * ```ts ignore
9
+ * import { assertNotEquals } from "@std/assert";
10
+ *
11
+ * assertNotEquals(1, 2); // Doesn't throw
12
+ * assertNotEquals(1, 1); // Throws
13
+ * ```
14
+ *
15
+ * @typeParam T The type of the values to compare.
16
+ * @param actual The actual value to compare.
17
+ * @param expected The expected value to compare.
18
+ * @param msg The optional message to display if the assertion fails.
19
+ */
20
+ export declare function assertNotEquals<T>(actual: T, expected: T, msg?: string): void;
21
+ //# sourceMappingURL=not_equals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"not_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/not_equals.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,QAUtE"}
@@ -0,0 +1,33 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ // This module is browser compatible.
3
+ import { equal } from "./equal.js";
4
+ import { AssertionError } from "./assertion_error.js";
5
+ import { format } from "../../internal/1.0.12/format.js";
6
+ /**
7
+ * Make an assertion that `actual` and `expected` are not equal, deeply.
8
+ * If not then throw.
9
+ *
10
+ * Type parameter can be specified to ensure values under comparison have the same type.
11
+ *
12
+ * @example Usage
13
+ * ```ts ignore
14
+ * import { assertNotEquals } from "@std/assert";
15
+ *
16
+ * assertNotEquals(1, 2); // Doesn't throw
17
+ * assertNotEquals(1, 1); // Throws
18
+ * ```
19
+ *
20
+ * @typeParam T The type of the values to compare.
21
+ * @param actual The actual value to compare.
22
+ * @param expected The expected value to compare.
23
+ * @param msg The optional message to display if the assertion fails.
24
+ */
25
+ export function assertNotEquals(actual, expected, msg) {
26
+ if (!equal(actual, expected)) {
27
+ return;
28
+ }
29
+ const actualString = format(actual);
30
+ const expectedString = format(expected);
31
+ const msgSuffix = msg ? `: ${msg}` : ".";
32
+ throw new AssertionError(`Expected actual: ${actualString} not to be: ${expectedString}${msgSuffix}`);
33
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Make an assertion that `obj` is not an instance of `type`.
3
+ * If so, then throw.
4
+ *
5
+ * @example Usage
6
+ * ```ts ignore
7
+ * import { assertNotInstanceOf } from "@std/assert";
8
+ *
9
+ * assertNotInstanceOf(new Date(), Number); // Doesn't throw
10
+ * assertNotInstanceOf(new Date(), Date); // Throws
11
+ * ```
12
+ *
13
+ * @typeParam A The type of the object to check.
14
+ * @typeParam T The type of the class to check against.
15
+ * @param actual The object to check.
16
+ * @param unexpectedType The class constructor to check against.
17
+ * @param msg The optional message to display if the assertion fails.
18
+ */
19
+ export declare function assertNotInstanceOf<A, T>(actual: A, unexpectedType: abstract new (...args: any[]) => T, msg?: string): asserts actual is Exclude<A, T>;
20
+ //# sourceMappingURL=not_instance_of.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"not_instance_of.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/not_instance_of.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,CAAC,EACtC,MAAM,EAAE,CAAC,EAET,cAAc,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAClD,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAKjC"}
@@ -0,0 +1,29 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ // This module is browser compatible.
3
+ import { assertFalse } from "./false.js";
4
+ /**
5
+ * Make an assertion that `obj` is not an instance of `type`.
6
+ * If so, then throw.
7
+ *
8
+ * @example Usage
9
+ * ```ts ignore
10
+ * import { assertNotInstanceOf } from "@std/assert";
11
+ *
12
+ * assertNotInstanceOf(new Date(), Number); // Doesn't throw
13
+ * assertNotInstanceOf(new Date(), Date); // Throws
14
+ * ```
15
+ *
16
+ * @typeParam A The type of the object to check.
17
+ * @typeParam T The type of the class to check against.
18
+ * @param actual The object to check.
19
+ * @param unexpectedType The class constructor to check against.
20
+ * @param msg The optional message to display if the assertion fails.
21
+ */
22
+ export function assertNotInstanceOf(actual,
23
+ // deno-lint-ignore no-explicit-any
24
+ unexpectedType, msg) {
25
+ const msgSuffix = msg ? `: ${msg}` : ".";
26
+ msg =
27
+ `Expected object to not be an instance of "${typeof unexpectedType}"${msgSuffix}`;
28
+ assertFalse(actual instanceof unexpectedType, msg);
29
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Make an assertion that `actual` not match RegExp `expected`. If match
3
+ * then throw.
4
+ *
5
+ * @example Usage
6
+ * ```ts ignore
7
+ * import { assertNotMatch } from "@std/assert";
8
+ *
9
+ * assertNotMatch("Denosaurus", /Raptor/); // Doesn't throw
10
+ * assertNotMatch("Raptor", /Raptor/); // Throws
11
+ * ```
12
+ *
13
+ * @param actual The actual value to match.
14
+ * @param expected The expected value to not match.
15
+ * @param msg The optional message to display if the assertion fails.
16
+ */
17
+ export declare function assertNotMatch(actual: string, expected: RegExp, msg?: string): void;
18
+ //# sourceMappingURL=not_match.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"not_match.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/not_match.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,GAAG,CAAC,EAAE,MAAM,QAMb"}
@@ -0,0 +1,26 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ // This module is browser compatible.
3
+ import { AssertionError } from "./assertion_error.js";
4
+ /**
5
+ * Make an assertion that `actual` not match RegExp `expected`. If match
6
+ * then throw.
7
+ *
8
+ * @example Usage
9
+ * ```ts ignore
10
+ * import { assertNotMatch } from "@std/assert";
11
+ *
12
+ * assertNotMatch("Denosaurus", /Raptor/); // Doesn't throw
13
+ * assertNotMatch("Raptor", /Raptor/); // Throws
14
+ * ```
15
+ *
16
+ * @param actual The actual value to match.
17
+ * @param expected The expected value to not match.
18
+ * @param msg The optional message to display if the assertion fails.
19
+ */
20
+ export function assertNotMatch(actual, expected, msg) {
21
+ if (!expected.test(actual))
22
+ return;
23
+ const msgSuffix = msg ? `: ${msg}` : ".";
24
+ msg = `Expected actual: "${actual}" to not match: "${expected}"${msgSuffix}`;
25
+ throw new AssertionError(msg);
26
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Make an assertion that `actual` and `expected` are not strictly equal, using
3
+ * {@linkcode Object.is} for equality comparison. If the values are strictly
4
+ * equal then throw.
5
+ *
6
+ * @example Usage
7
+ * ```ts ignore
8
+ * import { assertNotStrictEquals } from "@std/assert";
9
+ *
10
+ * assertNotStrictEquals(1, 1); // Throws
11
+ * assertNotStrictEquals(1, 2); // Doesn't throw
12
+ *
13
+ * assertNotStrictEquals(0, 0); // Throws
14
+ * assertNotStrictEquals(0, -0); // Doesn't throw
15
+ * ```
16
+ *
17
+ * @typeParam T The type of the values to compare.
18
+ * @param actual The actual value to compare.
19
+ * @param expected The expected value to compare.
20
+ * @param msg The optional message to display if the assertion fails.
21
+ */
22
+ export declare function assertNotStrictEquals<T>(actual: T, expected: T, msg?: string): void;
23
+ //# sourceMappingURL=not_strict_equals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"not_strict_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/not_strict_equals.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EACrC,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,CAAC,EACX,GAAG,CAAC,EAAE,MAAM,QAYb"}
@@ -0,0 +1,32 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ // This module is browser compatible.
3
+ import { AssertionError } from "./assertion_error.js";
4
+ import { format } from "../../internal/1.0.12/format.js";
5
+ /**
6
+ * Make an assertion that `actual` and `expected` are not strictly equal, using
7
+ * {@linkcode Object.is} for equality comparison. If the values are strictly
8
+ * equal then throw.
9
+ *
10
+ * @example Usage
11
+ * ```ts ignore
12
+ * import { assertNotStrictEquals } from "@std/assert";
13
+ *
14
+ * assertNotStrictEquals(1, 1); // Throws
15
+ * assertNotStrictEquals(1, 2); // Doesn't throw
16
+ *
17
+ * assertNotStrictEquals(0, 0); // Throws
18
+ * assertNotStrictEquals(0, -0); // Doesn't throw
19
+ * ```
20
+ *
21
+ * @typeParam T The type of the values to compare.
22
+ * @param actual The actual value to compare.
23
+ * @param expected The expected value to compare.
24
+ * @param msg The optional message to display if the assertion fails.
25
+ */
26
+ export function assertNotStrictEquals(actual, expected, msg) {
27
+ if (!Object.is(actual, expected)) {
28
+ return;
29
+ }
30
+ const msgSuffix = msg ? `: ${msg}` : ".";
31
+ throw new AssertionError(`Expected "actual" to not be strictly equal to: ${format(actual)}${msgSuffix}\n`);
32
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Make an assertion that `expected` object is a subset of `actual` object,
3
+ * deeply. If not, then throw a diff of the objects, with mismatching
4
+ * properties highlighted.
5
+ *
6
+ * @example Usage
7
+ * ```ts ignore
8
+ * import { assertObjectMatch } from "@std/assert";
9
+ *
10
+ * assertObjectMatch({ foo: "bar" }, { foo: "bar" }); // Doesn't throw
11
+ * assertObjectMatch({ foo: "bar" }, { foo: "baz" }); // Throws
12
+ * assertObjectMatch({ foo: 1, bar: 2 }, { foo: 1 }); // Doesn't throw
13
+ * assertObjectMatch({ foo: 1 }, { foo: 1, bar: 2 }); // Throws
14
+ * ```
15
+ *
16
+ * @example Usage with nested objects
17
+ * ```ts ignore
18
+ * import { assertObjectMatch } from "@std/assert";
19
+ *
20
+ * assertObjectMatch({ foo: { bar: 3, baz: 4 } }, { foo: { bar: 3 } }); // Doesn't throw
21
+ * assertObjectMatch({ foo: { bar: 3 } }, { foo: { bar: 3, baz: 4 } }); // Throws
22
+ * ```
23
+ *
24
+ * @param actual The actual value to be matched.
25
+ * @param expected The expected value to match.
26
+ * @param msg The optional message to display if the assertion fails.
27
+ */
28
+ export declare function assertObjectMatch(actual: Record<PropertyKey, any>, expected: Record<PropertyKey, unknown>, msg?: string): void;
29
+ //# sourceMappingURL=object_match.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object_match.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/object_match.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,iBAAiB,CAE/B,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,EAChC,QAAQ,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,EACtC,GAAG,CAAC,EAAE,MAAM,GACX,IAAI,CAUN"}
@@ -0,0 +1,167 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ // This module is browser compatible.
3
+ import { assertEquals } from "./equals.js";
4
+ /**
5
+ * Make an assertion that `expected` object is a subset of `actual` object,
6
+ * deeply. If not, then throw a diff of the objects, with mismatching
7
+ * properties highlighted.
8
+ *
9
+ * @example Usage
10
+ * ```ts ignore
11
+ * import { assertObjectMatch } from "@std/assert";
12
+ *
13
+ * assertObjectMatch({ foo: "bar" }, { foo: "bar" }); // Doesn't throw
14
+ * assertObjectMatch({ foo: "bar" }, { foo: "baz" }); // Throws
15
+ * assertObjectMatch({ foo: 1, bar: 2 }, { foo: 1 }); // Doesn't throw
16
+ * assertObjectMatch({ foo: 1 }, { foo: 1, bar: 2 }); // Throws
17
+ * ```
18
+ *
19
+ * @example Usage with nested objects
20
+ * ```ts ignore
21
+ * import { assertObjectMatch } from "@std/assert";
22
+ *
23
+ * assertObjectMatch({ foo: { bar: 3, baz: 4 } }, { foo: { bar: 3 } }); // Doesn't throw
24
+ * assertObjectMatch({ foo: { bar: 3 } }, { foo: { bar: 3, baz: 4 } }); // Throws
25
+ * ```
26
+ *
27
+ * @param actual The actual value to be matched.
28
+ * @param expected The expected value to match.
29
+ * @param msg The optional message to display if the assertion fails.
30
+ */
31
+ export function assertObjectMatch(
32
+ // deno-lint-ignore no-explicit-any
33
+ actual, expected, msg) {
34
+ return assertEquals(
35
+ // get the intersection of "actual" and "expected"
36
+ // side effect: all the instances' constructor field is "Object" now.
37
+ filter(actual, expected),
38
+ // set (nested) instances' constructor field to be "Object" without changing expected value.
39
+ // see https://github.com/denoland/std/pull/1419
40
+ filter(expected, expected), msg);
41
+ }
42
+ function isObject(val) {
43
+ return typeof val === "object" && val !== null;
44
+ }
45
+ function defineProperty(target, key, value) {
46
+ return Object.defineProperty(target, key, {
47
+ value,
48
+ configurable: true,
49
+ enumerable: true,
50
+ writable: true,
51
+ });
52
+ }
53
+ function filter(a, b) {
54
+ const seen = new WeakMap();
55
+ return filterObject(a, b);
56
+ function filterObject(a, b) {
57
+ // Prevent infinite loop with circular references with same filter
58
+ const memo = seen.get(a);
59
+ if (memo && (memo === b))
60
+ return a;
61
+ try {
62
+ seen.set(a, b);
63
+ }
64
+ catch (err) {
65
+ if (err instanceof TypeError) {
66
+ throw new TypeError(`Cannot assertObjectMatch ${a === null ? null : `type ${typeof a}`}`);
67
+ }
68
+ }
69
+ // Filter keys and symbols which are present in both actual and expected
70
+ const filtered = {};
71
+ const keysA = Reflect.ownKeys(a);
72
+ const keysB = Reflect.ownKeys(b);
73
+ const entries = keysA.filter((key) => keysB.includes(key))
74
+ .map((key) => [key, a[key]]);
75
+ if (keysA.length && keysB.length && !entries.length) {
76
+ // If both objects are not empty but don't have the same keys or symbols,
77
+ // returns the entries in object a.
78
+ for (const key of keysA)
79
+ defineProperty(filtered, key, a[key]);
80
+ return filtered;
81
+ }
82
+ for (const [key, value] of entries) {
83
+ // On regexp references, keep value as it to avoid losing pattern and flags
84
+ if (value instanceof RegExp) {
85
+ defineProperty(filtered, key, value);
86
+ continue;
87
+ }
88
+ const subset = b[key];
89
+ // On array references, build a filtered array and filter nested objects inside
90
+ if (Array.isArray(value) && Array.isArray(subset)) {
91
+ defineProperty(filtered, key, filterArray(value, subset));
92
+ continue;
93
+ }
94
+ // On nested objects references, build a filtered object recursively
95
+ if (isObject(value) && isObject(subset)) {
96
+ // When both operands are maps, build a filtered map with common keys and filter nested objects inside
97
+ if ((value instanceof Map) && (subset instanceof Map)) {
98
+ defineProperty(filtered, key, new Map([...value].filter(([k]) => subset.has(k)).map(([k, v]) => {
99
+ const v2 = subset.get(k);
100
+ if (isObject(v) && isObject(v2)) {
101
+ return [k, filterObject(v, v2)];
102
+ }
103
+ return [k, v];
104
+ })));
105
+ continue;
106
+ }
107
+ // When both operands are set, build a filtered set with common values
108
+ if ((value instanceof Set) && (subset instanceof Set)) {
109
+ defineProperty(filtered, key, value.intersection(subset));
110
+ continue;
111
+ }
112
+ defineProperty(filtered, key, filterObject(value, subset));
113
+ continue;
114
+ }
115
+ defineProperty(filtered, key, value);
116
+ }
117
+ return filtered;
118
+ }
119
+ function filterArray(a, b) {
120
+ // Prevent infinite loop with circular references with same filter
121
+ const memo = seen.get(a);
122
+ if (memo && (memo === b))
123
+ return a;
124
+ seen.set(a, b);
125
+ const filtered = [];
126
+ const count = Math.min(a.length, b.length);
127
+ for (let i = 0; i < count; ++i) {
128
+ const value = a[i];
129
+ const subset = b[i];
130
+ // On regexp references, keep value as it to avoid losing pattern and flags
131
+ if (value instanceof RegExp) {
132
+ filtered.push(value);
133
+ continue;
134
+ }
135
+ // On array references, build a filtered array and filter nested objects inside
136
+ if (Array.isArray(value) && Array.isArray(subset)) {
137
+ filtered.push(filterArray(value, subset));
138
+ continue;
139
+ }
140
+ // On nested objects references, build a filtered object recursively
141
+ if (isObject(value) && isObject(subset)) {
142
+ // When both operands are maps, build a filtered map with common keys and filter nested objects inside
143
+ if ((value instanceof Map) && (subset instanceof Map)) {
144
+ const map = new Map([...value].filter(([k]) => subset.has(k))
145
+ .map(([k, v]) => {
146
+ const v2 = subset.get(k);
147
+ if (isObject(v) && isObject(v2)) {
148
+ return [k, filterObject(v, v2)];
149
+ }
150
+ return [k, v];
151
+ }));
152
+ filtered.push(map);
153
+ continue;
154
+ }
155
+ // When both operands are set, build a filtered set with common values
156
+ if ((value instanceof Set) && (subset instanceof Set)) {
157
+ filtered.push(value.intersection(subset));
158
+ continue;
159
+ }
160
+ filtered.push(filterObject(value, subset));
161
+ continue;
162
+ }
163
+ filtered.push(value);
164
+ }
165
+ return filtered;
166
+ }
167
+ }
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Executes a function which returns a promise, expecting it to reject.
3
+ *
4
+ * To assert that a synchronous function throws, use {@linkcode assertThrows}.
5
+ *
6
+ * @example Usage
7
+ * ```ts ignore
8
+ * import { assertRejects } from "@std/assert";
9
+ *
10
+ * await assertRejects(async () => Promise.reject(new Error())); // Doesn't throw
11
+ * await assertRejects(async () => console.log("Hello world")); // Throws
12
+ * ```
13
+ *
14
+ * @param fn The function to execute.
15
+ * @param msg The optional message to display if the assertion fails.
16
+ * @returns The promise which resolves to the thrown error.
17
+ */
18
+ export declare function assertRejects(fn: () => PromiseLike<unknown>, msg?: string): Promise<unknown>;
19
+ /**
20
+ * Executes a function which returns a promise, expecting it to reject.
21
+ * If it does not, then it throws. An error class and a string that should be
22
+ * included in the error message can also be asserted.
23
+ *
24
+ * To assert that a synchronous function throws, use {@linkcode assertThrows}.
25
+ *
26
+ * @example Usage
27
+ * ```ts ignore
28
+ * import { assertRejects } from "@std/assert";
29
+ *
30
+ * await assertRejects(async () => Promise.reject(new Error()), Error); // Doesn't throw
31
+ * await assertRejects(async () => Promise.reject(new Error()), SyntaxError); // Throws
32
+ * ```
33
+ *
34
+ * @typeParam E The error class to assert.
35
+ * @param fn The function to execute.
36
+ * @param ErrorClass The error class to assert.
37
+ * @param msgIncludes The string that should be included in the error message.
38
+ * @param msg The optional message to display if the assertion fails.
39
+ * @returns The promise which resolves to the thrown error.
40
+ */
41
+ export declare function assertRejects<E extends Error = Error>(fn: () => PromiseLike<unknown>, ErrorClass: abstract new (...args: any[]) => E, msgIncludes?: string, msg?: string): Promise<E>;
42
+ //# sourceMappingURL=rejects.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rejects.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/rejects.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,MAAM,WAAW,CAAC,OAAO,CAAC,EAC9B,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,OAAO,CAAC,CAAC;AACpB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,EACnD,EAAE,EAAE,MAAM,WAAW,CAAC,OAAO,CAAC,EAE9B,UAAU,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAC9C,WAAW,CAAC,EAAE,MAAM,EACpB,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,53 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ // This module is browser compatible.
3
+ import { AssertionError } from "./assertion_error.js";
4
+ import { assertIsError } from "./is_error.js";
5
+ export async function assertRejects(fn, errorClassOrMsg, msgIncludesOrMsg, msg) {
6
+ // deno-lint-ignore no-explicit-any
7
+ let ErrorClass;
8
+ let msgIncludes;
9
+ let err;
10
+ if (typeof errorClassOrMsg !== "string") {
11
+ if (errorClassOrMsg === undefined ||
12
+ errorClassOrMsg.prototype instanceof Error ||
13
+ errorClassOrMsg.prototype === Error.prototype) {
14
+ ErrorClass = errorClassOrMsg;
15
+ msgIncludes = msgIncludesOrMsg;
16
+ }
17
+ }
18
+ else {
19
+ msg = errorClassOrMsg;
20
+ }
21
+ let doesThrow = false;
22
+ let isPromiseReturned = false;
23
+ const msgSuffix = msg ? `: ${msg}` : ".";
24
+ try {
25
+ const possiblePromise = fn();
26
+ if (possiblePromise &&
27
+ typeof possiblePromise === "object" &&
28
+ typeof possiblePromise.then === "function") {
29
+ isPromiseReturned = true;
30
+ await possiblePromise;
31
+ }
32
+ else {
33
+ throw new Error();
34
+ }
35
+ }
36
+ catch (error) {
37
+ if (!isPromiseReturned) {
38
+ throw new AssertionError(`Function throws when expected to reject${msgSuffix}`);
39
+ }
40
+ if (ErrorClass) {
41
+ if (!(error instanceof Error)) {
42
+ throw new AssertionError(`A non-Error object was rejected${msgSuffix}`);
43
+ }
44
+ assertIsError(error, ErrorClass, msgIncludes, msg);
45
+ }
46
+ err = error;
47
+ doesThrow = true;
48
+ }
49
+ if (!doesThrow) {
50
+ throw new AssertionError(`Expected function to reject${msgSuffix}`);
51
+ }
52
+ return err;
53
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Make an assertion that `actual` and `expected` are strictly equal, using
3
+ * {@linkcode Object.is} for equality comparison. If not, then throw.
4
+ *
5
+ * @example Usage
6
+ * ```ts ignore
7
+ * import { assertStrictEquals } from "@std/assert";
8
+ *
9
+ * const a = {};
10
+ * const b = a;
11
+ * assertStrictEquals(a, b); // Doesn't throw
12
+ *
13
+ * const c = {};
14
+ * const d = {};
15
+ * assertStrictEquals(c, d); // Throws
16
+ * ```
17
+ *
18
+ * @typeParam T The type of the expected value.
19
+ * @param actual The actual value to compare.
20
+ * @param expected The expected value to compare.
21
+ * @param msg The optional message to display if the assertion fails.
22
+ */
23
+ export declare function assertStrictEquals<T>(actual: unknown, expected: T, msg?: string): asserts actual is T;
24
+ //# sourceMappingURL=strict_equals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strict_equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/strict_equals.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,CAAC,EACX,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,IAAI,CAAC,CAgCrB"}
@@ -0,0 +1,58 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ // This module is browser compatible.
3
+ import { buildMessage } from "../../internal/1.0.12/build_message.js";
4
+ import { diff } from "../../internal/1.0.12/diff.js";
5
+ import { diffStr } from "../../internal/1.0.12/diff_str.js";
6
+ import { format } from "../../internal/1.0.12/format.js";
7
+ import { red } from "../../internal/1.0.12/styles.js";
8
+ import { AssertionError } from "./assertion_error.js";
9
+ /**
10
+ * Make an assertion that `actual` and `expected` are strictly equal, using
11
+ * {@linkcode Object.is} for equality comparison. If not, then throw.
12
+ *
13
+ * @example Usage
14
+ * ```ts ignore
15
+ * import { assertStrictEquals } from "@std/assert";
16
+ *
17
+ * const a = {};
18
+ * const b = a;
19
+ * assertStrictEquals(a, b); // Doesn't throw
20
+ *
21
+ * const c = {};
22
+ * const d = {};
23
+ * assertStrictEquals(c, d); // Throws
24
+ * ```
25
+ *
26
+ * @typeParam T The type of the expected value.
27
+ * @param actual The actual value to compare.
28
+ * @param expected The expected value to compare.
29
+ * @param msg The optional message to display if the assertion fails.
30
+ */
31
+ export function assertStrictEquals(actual, expected, msg) {
32
+ if (Object.is(actual, expected)) {
33
+ return;
34
+ }
35
+ const msgSuffix = msg ? `: ${msg}` : ".";
36
+ let message;
37
+ const actualString = format(actual);
38
+ const expectedString = format(expected);
39
+ if (actualString === expectedString) {
40
+ const withOffset = actualString
41
+ .split("\n")
42
+ .map((l) => ` ${l}`)
43
+ .join("\n");
44
+ message =
45
+ `Values have the same structure but are not reference-equal${msgSuffix}\n\n${red(withOffset)}\n`;
46
+ }
47
+ else {
48
+ const stringDiff = (typeof actual === "string") &&
49
+ (typeof expected === "string");
50
+ const diffResult = stringDiff
51
+ ? diffStr(actual, expected)
52
+ : diff(actualString.split("\n"), expectedString.split("\n"));
53
+ const diffMsg = buildMessage(diffResult, { stringDiff }, arguments[3])
54
+ .join("\n");
55
+ message = `Values are not strictly equal${msgSuffix}\n${diffMsg}`;
56
+ }
57
+ throw new AssertionError(message);
58
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Make an assertion that actual includes expected. If not
3
+ * then throw.
4
+ *
5
+ * @example Usage
6
+ * ```ts ignore
7
+ * import { assertStringIncludes } from "@std/assert";
8
+ *
9
+ * assertStringIncludes("Hello", "ello"); // Doesn't throw
10
+ * assertStringIncludes("Hello", "world"); // Throws
11
+ * ```
12
+ *
13
+ * @param actual The actual string to check for inclusion.
14
+ * @param expected The expected string to check for inclusion.
15
+ * @param msg The optional message to display if the assertion fails.
16
+ */
17
+ export declare function assertStringIncludes(actual: string, expected: string, msg?: string): void;
18
+ //# sourceMappingURL=string_includes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string_includes.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.16/string_includes.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,GAAG,CAAC,EAAE,MAAM,QAMb"}