@kensio/smartass 1.16.0 → 1.17.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 (305) hide show
  1. package/dist/assert/array-includes/array-includes.assert.d.ts +3 -8
  2. package/dist/assert/array-includes/array-includes.assert.d.ts.map +1 -1
  3. package/dist/assert/array-includes/array-includes.assert.js.map +1 -1
  4. package/dist/assert/array-includes/array-includes.match.d.ts +1 -6
  5. package/dist/assert/array-includes/array-includes.match.d.ts.map +1 -1
  6. package/dist/assert/array-includes/array-includes.match.js +7 -1
  7. package/dist/assert/array-includes/array-includes.match.js.map +1 -1
  8. package/dist/assert/array-includes/array-includes.type.d.ts +44 -0
  9. package/dist/assert/array-includes/array-includes.type.d.ts.map +1 -0
  10. package/dist/assert/array-includes/array-includes.type.js +8 -0
  11. package/dist/assert/array-includes/array-includes.type.js.map +1 -0
  12. package/dist/assert/array-includes-all/array-includes-all.assert.d.ts +3 -7
  13. package/dist/assert/array-includes-all/array-includes-all.assert.d.ts.map +1 -1
  14. package/dist/assert/array-includes-all/array-includes-all.assert.js +27 -5
  15. package/dist/assert/array-includes-all/array-includes-all.assert.js.map +1 -1
  16. package/dist/assert/array-includes-all/array-includes-all.match.d.ts +3 -8
  17. package/dist/assert/array-includes-all/array-includes-all.match.d.ts.map +1 -1
  18. package/dist/assert/array-includes-all/array-includes-all.match.js +16 -3
  19. package/dist/assert/array-includes-all/array-includes-all.match.js.map +1 -1
  20. package/dist/assert/array-includes-all/array-includes-all.type.d.ts +51 -0
  21. package/dist/assert/array-includes-all/array-includes-all.type.d.ts.map +1 -0
  22. package/dist/assert/array-includes-all/array-includes-all.type.js +2 -0
  23. package/dist/assert/array-includes-all/array-includes-all.type.js.map +1 -0
  24. package/dist/assert/array-length/array-length.assert.d.ts +3 -9
  25. package/dist/assert/array-length/array-length.assert.d.ts.map +1 -1
  26. package/dist/assert/array-length/array-length.assert.js +7 -4
  27. package/dist/assert/array-length/array-length.assert.js.map +1 -1
  28. package/dist/assert/array-length/array-length.match.d.ts +1 -9
  29. package/dist/assert/array-length/array-length.match.d.ts.map +1 -1
  30. package/dist/assert/array-length/array-length.match.js +8 -2
  31. package/dist/assert/array-length/array-length.match.js.map +1 -1
  32. package/dist/assert/array-length/array-length.type.d.ts +37 -0
  33. package/dist/assert/array-length/array-length.type.d.ts.map +1 -0
  34. package/dist/assert/array-length/array-length.type.js +8 -0
  35. package/dist/assert/array-length/array-length.type.js.map +1 -0
  36. package/dist/assert/array-min-length/array-min-length.assert.d.ts +3 -9
  37. package/dist/assert/array-min-length/array-min-length.assert.d.ts.map +1 -1
  38. package/dist/assert/array-min-length/array-min-length.assert.js +10 -6
  39. package/dist/assert/array-min-length/array-min-length.assert.js.map +1 -1
  40. package/dist/assert/array-min-length/array-min-length.match.d.ts +1 -3
  41. package/dist/assert/array-min-length/array-min-length.match.d.ts.map +1 -1
  42. package/dist/assert/array-min-length/array-min-length.match.js +7 -1
  43. package/dist/assert/array-min-length/array-min-length.match.js.map +1 -1
  44. package/dist/assert/array-min-length/array-min-length.type.d.ts +35 -0
  45. package/dist/assert/array-min-length/array-min-length.type.d.ts.map +1 -0
  46. package/dist/assert/array-min-length/array-min-length.type.js +8 -0
  47. package/dist/assert/array-min-length/array-min-length.type.js.map +1 -0
  48. package/dist/assert/array-not-empty/array-not-empty.assert.d.ts +3 -5
  49. package/dist/assert/array-not-empty/array-not-empty.assert.d.ts.map +1 -1
  50. package/dist/assert/array-not-empty/array-not-empty.assert.js +8 -3
  51. package/dist/assert/array-not-empty/array-not-empty.assert.js.map +1 -1
  52. package/dist/assert/array-not-empty/array-not-empty.match.d.ts +1 -3
  53. package/dist/assert/array-not-empty/array-not-empty.match.d.ts.map +1 -1
  54. package/dist/assert/array-not-empty/array-not-empty.match.js +7 -1
  55. package/dist/assert/array-not-empty/array-not-empty.match.js.map +1 -1
  56. package/dist/assert/array-not-empty/array-not-empty.type.d.ts +35 -0
  57. package/dist/assert/array-not-empty/array-not-empty.type.d.ts.map +1 -0
  58. package/dist/assert/array-not-empty/array-not-empty.type.js +8 -0
  59. package/dist/assert/array-not-empty/array-not-empty.type.js.map +1 -0
  60. package/dist/assert/buffer-equal/buffer-equal.assert.d.ts +1 -1
  61. package/dist/assert/buffer-equal/buffer-equal.assert.d.ts.map +1 -1
  62. package/dist/assert/buffer-equal/buffer-equal.assert.js.map +1 -1
  63. package/dist/assert/buffer-equal/buffer-equal.match.d.ts +3 -3
  64. package/dist/assert/buffer-equal/buffer-equal.match.d.ts.map +1 -1
  65. package/dist/assert/buffer-equal/buffer-equal.match.js +20 -11
  66. package/dist/assert/buffer-equal/buffer-equal.match.js.map +1 -1
  67. package/dist/assert/buffer-equal/buffer-equal.type.d.ts +32 -0
  68. package/dist/assert/buffer-equal/buffer-equal.type.d.ts.map +1 -0
  69. package/dist/assert/buffer-equal/buffer-equal.type.js +8 -0
  70. package/dist/assert/buffer-equal/buffer-equal.type.js.map +1 -0
  71. package/dist/assert/identical/identical.assert.d.ts +1 -1
  72. package/dist/assert/identical/identical.assert.d.ts.map +1 -1
  73. package/dist/assert/instance-of/instance-of.assert.d.ts +3 -5
  74. package/dist/assert/instance-of/instance-of.assert.d.ts.map +1 -1
  75. package/dist/assert/instance-of/instance-of.assert.js.map +1 -1
  76. package/dist/assert/instance-of/instance-of.match.d.ts +2 -3
  77. package/dist/assert/instance-of/instance-of.match.d.ts.map +1 -1
  78. package/dist/assert/instance-of/instance-of.match.js +7 -1
  79. package/dist/assert/instance-of/instance-of.match.js.map +1 -1
  80. package/dist/assert/instance-of/instance-of.type.d.ts +42 -0
  81. package/dist/assert/instance-of/instance-of.type.d.ts.map +1 -0
  82. package/dist/assert/instance-of/instance-of.type.js +8 -0
  83. package/dist/assert/instance-of/instance-of.type.js.map +1 -0
  84. package/dist/assert/map-size/map-size.assert.d.ts +4 -0
  85. package/dist/assert/map-size/map-size.assert.d.ts.map +1 -0
  86. package/dist/assert/map-size/map-size.assert.js +19 -0
  87. package/dist/assert/map-size/map-size.assert.js.map +1 -0
  88. package/dist/assert/map-size/map-size.match.d.ts +6 -0
  89. package/dist/assert/map-size/map-size.match.d.ts.map +1 -0
  90. package/dist/assert/map-size/map-size.match.js +15 -0
  91. package/dist/assert/map-size/map-size.match.js.map +1 -0
  92. package/dist/assert/map-size/map-size.type.d.ts +33 -0
  93. package/dist/assert/map-size/map-size.type.d.ts.map +1 -0
  94. package/dist/assert/map-size/map-size.type.js +8 -0
  95. package/dist/assert/map-size/map-size.type.js.map +1 -0
  96. package/dist/assert/non-nullable/non-nullable.match.d.ts +2 -2
  97. package/dist/assert/non-nullable/non-nullable.match.d.ts.map +1 -1
  98. package/dist/assert/non-nullable/non-nullable.match.js.map +1 -1
  99. package/dist/assert/non-nullable/non-nullable.type.d.ts +5 -0
  100. package/dist/assert/non-nullable/non-nullable.type.d.ts.map +1 -0
  101. package/dist/assert/non-nullable/non-nullable.type.js +2 -0
  102. package/dist/assert/non-nullable/non-nullable.type.js.map +1 -0
  103. package/dist/assert/number-to-nearest/number-to-nearest.assert.d.ts +1 -1
  104. package/dist/assert/number-to-nearest/number-to-nearest.assert.d.ts.map +1 -1
  105. package/dist/assert/number-to-nearest/number-to-nearest.assert.js +2 -2
  106. package/dist/assert/number-to-nearest/number-to-nearest.assert.js.map +1 -1
  107. package/dist/assert/number-to-nearest/number-to-nearest.match.d.ts +1 -1
  108. package/dist/assert/number-to-nearest/number-to-nearest.match.d.ts.map +1 -1
  109. package/dist/assert/number-to-nearest/number-to-nearest.match.js +1 -1
  110. package/dist/assert/number-to-nearest/number-to-nearest.match.js.map +1 -1
  111. package/dist/assert/object-has-property/object-has-property.assert.d.ts +3 -6
  112. package/dist/assert/object-has-property/object-has-property.assert.d.ts.map +1 -1
  113. package/dist/assert/object-has-property/object-has-property.assert.js +1 -1
  114. package/dist/assert/object-has-property/object-has-property.assert.js.map +1 -1
  115. package/dist/assert/object-has-property/object-has-property.match.d.ts +1 -7
  116. package/dist/assert/object-has-property/object-has-property.match.d.ts.map +1 -1
  117. package/dist/assert/object-has-property/object-has-property.match.js +1 -1
  118. package/dist/assert/object-has-property/object-has-property.match.js.map +1 -1
  119. package/dist/assert/object-has-property/object-has-property.type.d.ts +8 -0
  120. package/dist/assert/object-has-property/object-has-property.type.d.ts.map +1 -0
  121. package/dist/assert/object-has-property/object-has-property.type.js +2 -0
  122. package/dist/assert/object-has-property/object-has-property.type.js.map +1 -0
  123. package/dist/assert/object-matches/object-matches.assert.d.ts +1 -28
  124. package/dist/assert/object-matches/object-matches.assert.d.ts.map +1 -1
  125. package/dist/assert/object-matches/object-matches.assert.js.map +1 -1
  126. package/dist/assert/object-matches/object-matches.type.d.ts +155 -0
  127. package/dist/assert/object-matches/object-matches.type.d.ts.map +1 -0
  128. package/dist/assert/object-matches/object-matches.type.js +2 -0
  129. package/dist/assert/object-matches/object-matches.type.js.map +1 -0
  130. package/dist/assert/one-of/one-of.assert.d.ts +5 -3
  131. package/dist/assert/one-of/one-of.assert.d.ts.map +1 -1
  132. package/dist/assert/one-of/one-of.assert.js.map +1 -1
  133. package/dist/assert/one-of/one-of.match.d.ts +2 -2
  134. package/dist/assert/one-of/one-of.match.d.ts.map +1 -1
  135. package/dist/assert/one-of/one-of.match.js +7 -1
  136. package/dist/assert/one-of/one-of.match.js.map +1 -1
  137. package/dist/assert/one-of/one-of.type.d.ts +33 -0
  138. package/dist/assert/one-of/one-of.type.d.ts.map +1 -0
  139. package/dist/assert/one-of/one-of.type.js +8 -0
  140. package/dist/assert/one-of/one-of.type.js.map +1 -0
  141. package/dist/assert/string-ends-with/string-ends-with.assert.d.ts +3 -4
  142. package/dist/assert/string-ends-with/string-ends-with.assert.d.ts.map +1 -1
  143. package/dist/assert/string-ends-with/string-ends-with.assert.js.map +1 -1
  144. package/dist/assert/string-ends-with/string-ends-with.match.d.ts +2 -2
  145. package/dist/assert/string-ends-with/string-ends-with.match.d.ts.map +1 -1
  146. package/dist/assert/string-ends-with/string-ends-with.match.js +7 -1
  147. package/dist/assert/string-ends-with/string-ends-with.match.js.map +1 -1
  148. package/dist/assert/string-ends-with/string-ends-with.type.d.ts +39 -0
  149. package/dist/assert/string-ends-with/string-ends-with.type.d.ts.map +1 -0
  150. package/dist/assert/string-ends-with/string-ends-with.type.js +8 -0
  151. package/dist/assert/string-ends-with/string-ends-with.type.js.map +1 -0
  152. package/dist/assert/string-includes/string-includes.assert.d.ts +3 -4
  153. package/dist/assert/string-includes/string-includes.assert.d.ts.map +1 -1
  154. package/dist/assert/string-includes/string-includes.assert.js.map +1 -1
  155. package/dist/assert/string-includes/string-includes.match.d.ts +2 -2
  156. package/dist/assert/string-includes/string-includes.match.d.ts.map +1 -1
  157. package/dist/assert/string-includes/string-includes.match.js +7 -1
  158. package/dist/assert/string-includes/string-includes.match.js.map +1 -1
  159. package/dist/assert/string-includes/string-includes.type.d.ts +39 -0
  160. package/dist/assert/string-includes/string-includes.type.d.ts.map +1 -0
  161. package/dist/assert/string-includes/string-includes.type.js +8 -0
  162. package/dist/assert/string-includes/string-includes.type.js.map +1 -0
  163. package/dist/assert/string-length/string-length.assert.d.ts +3 -14
  164. package/dist/assert/string-length/string-length.assert.d.ts.map +1 -1
  165. package/dist/assert/string-length/string-length.assert.js +7 -2
  166. package/dist/assert/string-length/string-length.assert.js.map +1 -1
  167. package/dist/assert/string-length/string-length.match.d.ts +1 -93
  168. package/dist/assert/string-length/string-length.match.d.ts.map +1 -1
  169. package/dist/assert/string-length/string-length.match.js +8 -2
  170. package/dist/assert/string-length/string-length.match.js.map +1 -1
  171. package/dist/assert/string-length/string-length.type.d.ts +132 -0
  172. package/dist/assert/string-length/string-length.type.d.ts.map +1 -0
  173. package/dist/assert/string-length/string-length.type.js +8 -0
  174. package/dist/assert/string-length/string-length.type.js.map +1 -0
  175. package/dist/assert/string-not-includes/string-not-includes.assert.d.ts +4 -4
  176. package/dist/assert/string-not-includes/string-not-includes.assert.d.ts.map +1 -1
  177. package/dist/assert/string-not-includes/string-not-includes.assert.js +7 -2
  178. package/dist/assert/string-not-includes/string-not-includes.assert.js.map +1 -1
  179. package/dist/assert/string-not-includes/string-not-includes.match.d.ts +2 -2
  180. package/dist/assert/string-not-includes/string-not-includes.match.d.ts.map +1 -1
  181. package/dist/assert/string-not-includes/string-not-includes.match.js +8 -2
  182. package/dist/assert/string-not-includes/string-not-includes.match.js.map +1 -1
  183. package/dist/assert/string-not-includes/string-not-includes.type.d.ts +30 -0
  184. package/dist/assert/string-not-includes/string-not-includes.type.d.ts.map +1 -0
  185. package/dist/assert/string-not-includes/string-not-includes.type.js +8 -0
  186. package/dist/assert/string-not-includes/string-not-includes.type.js.map +1 -0
  187. package/dist/assert/string-starts-with/string-starts-with.assert.d.ts +4 -4
  188. package/dist/assert/string-starts-with/string-starts-with.assert.d.ts.map +1 -1
  189. package/dist/assert/string-starts-with/string-starts-with.assert.js +7 -2
  190. package/dist/assert/string-starts-with/string-starts-with.assert.js.map +1 -1
  191. package/dist/assert/string-starts-with/string-starts-with.match.d.ts +2 -2
  192. package/dist/assert/string-starts-with/string-starts-with.match.d.ts.map +1 -1
  193. package/dist/assert/string-starts-with/string-starts-with.match.js +7 -1
  194. package/dist/assert/string-starts-with/string-starts-with.match.js.map +1 -1
  195. package/dist/assert/string-starts-with/string-starts-with.type.d.ts +39 -0
  196. package/dist/assert/string-starts-with/string-starts-with.type.d.ts.map +1 -0
  197. package/dist/assert/string-starts-with/string-starts-with.type.js +8 -0
  198. package/dist/assert/string-starts-with/string-starts-with.type.js.map +1 -0
  199. package/dist/assert/throws-error-like/throws-error-like.assert.d.ts +1 -5
  200. package/dist/assert/throws-error-like/throws-error-like.assert.d.ts.map +1 -1
  201. package/dist/assert/throws-error-like/throws-error-like.assert.js.map +1 -1
  202. package/dist/assert/throws-error-like/throws-error-like.type.d.ts +6 -0
  203. package/dist/assert/throws-error-like/throws-error-like.type.d.ts.map +1 -0
  204. package/dist/assert/throws-error-like/throws-error-like.type.js +2 -0
  205. package/dist/assert/throws-error-like/throws-error-like.type.js.map +1 -0
  206. package/dist/assert/type-bigint/type-bigint.match.d.ts +2 -2
  207. package/dist/assert/type-bigint/type-bigint.match.d.ts.map +1 -1
  208. package/dist/assert/type-bigint/type-bigint.match.js.map +1 -1
  209. package/dist/assert/type-bigint/type-bigint.type.d.ts +21 -0
  210. package/dist/assert/type-bigint/type-bigint.type.d.ts.map +1 -0
  211. package/dist/assert/type-bigint/type-bigint.type.js +2 -0
  212. package/dist/assert/type-bigint/type-bigint.type.js.map +1 -0
  213. package/dist/assert/type-boolean/type-boolean.match.d.ts +2 -2
  214. package/dist/assert/type-boolean/type-boolean.match.d.ts.map +1 -1
  215. package/dist/assert/type-boolean/type-boolean.match.js +7 -1
  216. package/dist/assert/type-boolean/type-boolean.match.js.map +1 -1
  217. package/dist/assert/type-boolean/type-boolean.type.d.ts +30 -0
  218. package/dist/assert/type-boolean/type-boolean.type.d.ts.map +1 -0
  219. package/dist/assert/type-boolean/type-boolean.type.js +9 -0
  220. package/dist/assert/type-boolean/type-boolean.type.js.map +1 -0
  221. package/dist/assert/type-function/type-function.assert.d.ts.map +1 -1
  222. package/dist/assert/type-function/type-function.assert.js.map +1 -1
  223. package/dist/assert/type-function/type-function.match.d.ts +2 -2
  224. package/dist/assert/type-function/type-function.match.d.ts.map +1 -1
  225. package/dist/assert/type-function/type-function.match.js +7 -4
  226. package/dist/assert/type-function/type-function.match.js.map +1 -1
  227. package/dist/assert/type-function/type-function.type.d.ts +29 -0
  228. package/dist/assert/type-function/type-function.type.d.ts.map +1 -0
  229. package/dist/assert/type-function/type-function.type.js +8 -0
  230. package/dist/assert/type-function/type-function.type.js.map +1 -0
  231. package/dist/assert/type-number/type-number.match.d.ts +2 -2
  232. package/dist/assert/type-number/type-number.match.d.ts.map +1 -1
  233. package/dist/assert/type-number/type-number.match.js +7 -1
  234. package/dist/assert/type-number/type-number.match.js.map +1 -1
  235. package/dist/assert/type-number/type-number.type.d.ts +30 -0
  236. package/dist/assert/type-number/type-number.type.d.ts.map +1 -0
  237. package/dist/assert/type-number/type-number.type.js +9 -0
  238. package/dist/assert/type-number/type-number.type.js.map +1 -0
  239. package/dist/assert/type-numeric/type-numeric.match.d.ts +2 -2
  240. package/dist/assert/type-numeric/type-numeric.match.d.ts.map +1 -1
  241. package/dist/assert/type-numeric/type-numeric.match.js +7 -1
  242. package/dist/assert/type-numeric/type-numeric.match.js.map +1 -1
  243. package/dist/assert/type-numeric/type-numeric.type.d.ts +33 -0
  244. package/dist/assert/type-numeric/type-numeric.type.d.ts.map +1 -0
  245. package/dist/assert/type-numeric/type-numeric.type.js +9 -0
  246. package/dist/assert/type-numeric/type-numeric.type.js.map +1 -0
  247. package/dist/assert/type-object/type-object.match.d.ts +2 -2
  248. package/dist/assert/type-object/type-object.match.d.ts.map +1 -1
  249. package/dist/assert/type-object/type-object.match.js +7 -1
  250. package/dist/assert/type-object/type-object.match.js.map +1 -1
  251. package/dist/assert/type-object/type-object.type.d.ts +33 -0
  252. package/dist/assert/type-object/type-object.type.d.ts.map +1 -0
  253. package/dist/assert/type-object/type-object.type.js +8 -0
  254. package/dist/assert/type-object/type-object.type.js.map +1 -0
  255. package/dist/assert/type-string/type-string.match.d.ts +2 -2
  256. package/dist/assert/type-string/type-string.match.d.ts.map +1 -1
  257. package/dist/assert/type-string/type-string.match.js +7 -1
  258. package/dist/assert/type-string/type-string.match.js.map +1 -1
  259. package/dist/assert/type-string/type-string.type.d.ts +30 -0
  260. package/dist/assert/type-string/type-string.type.d.ts.map +1 -0
  261. package/dist/assert/type-string/type-string.type.js +9 -0
  262. package/dist/assert/type-string/type-string.type.js.map +1 -0
  263. package/dist/assert/type-symbol/type-symbol.assert.d.ts +5 -0
  264. package/dist/assert/type-symbol/type-symbol.assert.d.ts.map +1 -0
  265. package/dist/assert/type-symbol/type-symbol.assert.js +13 -0
  266. package/dist/assert/type-symbol/type-symbol.assert.js.map +1 -0
  267. package/dist/assert/type-symbol/type-symbol.match.d.ts +6 -0
  268. package/dist/assert/type-symbol/type-symbol.match.d.ts.map +1 -0
  269. package/dist/assert/type-symbol/type-symbol.match.js +14 -0
  270. package/dist/assert/type-symbol/type-symbol.match.js.map +1 -0
  271. package/dist/assert/type-symbol/type-symbol.type.d.ts +30 -0
  272. package/dist/assert/type-symbol/type-symbol.type.d.ts.map +1 -0
  273. package/dist/assert/type-symbol/type-symbol.type.js +9 -0
  274. package/dist/assert/type-symbol/type-symbol.type.js.map +1 -0
  275. package/dist/assert/type-typed-array/type-typed-array.assert.d.ts +1 -1
  276. package/dist/assert/type-typed-array/type-typed-array.assert.d.ts.map +1 -1
  277. package/dist/assert/type-typed-array/type-typed-array.assert.js.map +1 -1
  278. package/dist/assert/type-typed-array/type-typed-array.match.d.ts +2 -6
  279. package/dist/assert/type-typed-array/type-typed-array.match.d.ts.map +1 -1
  280. package/dist/assert/type-typed-array/type-typed-array.match.js +7 -1
  281. package/dist/assert/type-typed-array/type-typed-array.match.js.map +1 -1
  282. package/dist/assert/type-typed-array/type-typed-array.type.d.ts +33 -0
  283. package/dist/assert/type-typed-array/type-typed-array.type.d.ts.map +1 -0
  284. package/dist/assert/type-typed-array/type-typed-array.type.js +8 -0
  285. package/dist/assert/type-typed-array/type-typed-array.type.js.map +1 -0
  286. package/dist/assert/uuid/uuid-v4.assert.d.ts +2 -4
  287. package/dist/assert/uuid/uuid-v4.assert.d.ts.map +1 -1
  288. package/dist/assert/uuid/uuid-v4.assert.js +2 -2
  289. package/dist/assert/uuid/uuid-v4.assert.js.map +1 -1
  290. package/dist/assert/uuid/uuid-v4.match.d.ts +2 -4
  291. package/dist/assert/uuid/uuid-v4.match.d.ts.map +1 -1
  292. package/dist/assert/uuid/uuid-v4.match.js +7 -1
  293. package/dist/assert/uuid/uuid-v4.match.js.map +1 -1
  294. package/dist/assert/uuid/uuid-v4.type.d.ts +34 -0
  295. package/dist/assert/uuid/uuid-v4.type.d.ts.map +1 -0
  296. package/dist/assert/uuid/uuid-v4.type.js +8 -0
  297. package/dist/assert/uuid/uuid-v4.type.js.map +1 -0
  298. package/dist/index.d.ts +4 -1
  299. package/dist/index.d.ts.map +1 -1
  300. package/dist/index.js +4 -1
  301. package/dist/index.js.map +1 -1
  302. package/dist/match/match.d.ts +37 -1
  303. package/dist/match/match.d.ts.map +1 -1
  304. package/dist/match/match.js.map +1 -1
  305. package/package.json +1 -1
@@ -1,9 +1,15 @@
1
1
  import { createMatcher } from "../../match/match.js";
2
2
  import { repr } from "../../describe/describe.js";
3
+ import { arrayOfMinLengthMatcher, } from "./array-min-length.type.js";
3
4
  /**
4
5
  * Matcher for an array with at least the expected minimum length.
5
6
  */
6
7
  export function arrayOfMinLength(minLength) {
7
- return createMatcher((value) => Array.isArray(value) && value.length >= minLength, () => `array of at least ${repr(minLength)} elements`, () => `Array(>=${repr(minLength)})`);
8
+ return {
9
+ ...createMatcher((value) => Array.isArray(value) && value.length >= minLength, () => `array of at least ${repr(minLength)} elements`, () => `Array(>=${repr(minLength)})`),
10
+ // Runtime marker used only to make the matcher type nominal for type-level
11
+ // refinement dispatch. It is not part of the user-facing matcher behaviour.
12
+ [arrayOfMinLengthMatcher]: minLength,
13
+ };
8
14
  }
9
15
  //# sourceMappingURL=array-min-length.match.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"array-min-length.match.js","sourceRoot":"","sources":["../../../src/assert/array-min-length/array-min-length.match.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAoBlD;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,SAAY;IAEZ,OAAO,aAAa,CAClB,CAAC,KAAK,EAAyC,EAAE,CAC/C,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,IAAI,SAAS,EACnD,GAAG,EAAE,CAAC,qBAAqB,IAAI,CAAC,SAAS,CAAC,WAAW,EACrD,GAAG,EAAE,CAAC,WAAW,IAAI,CAAC,SAAS,CAAC,GAAG,CACpC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"array-min-length.match.js","sourceRoot":"","sources":["../../../src/assert/array-min-length/array-min-length.match.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EACL,uBAAuB,GAGxB,MAAM,4BAA4B,CAAC;AAEpC;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,SAAY;IAEZ,OAAO;QACL,GAAG,aAAa,CACd,CAAC,KAAK,EAAyC,EAAE,CAC/C,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,IAAI,SAAS,EACnD,GAAG,EAAE,CAAC,qBAAqB,IAAI,CAAC,SAAS,CAAC,WAAW,EACrD,GAAG,EAAE,CAAC,WAAW,IAAI,CAAC,SAAS,CAAC,GAAG,CACpC;QACD,2EAA2E;QAC3E,4EAA4E;QAC5E,CAAC,uBAAuB,CAAC,EAAE,SAAS;KACrC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,35 @@
1
+ import type { AssertionMatcher, refinement } from "../../match/match.js";
2
+ /**
3
+ * Unique symbol to reliably identify the ArrayOfMinLengthMatcher type.
4
+ *
5
+ * TypeScript is structurally typed, so matcher types with similar predicates
6
+ * can otherwise accidentally satisfy each other's conditional branches.
7
+ */
8
+ export declare const arrayOfMinLengthMatcher: unique symbol;
9
+ type ArrayElementOf<T> = T extends readonly (infer TElement)[] ? TElement : unknown;
10
+ type ArrayMatchElement<TActual> = [
11
+ Extract<NonNullable<TActual>, readonly unknown[]>
12
+ ] extends [never] ? unknown : ArrayElementOf<Extract<NonNullable<TActual>, readonly unknown[]>>;
13
+ export type ArrayOfMinLength<T, N extends number> = N extends 0 ? T[] : N extends 1 ? [T, ...T[]] : N extends 2 ? [T, T, ...T[]] : N extends 3 ? [T, T, T, ...T[]] : N extends 4 ? [T, T, T, T, ...T[]] : N extends 5 ? [T, T, T, T, T, ...T[]] : [T, T, T, T, T, ...T[]];
14
+ /**
15
+ * Type produced when an actual value is matched by arrayOfMinLength().
16
+ *
17
+ * The primary goal is to expose clean, readable user-facing types in IDE
18
+ * tooltips and TypeScript errors. When the calling scope already knows the
19
+ * actual value is an array, we preserve its element type. Otherwise, we fall
20
+ * back to unknown elements.
21
+ */
22
+ export type ArrayOfMinLengthMatch<TActual, N extends number> = ArrayOfMinLength<ArrayMatchElement<TActual>, N>;
23
+ export type ArrayOfMinLengthMatcher<N extends number> = AssertionMatcher<ArrayOfMinLength<unknown, N>> & {
24
+ readonly [arrayOfMinLengthMatcher]: N;
25
+ /**
26
+ * Optional type-level hook used by compositional assertions such as
27
+ * assertObjectMatches().
28
+ *
29
+ * This lets the matcher describe how it refines an existing actual type,
30
+ * rather than only exposing the standalone matches() predicate type.
31
+ */
32
+ readonly [refinement]?: <TActual>(actual: TActual) => ArrayOfMinLengthMatch<TActual, N>;
33
+ };
34
+ export {};
35
+ //# sourceMappingURL=array-min-length.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"array-min-length.type.d.ts","sourceRoot":"","sources":["../../../src/assert/array-min-length/array-min-length.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEzE;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,eAEnC,CAAC;AAEF,KAAK,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,CAAC,MAAM,QAAQ,CAAC,EAAE,GAC1D,QAAQ,GACR,OAAO,CAAC;AAEZ,KAAK,iBAAiB,CAAC,OAAO,IAAI;IAChC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;CAClD,SAAS,CAAC,KAAK,CAAC,GACb,OAAO,GACP,cAAc,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC,CAAC,CAAC;AAEtE,MAAM,MAAM,gBAAgB,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,CAAC,GAC3D,CAAC,EAAE,GACH,CAAC,SAAS,CAAC,GACT,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,GACX,CAAC,SAAS,CAAC,GACT,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,GACd,CAAC,SAAS,CAAC,GACT,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,GACjB,CAAC,SAAS,CAAC,GACT,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,GACpB,CAAC,SAAS,CAAC,GACT,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,GACvB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;AAEtC;;;;;;;GAOG;AACH,MAAM,MAAM,qBAAqB,CAAC,OAAO,EAAE,CAAC,SAAS,MAAM,IAAI,gBAAgB,CAC7E,iBAAiB,CAAC,OAAO,CAAC,EAC1B,CAAC,CACF,CAAC;AAEF,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,MAAM,IAAI,gBAAgB,CACtE,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,CAC7B,GAAG;IACF,QAAQ,CAAC,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;IAEtC;;;;;;OAMG;IACH,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,OAAO,EAC9B,MAAM,EAAE,OAAO,KACZ,qBAAqB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;CACxC,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Unique symbol to reliably identify the ArrayOfMinLengthMatcher type.
3
+ *
4
+ * TypeScript is structurally typed, so matcher types with similar predicates
5
+ * can otherwise accidentally satisfy each other's conditional branches.
6
+ */
7
+ export const arrayOfMinLengthMatcher = Symbol("smartass.arrayOfMinLengthMatcher");
8
+ //# sourceMappingURL=array-min-length.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"array-min-length.type.js","sourceRoot":"","sources":["../../../src/assert/array-min-length/array-min-length.type.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAC3C,kCAAkC,CACnC,CAAC"}
@@ -1,6 +1,4 @@
1
- import { type NonEmptyArray } from "./array-not-empty.match.js";
2
- /**
3
- * Assert that an array has at least one element, with type-narrowing.
4
- */
5
- export declare function assertArrayNotEmpty<T>(value: readonly T[] | undefined | null, message?: string): asserts value is NonEmptyArray<T>;
1
+ import type { NonEmptyArray } from "./array-not-empty.type.js";
2
+ export declare function assertArrayNotEmpty<TArray extends unknown[]>(value: TArray, message?: string): asserts value is TArray & NonEmptyArray<TArray[number]>;
3
+ export declare function assertArrayNotEmpty(value: unknown, message?: string): asserts value is NonEmptyArray<unknown>;
6
4
  //# sourceMappingURL=array-not-empty.assert.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"array-not-empty.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/array-not-empty/array-not-empty.assert.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAiB,MAAM,4BAA4B,CAAC;AAG/E;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,KAAK,EAAE,SAAS,CAAC,EAAE,GAAG,SAAS,GAAG,IAAI,EACtC,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,KAAK,IAAI,aAAa,CAAC,CAAC,CAAC,CAUnC"}
1
+ {"version":3,"file":"array-not-empty.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/array-not-empty/array-not-empty.assert.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,wBAAgB,mBAAmB,CAAC,MAAM,SAAS,OAAO,EAAE,EAC1D,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,KAAK,IAAI,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;AAE3D,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,KAAK,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC"}
@@ -1,13 +1,18 @@
1
- import { assertNonNullable } from "../non-nullable/non-nullable.assert.js";
2
1
  import { nonEmptyArray } from "./array-not-empty.match.js";
3
2
  import { AssertionError } from "../../assertion-error.js";
3
+ import { desc } from "../../describe/describe.js";
4
4
  /**
5
5
  * Assert that an array has at least one element, with type-narrowing.
6
6
  */
7
7
  export function assertArrayNotEmpty(value, message) {
8
- assertNonNullable(value, message);
9
8
  if (!nonEmptyArray().matches(value)) {
10
- throw new AssertionError(message ?? `Expected array not to be empty, but it was empty.`, value, ["..."]);
9
+ throw new AssertionError(message ?? buildArrayNotEmptyMessage(value), value, ["..."]);
11
10
  }
12
11
  }
12
+ function buildArrayNotEmptyMessage(value) {
13
+ if (!Array.isArray(value)) {
14
+ return `Expected ${desc(value)} to be a non-empty array.`;
15
+ }
16
+ return `Expected array not to be empty, but it was empty.`;
17
+ }
13
18
  //# sourceMappingURL=array-not-empty.assert.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"array-not-empty.assert.js","sourceRoot":"","sources":["../../../src/assert/array-not-empty/array-not-empty.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAsB,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,KAAsC,EACtC,OAAgB;IAEhB,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAElC,IAAI,CAAC,aAAa,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,cAAc,CACtB,OAAO,IAAI,mDAAmD,EAC9D,KAAK,EACL,CAAC,KAAK,CAAC,CACR,CAAC;IACJ,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"array-not-empty.assert.js","sourceRoot":"","sources":["../../../src/assert/array-not-empty/array-not-empty.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAalD;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAc,EAAE,OAAgB;IAClE,IAAI,CAAC,aAAa,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,cAAc,CACtB,OAAO,IAAI,yBAAyB,CAAC,KAAK,CAAC,EAC3C,KAAK,EACL,CAAC,KAAK,CAAC,CACR,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAS,yBAAyB,CAAC,KAAc;IAC/C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,YAAY,IAAI,CAAC,KAAK,CAAC,2BAA2B,CAAC;IAC5D,CAAC;IAED,OAAO,mDAAmD,CAAC;AAC7D,CAAC"}
@@ -1,6 +1,4 @@
1
- import { type AssertionMatcher } from "../../match/match.js";
2
- export type NonEmptyArray<T> = readonly [T, ...T[]];
3
- export type NonEmptyArrayMatcher = AssertionMatcher<NonEmptyArray<unknown>>;
1
+ import { type NonEmptyArrayMatcher } from "./array-not-empty.type.js";
4
2
  /**
5
3
  * Matcher for a non-empty array.
6
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"array-not-empty.match.d.ts","sourceRoot":"","sources":["../../../src/assert/array-not-empty/array-not-empty.match.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAiB,MAAM,sBAAsB,CAAC;AAE5E,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;AAEpD,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;AAE5E;;GAEG;AACH,wBAAgB,aAAa,IAAI,oBAAoB,CAOpD"}
1
+ {"version":3,"file":"array-not-empty.match.d.ts","sourceRoot":"","sources":["../../../src/assert/array-not-empty/array-not-empty.match.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,2BAA2B,CAAC;AAEnC;;GAEG;AACH,wBAAgB,aAAa,IAAI,oBAAoB,CAYpD"}
@@ -1,8 +1,14 @@
1
1
  import { createMatcher } from "../../match/match.js";
2
+ import { nonEmptyArrayMatcher, } from "./array-not-empty.type.js";
2
3
  /**
3
4
  * Matcher for a non-empty array.
4
5
  */
5
6
  export function nonEmptyArray() {
6
- return createMatcher((value) => Array.isArray(value) && value.length > 0, () => `non-empty array`, () => `[…]`);
7
+ return {
8
+ ...createMatcher((value) => Array.isArray(value) && value.length > 0, () => `non-empty array`, () => `[…]`),
9
+ // Runtime marker used only to make the matcher type nominal for type-level
10
+ // refinement dispatch. It is not part of the user-facing matcher behaviour.
11
+ [nonEmptyArrayMatcher]: true,
12
+ };
7
13
  }
8
14
  //# sourceMappingURL=array-not-empty.match.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"array-not-empty.match.js","sourceRoot":"","sources":["../../../src/assert/array-not-empty/array-not-empty.match.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAM5E;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,aAAa,CAClB,CAAC,KAAK,EAAmC,EAAE,CACzC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAC1C,GAAG,EAAE,CAAC,iBAAiB,EACvB,GAAG,EAAE,CAAC,KAAK,CACZ,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"array-not-empty.match.js","sourceRoot":"","sources":["../../../src/assert/array-not-empty/array-not-empty.match.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EACL,oBAAoB,GAGrB,MAAM,2BAA2B,CAAC;AAEnC;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO;QACL,GAAG,aAAa,CACd,CAAC,KAAK,EAAmC,EAAE,CACzC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAC1C,GAAG,EAAE,CAAC,iBAAiB,EACvB,GAAG,EAAE,CAAC,KAAK,CACZ;QACD,2EAA2E;QAC3E,4EAA4E;QAC5E,CAAC,oBAAoB,CAAC,EAAE,IAAI;KAC7B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,35 @@
1
+ import type { AssertionMatcher, refinement } from "../../match/match.js";
2
+ /**
3
+ * Unique symbol to reliably identify the NonEmptyArrayMatcher type.
4
+ *
5
+ * TypeScript is structurally typed, so matcher types with similar predicates
6
+ * can otherwise accidentally satisfy each other's conditional branches.
7
+ */
8
+ export declare const nonEmptyArrayMatcher: unique symbol;
9
+ type ArrayElementOf<T> = T extends readonly (infer TElement)[] ? TElement : unknown;
10
+ type ArrayMatchElement<TActual> = [
11
+ Extract<NonNullable<TActual>, readonly unknown[]>
12
+ ] extends [never] ? unknown : ArrayElementOf<Extract<NonNullable<TActual>, readonly unknown[]>>;
13
+ export type NonEmptyArray<T> = [T, ...T[]];
14
+ /**
15
+ * Type produced when an actual value is matched by nonEmptyArray().
16
+ *
17
+ * The primary goal is to expose clean, readable user-facing types in IDE
18
+ * tooltips and TypeScript errors. When the calling scope already knows the
19
+ * actual value is an array, we preserve its element type. Otherwise, we fall
20
+ * back to unknown elements.
21
+ */
22
+ export type NonEmptyArrayMatch<TActual> = NonEmptyArray<ArrayMatchElement<TActual>>;
23
+ export type NonEmptyArrayMatcher = AssertionMatcher<NonEmptyArray<unknown>> & {
24
+ readonly [nonEmptyArrayMatcher]: true;
25
+ /**
26
+ * Optional type-level hook used by compositional assertions such as
27
+ * assertObjectMatches().
28
+ *
29
+ * This lets the matcher describe how it refines an existing actual type,
30
+ * rather than only exposing the standalone matches() predicate type.
31
+ */
32
+ readonly [refinement]?: <TActual>(actual: TActual) => NonEmptyArrayMatch<TActual>;
33
+ };
34
+ export {};
35
+ //# sourceMappingURL=array-not-empty.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"array-not-empty.type.d.ts","sourceRoot":"","sources":["../../../src/assert/array-not-empty/array-not-empty.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEzE;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,eAA0C,CAAC;AAE5E,KAAK,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,CAAC,MAAM,QAAQ,CAAC,EAAE,GAC1D,QAAQ,GACR,OAAO,CAAC;AAEZ,KAAK,iBAAiB,CAAC,OAAO,IAAI;IAChC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;CAClD,SAAS,CAAC,KAAK,CAAC,GACb,OAAO,GACP,cAAc,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC,CAAC,CAAC;AAEtE,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;AAE3C;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,CAAC,OAAO,IAAI,aAAa,CACrD,iBAAiB,CAAC,OAAO,CAAC,CAC3B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,GAAG;IAC5E,QAAQ,CAAC,CAAC,oBAAoB,CAAC,EAAE,IAAI,CAAC;IAEtC;;;;;;OAMG;IACH,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,OAAO,EAC9B,MAAM,EAAE,OAAO,KACZ,kBAAkB,CAAC,OAAO,CAAC,CAAC;CAClC,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Unique symbol to reliably identify the NonEmptyArrayMatcher type.
3
+ *
4
+ * TypeScript is structurally typed, so matcher types with similar predicates
5
+ * can otherwise accidentally satisfy each other's conditional branches.
6
+ */
7
+ export const nonEmptyArrayMatcher = Symbol("smartass.nonEmptyArrayMatcher");
8
+ //# sourceMappingURL=array-not-empty.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"array-not-empty.type.js","sourceRoot":"","sources":["../../../src/assert/array-not-empty/array-not-empty.type.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,+BAA+B,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { TypedArray } from "../type-typed-array/type-typed-array.match.js";
1
+ import type { TypedArray } from "../type-typed-array/type-typed-array.type.js";
2
2
  /**
3
3
  * Assert that two buffers (TypedArrays) are equal, comparing element by element.
4
4
  * Supports all TypedArray types: Uint8Array, Int8Array, Uint16Array, Int16Array,
@@ -1 +1 @@
1
- {"version":3,"file":"buffer-equal.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/buffer-equal/buffer-equal.assert.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAEhF;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,UAAU,EACpD,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,CAAC,EACX,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,IAAI,CAAC,CAQrB"}
1
+ {"version":3,"file":"buffer-equal.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/buffer-equal/buffer-equal.assert.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAE/E;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,UAAU,EACpD,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,CAAC,EACX,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,IAAI,CAAC,CAQrB"}
@@ -1 +1 @@
1
- {"version":3,"file":"buffer-equal.assert.js","sourceRoot":"","sources":["../../../src/assert/buffer-equal/buffer-equal.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC/B,MAAe,EACf,QAAW,EACX,OAAgB;IAEhB,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC7C,MAAM,IAAI,cAAc,CACtB,OAAO,IAAI,YAAY,IAAI,CAAC,MAAM,CAAC,aAAa,IAAI,CAAC,QAAQ,CAAC,GAAG,EACjE,MAAM,EACN,QAAQ,CACT,CAAC;IACJ,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"buffer-equal.assert.js","sourceRoot":"","sources":["../../../src/assert/buffer-equal/buffer-equal.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAIxD;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC/B,MAAe,EACf,QAAW,EACX,OAAgB;IAEhB,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC7C,MAAM,IAAI,cAAc,CACtB,OAAO,IAAI,YAAY,IAAI,CAAC,MAAM,CAAC,aAAa,IAAI,CAAC,QAAQ,CAAC,GAAG,EACjE,MAAM,EACN,QAAQ,CACT,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1,7 +1,7 @@
1
- import { type AssertionMatcher } from "../../match/match.js";
2
- import type { TypedArray } from "../type-typed-array/type-typed-array.match.js";
1
+ import { type BufferEqualToMatcher } from "./buffer-equal.type.js";
2
+ import type { TypedArray } from "../type-typed-array/type-typed-array.type.js";
3
3
  /**
4
4
  * Matcher for a TypedArray equal to an expected TypedArray, comparing byte by byte.
5
5
  */
6
- export declare function bufferEqualTo<T extends TypedArray>(expected: T): AssertionMatcher<T>;
6
+ export declare function bufferEqualTo<T extends TypedArray>(expected: T): BufferEqualToMatcher<T>;
7
7
  //# sourceMappingURL=buffer-equal.match.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"buffer-equal.match.d.ts","sourceRoot":"","sources":["../../../src/assert/buffer-equal/buffer-equal.match.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE5E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAEhF;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,UAAU,EAChD,QAAQ,EAAE,CAAC,GACV,gBAAgB,CAAC,CAAC,CAAC,CAyBrB"}
1
+ {"version":3,"file":"buffer-equal.match.d.ts","sourceRoot":"","sources":["../../../src/assert/buffer-equal/buffer-equal.match.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAE/E;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,UAAU,EAChD,QAAQ,EAAE,CAAC,GACV,oBAAoB,CAAC,CAAC,CAAC,CAkCzB"}
@@ -1,20 +1,29 @@
1
1
  import { desc, repr } from "../../describe/describe.js";
2
2
  import { createMatcher } from "../../match/match.js";
3
3
  import { assertTypeTypedArray } from "../type-typed-array/type-typed-array.assert.js";
4
+ import { bufferEqualToMatcher, } from "./buffer-equal.type.js";
4
5
  /**
5
6
  * Matcher for a TypedArray equal to an expected TypedArray, comparing byte by byte.
6
7
  */
7
8
  export function bufferEqualTo(expected) {
8
- return createMatcher((value) => {
9
- try {
10
- assertTypeTypedArray(value);
11
- }
12
- catch {
13
- return false;
14
- }
15
- const actualBuffer = Buffer.from(value.buffer, value.byteOffset, value.byteLength);
16
- const expectedBuffer = Buffer.from(expected.buffer, expected.byteOffset, expected.byteLength);
17
- return Buffer.compare(actualBuffer, expectedBuffer) === 0;
18
- }, () => `buffer equal to ${desc(expected)}`, () => repr(expected));
9
+ return {
10
+ ...createMatcher((value) => {
11
+ try {
12
+ assertTypeTypedArray(value);
13
+ }
14
+ catch {
15
+ return false;
16
+ }
17
+ if (value.constructor !== expected.constructor) {
18
+ return false;
19
+ }
20
+ const actualBuffer = Buffer.from(value.buffer, value.byteOffset, value.byteLength);
21
+ const expectedBuffer = Buffer.from(expected.buffer, expected.byteOffset, expected.byteLength);
22
+ return Buffer.compare(actualBuffer, expectedBuffer) === 0;
23
+ }, () => `buffer equal to ${desc(expected)}`, () => repr(expected)),
24
+ // Runtime marker used only to make the matcher type nominal for type-level
25
+ // refinement dispatch. It is not part of the user-facing matcher behaviour.
26
+ [bufferEqualToMatcher]: expected,
27
+ };
19
28
  }
20
29
  //# sourceMappingURL=buffer-equal.match.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"buffer-equal.match.js","sourceRoot":"","sources":["../../../src/assert/buffer-equal/buffer-equal.match.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAyB,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AAGtF;;GAEG;AACH,MAAM,UAAU,aAAa,CAC3B,QAAW;IAEX,OAAO,aAAa,CAClB,CAAC,KAAK,EAAc,EAAE;QACpB,IAAI,CAAC;YACH,oBAAoB,CAAC,KAAK,CAAC,CAAC;QAC9B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAC9B,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,UAAU,CACjB,CAAC;QACF,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAChC,QAAQ,CAAC,MAAM,EACf,QAAQ,CAAC,UAAU,EACnB,QAAQ,CAAC,UAAU,CACpB,CAAC;QAEF,OAAO,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC;IAC5D,CAAC,EACD,GAAG,EAAE,CAAC,mBAAmB,IAAI,CAAC,QAAQ,CAAC,EAAE,EACzC,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CACrB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"buffer-equal.match.js","sourceRoot":"","sources":["../../../src/assert/buffer-equal/buffer-equal.match.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AACtF,OAAO,EACL,oBAAoB,GAErB,MAAM,wBAAwB,CAAC;AAIhC;;GAEG;AACH,MAAM,UAAU,aAAa,CAC3B,QAAW;IAEX,OAAO;QACL,GAAG,aAAa,CACd,CAAC,KAAK,EAAc,EAAE;YACpB,IAAI,CAAC;gBACH,oBAAoB,CAAC,KAAK,CAAC,CAAC;YAC9B,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,KAAK,CAAC;YACf,CAAC;YAED,IAAI,KAAK,CAAC,WAAW,KAAK,QAAQ,CAAC,WAAW,EAAE,CAAC;gBAC/C,OAAO,KAAK,CAAC;YACf,CAAC;YAED,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAC9B,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,UAAU,EAChB,KAAK,CAAC,UAAU,CACjB,CAAC;YACF,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAChC,QAAQ,CAAC,MAAM,EACf,QAAQ,CAAC,UAAU,EACnB,QAAQ,CAAC,UAAU,CACpB,CAAC;YAEF,OAAO,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC;QAC5D,CAAC,EACD,GAAG,EAAE,CAAC,mBAAmB,IAAI,CAAC,QAAQ,CAAC,EAAE,EACzC,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CACrB;QACD,2EAA2E;QAC3E,4EAA4E;QAC5E,CAAC,oBAAoB,CAAC,EAAE,QAAQ;KACjC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,32 @@
1
+ import type { AssertionMatcher, refinement } from "../../match/match.js";
2
+ import type { TypedArray } from "../type-typed-array/type-typed-array.type.js";
3
+ /**
4
+ * Unique symbol to reliably identify the BufferEqualToMatcher type.
5
+ *
6
+ * TypeScript is structurally typed, so matcher types with similar predicates
7
+ * can otherwise accidentally satisfy each other's conditional branches.
8
+ */
9
+ export declare const bufferEqualToMatcher: unique symbol;
10
+ /**
11
+ * Type produced when an actual value is matched by bufferEqualTo().
12
+ *
13
+ * The primary goal is to expose clean, readable user-facing types in IDE
14
+ * tooltips and TypeScript errors. When the calling scope already has overlap
15
+ * with the expected TypedArray type, we preserve that overlap. Otherwise, we
16
+ * fall back to the expected TypedArray type.
17
+ */
18
+ export type BufferEqualToMatch<TActual, TExpected extends TypedArray> = [
19
+ Extract<NonNullable<TActual>, TExpected>
20
+ ] extends [never] ? TExpected : Extract<NonNullable<TActual>, TExpected>;
21
+ export type BufferEqualToMatcher<TExpected extends TypedArray> = AssertionMatcher<TExpected> & {
22
+ readonly [bufferEqualToMatcher]: TExpected;
23
+ /**
24
+ * Optional type-level hook used by compositional assertions such as
25
+ * assertObjectMatches().
26
+ *
27
+ * This lets the matcher describe how it refines an existing actual type,
28
+ * rather than only exposing the standalone matches() predicate type.
29
+ */
30
+ readonly [refinement]?: <TActual>(actual: TActual) => BufferEqualToMatch<TActual, TExpected>;
31
+ };
32
+ //# sourceMappingURL=buffer-equal.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buffer-equal.type.d.ts","sourceRoot":"","sources":["../../../src/assert/buffer-equal/buffer-equal.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAE/E;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,eAA0C,CAAC;AAE5E;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,CAAC,OAAO,EAAE,SAAS,SAAS,UAAU,IAAI;IACtE,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;CACzC,SAAS,CAAC,KAAK,CAAC,GACb,SAAS,GACT,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC;AAE7C,MAAM,MAAM,oBAAoB,CAAC,SAAS,SAAS,UAAU,IAC3D,gBAAgB,CAAC,SAAS,CAAC,GAAG;IAC5B,QAAQ,CAAC,CAAC,oBAAoB,CAAC,EAAE,SAAS,CAAC;IAE3C;;;;;;OAMG;IACH,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,OAAO,EAC9B,MAAM,EAAE,OAAO,KACZ,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;CAC7C,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Unique symbol to reliably identify the BufferEqualToMatcher type.
3
+ *
4
+ * TypeScript is structurally typed, so matcher types with similar predicates
5
+ * can otherwise accidentally satisfy each other's conditional branches.
6
+ */
7
+ export const bufferEqualToMatcher = Symbol("smartass.bufferEqualToMatcher");
8
+ //# sourceMappingURL=buffer-equal.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buffer-equal.type.js","sourceRoot":"","sources":["../../../src/assert/buffer-equal/buffer-equal.type.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,+BAA+B,CAAC,CAAC"}
@@ -2,5 +2,5 @@
2
2
  * Assert that a value is strictly identical to an expected value using ===,
3
3
  * with type-narrowing.
4
4
  */
5
- export declare function assertIdentical<const TExpected>(value: unknown, expected: TExpected, message?: string): asserts value is typeof expected;
5
+ export declare function assertIdentical<const TExpected>(value: unknown, expected: TExpected, message?: string): asserts value is TExpected;
6
6
  //# sourceMappingURL=identical.assert.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"identical.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/identical/identical.assert.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,CAAC,SAAS,EAC7C,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,SAAS,EACnB,OAAO,SAAkE,GACxE,OAAO,CAAC,KAAK,IAAI,OAAO,QAAQ,CAIlC"}
1
+ {"version":3,"file":"identical.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/identical/identical.assert.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,CAAC,SAAS,EAC7C,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,SAAS,EACnB,OAAO,SAAkE,GACxE,OAAO,CAAC,KAAK,IAAI,SAAS,CAI5B"}
@@ -1,6 +1,4 @@
1
- import { type InstanceOfConstructor } from "./instance-of.match.js";
2
- /**
3
- * Assertion function that checks if a value is an instance of a given class, with type-narrowing.
4
- */
5
- export declare function assertInstanceOf<const TConstructor extends abstract new (...arguments_: never[]) => object>(value: unknown, classConstructor: TConstructor, message?: string): asserts value is InstanceOfConstructor<TConstructor>;
1
+ import type { ClassConstructor, InstanceOfAssertion } from "./instance-of.type.js";
2
+ export declare function assertInstanceOf<TActual, TInstance>(value: TActual, classConstructor: ClassConstructor<TInstance>, message?: string): asserts value is InstanceOfAssertion<TActual, TInstance>;
3
+ export declare function assertInstanceOf<TInstance>(value: unknown, classConstructor: ClassConstructor<TInstance>, message?: string): asserts value is TInstance;
6
4
  //# sourceMappingURL=instance-of.assert.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"instance-of.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/instance-of/instance-of.assert.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEhF;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,CAAC,YAAY,SAAS,QAAQ,MAAM,GAAG,UAAU,EAAE,KAAK,EAAE,KAAK,MAAM,EAE1E,KAAK,EAAE,OAAO,EACd,gBAAgB,EAAE,YAAY,EAC9B,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,KAAK,IAAI,qBAAqB,CAAC,YAAY,CAAC,CAStD"}
1
+ {"version":3,"file":"instance-of.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/instance-of/instance-of.assert.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,uBAAuB,CAAC;AAE/B,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,SAAS,EACjD,KAAK,EAAE,OAAO,EACd,gBAAgB,EAAE,gBAAgB,CAAC,SAAS,CAAC,EAC7C,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,KAAK,IAAI,mBAAmB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AAE5D,wBAAgB,gBAAgB,CAAC,SAAS,EACxC,KAAK,EAAE,OAAO,EACd,gBAAgB,EAAE,gBAAgB,CAAC,SAAS,CAAC,EAC7C,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,KAAK,IAAI,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"instance-of.assert.js","sourceRoot":"","sources":["../../../src/assert/instance-of/instance-of.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAA8B,MAAM,wBAAwB,CAAC;AAEhF;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAG9B,KAAc,EACd,gBAA8B,EAC9B,OAAgB;IAEhB,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAC7C,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,cAAc,CACtB,OAAO,IAAI,wBAAwB,OAAO,CAAC,QAAQ,EAAE,mBAAmB,EACxE,KAAK,EACL,OAAO,CAAC,SAAS,EAAE,CACpB,CAAC;IACJ,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"instance-of.assert.js","sourceRoot":"","sources":["../../../src/assert/instance-of/instance-of.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAkBpD;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,KAAc,EACd,gBAA6C,EAC7C,OAAgB;IAEhB,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAC7C,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,cAAc,CACtB,OAAO,IAAI,wBAAwB,OAAO,CAAC,QAAQ,EAAE,mBAAmB,EACxE,KAAK,EACL,OAAO,CAAC,SAAS,EAAE,CACpB,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1,7 +1,6 @@
1
- import { type AssertionMatcher } from "../../match/match.js";
2
- export type InstanceOfConstructor<TConstructor> = TConstructor extends abstract new (...arguments_: never[]) => infer TInstance ? TInstance : never;
1
+ import { type ClassConstructor, type InstanceOfMatcher } from "./instance-of.type.js";
3
2
  /**
4
3
  * Matcher for a value being an instance of a given class.
5
4
  */
6
- export declare function instanceOf<const TConstructor extends abstract new (...arguments_: never[]) => object>(classConstructor: TConstructor): AssertionMatcher<InstanceOfConstructor<TConstructor>>;
5
+ export declare function instanceOf<T>(classConstructor: ClassConstructor<T>): InstanceOfMatcher<T>;
7
6
  //# sourceMappingURL=instance-of.match.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"instance-of.match.d.ts","sourceRoot":"","sources":["../../../src/assert/instance-of/instance-of.match.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAiB,MAAM,sBAAsB,CAAC;AAE5E,MAAM,MAAM,qBAAqB,CAAC,YAAY,IAC5C,YAAY,SAAS,QAAQ,MAAM,GAAG,UAAU,EAAE,KAAK,EAAE,KAAK,MAAM,SAAS,GACzE,SAAS,GACT,KAAK,CAAC;AAEZ;;GAEG;AACH,wBAAgB,UAAU,CACxB,KAAK,CAAC,YAAY,SAAS,QAAQ,MAAM,GAAG,UAAU,EAAE,KAAK,EAAE,KAAK,MAAM,EAE1E,gBAAgB,EAAE,YAAY,GAC7B,gBAAgB,CAAC,qBAAqB,CAAC,YAAY,CAAC,CAAC,CAOvD"}
1
+ {"version":3,"file":"instance-of.match.d.ts","sourceRoot":"","sources":["../../../src/assert/instance-of/instance-of.match.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACvB,MAAM,uBAAuB,CAAC;AAE/B;;GAEG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAC1B,gBAAgB,EAAE,gBAAgB,CAAC,CAAC,CAAC,GACpC,iBAAiB,CAAC,CAAC,CAAC,CAWtB"}
@@ -1,8 +1,14 @@
1
1
  import { createMatcher } from "../../match/match.js";
2
+ import { instanceOfMatcher, } from "./instance-of.type.js";
2
3
  /**
3
4
  * Matcher for a value being an instance of a given class.
4
5
  */
5
6
  export function instanceOf(classConstructor) {
6
- return createMatcher((value) => value instanceof classConstructor, () => `instance of ${classConstructor.name}`, () => `${classConstructor.name}()`);
7
+ return {
8
+ ...createMatcher((value) => value instanceof classConstructor, () => `instance of ${classConstructor.name}`, () => `${classConstructor.name}()`),
9
+ // Runtime marker used only to make the matcher type nominal for type-level
10
+ // refinement dispatch. It is not part of the user-facing matcher behaviour.
11
+ [instanceOfMatcher]: undefined,
12
+ };
7
13
  }
8
14
  //# sourceMappingURL=instance-of.match.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"instance-of.match.js","sourceRoot":"","sources":["../../../src/assert/instance-of/instance-of.match.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAO5E;;GAEG;AACH,MAAM,UAAU,UAAU,CAGxB,gBAA8B;IAE9B,OAAO,aAAa,CAClB,CAAC,KAAK,EAAgD,EAAE,CACtD,KAAK,YAAY,gBAAgB,EACnC,GAAG,EAAE,CAAC,eAAe,gBAAgB,CAAC,IAAI,EAAE,EAC5C,GAAG,EAAE,CAAC,GAAG,gBAAgB,CAAC,IAAI,IAAI,CACnC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"instance-of.match.js","sourceRoot":"","sources":["../../../src/assert/instance-of/instance-of.match.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EACL,iBAAiB,GAGlB,MAAM,uBAAuB,CAAC;AAE/B;;GAEG;AACH,MAAM,UAAU,UAAU,CACxB,gBAAqC;IAErC,OAAO;QACL,GAAG,aAAa,CACd,CAAC,KAAK,EAAc,EAAE,CAAC,KAAK,YAAY,gBAAgB,EACxD,GAAG,EAAE,CAAC,eAAe,gBAAgB,CAAC,IAAI,EAAE,EAC5C,GAAG,EAAE,CAAC,GAAG,gBAAgB,CAAC,IAAI,IAAI,CACnC;QACD,2EAA2E;QAC3E,4EAA4E;QAC5E,CAAC,iBAAiB,CAAC,EAAE,SAAc;KACpC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,42 @@
1
+ import type { AssertionMatcher, refinement } from "../../match/match.js";
2
+ /**
3
+ * Unique symbol to reliably identify the InstanceOfMatcher type.
4
+ *
5
+ * TypeScript is structurally typed, so matcher types with similar predicates
6
+ * can otherwise accidentally satisfy each other's conditional branches.
7
+ */
8
+ export declare const instanceOfMatcher: unique symbol;
9
+ export type ClassConstructor<T> = abstract new (...args: never[]) => T;
10
+ /**
11
+ * Type produced when an actual value is matched by instanceOf().
12
+ *
13
+ * The primary goal is to expose clean, readable user-facing types in IDE
14
+ * tooltips and TypeScript errors. When the calling scope already has overlap
15
+ * with the expected instance type, we preserve that overlap. Otherwise, we fall
16
+ * back to the expected instance type.
17
+ */
18
+ export type InstanceOfMatch<TActual, TInstance> = [
19
+ Extract<NonNullable<TActual>, TInstance>
20
+ ] extends [never] ? TInstance : Extract<NonNullable<TActual>, TInstance>;
21
+ /**
22
+ * Type produced when assertInstanceOf() narrows a value.
23
+ *
24
+ * Assertion functions must assert a type assignable to the asserted parameter's
25
+ * original type. So unlike InstanceOfMatch, the no-overlap fallback keeps the
26
+ * original actual type in an intersection.
27
+ */
28
+ export type InstanceOfAssertion<TActual, TInstance> = [
29
+ Extract<NonNullable<TActual>, TInstance>
30
+ ] extends [never] ? TActual & TInstance : Extract<NonNullable<TActual>, TInstance>;
31
+ export type InstanceOfMatcher<T> = AssertionMatcher<T> & {
32
+ readonly [instanceOfMatcher]: T;
33
+ /**
34
+ * Optional type-level hook used by compositional assertions such as
35
+ * assertObjectMatches().
36
+ *
37
+ * This lets the matcher describe how it refines an existing actual type,
38
+ * rather than only exposing the standalone matches() predicate type.
39
+ */
40
+ readonly [refinement]?: <TActual>(actual: TActual) => InstanceOfMatch<TActual, T>;
41
+ };
42
+ //# sourceMappingURL=instance-of.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instance-of.type.d.ts","sourceRoot":"","sources":["../../../src/assert/instance-of/instance-of.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEzE;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,eAAuC,CAAC;AAEtE,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,QAAQ,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAEvE;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,CAAC,OAAO,EAAE,SAAS,IAAI;IAChD,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;CACzC,SAAS,CAAC,KAAK,CAAC,GACb,SAAS,GACT,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,CAAC,OAAO,EAAE,SAAS,IAAI;IACpD,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;CACzC,SAAS,CAAC,KAAK,CAAC,GACb,OAAO,GAAG,SAAS,GACnB,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC;AAE7C,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC,GAAG;IACvD,QAAQ,CAAC,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;IAEhC;;;;;;OAMG;IACH,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,OAAO,EAC9B,MAAM,EAAE,OAAO,KACZ,eAAe,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;CAClC,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Unique symbol to reliably identify the InstanceOfMatcher type.
3
+ *
4
+ * TypeScript is structurally typed, so matcher types with similar predicates
5
+ * can otherwise accidentally satisfy each other's conditional branches.
6
+ */
7
+ export const instanceOfMatcher = Symbol("smartass.instanceOfMatcher");
8
+ //# sourceMappingURL=instance-of.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instance-of.type.js","sourceRoot":"","sources":["../../../src/assert/instance-of/instance-of.type.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,4BAA4B,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { MapOfSize, MapOfSizeMatch } from "./map-size.type.js";
2
+ export declare function assertMapSize<TMap extends Map<unknown, unknown>, const N extends number>(value: TMap, expectedSize: N, message?: string): asserts value is TMap & MapOfSizeMatch<TMap, N>;
3
+ export declare function assertMapSize<const N extends number>(value: unknown, expectedSize: N, message?: string): asserts value is MapOfSize<unknown, unknown, N>;
4
+ //# sourceMappingURL=map-size.assert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map-size.assert.d.ts","sourceRoot":"","sources":["../../../src/assert/map-size/map-size.assert.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpE,wBAAgB,aAAa,CAC3B,IAAI,SAAS,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,EAClC,KAAK,CAAC,CAAC,SAAS,MAAM,EAEtB,KAAK,EAAE,IAAI,EACX,YAAY,EAAE,CAAC,EACf,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,KAAK,IAAI,IAAI,GAAG,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AAEnD,wBAAgB,aAAa,CAAC,KAAK,CAAC,CAAC,SAAS,MAAM,EAClD,KAAK,EAAE,OAAO,EACd,YAAY,EAAE,CAAC,EACf,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,KAAK,IAAI,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { AssertionError } from "../../assertion-error.js";
2
+ import { desc, repr } from "../../describe/describe.js";
3
+ import { mapOfSize } from "./map-size.match.js";
4
+ /**
5
+ * Assert that a Map has exactly the expected size, with type narrowing.
6
+ */
7
+ export function assertMapSize(value, expectedSize, message) {
8
+ const matcher = mapOfSize(expectedSize);
9
+ if (!matcher.matches(value)) {
10
+ throw new AssertionError(message ?? buildMapSizeMessage(value, expectedSize), value, matcher.represent());
11
+ }
12
+ }
13
+ function buildMapSizeMessage(value, expectedSize) {
14
+ if (!(value instanceof Map)) {
15
+ return `Expected ${desc(value)} to be a Map of size ${repr(expectedSize)}.`;
16
+ }
17
+ return `Expected ${desc(value)} to have size ${repr(expectedSize)}, but it had size ${repr(value.size)}.`;
18
+ }
19
+ //# sourceMappingURL=map-size.assert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map-size.assert.js","sourceRoot":"","sources":["../../../src/assert/map-size/map-size.assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAkBhD;;GAEG;AACH,MAAM,UAAU,aAAa,CAC3B,KAAc,EACd,YAAoB,EACpB,OAAgB;IAEhB,MAAM,OAAO,GAAG,SAAS,CAAC,YAAY,CAAC,CAAC;IAExC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,cAAc,CACtB,OAAO,IAAI,mBAAmB,CAAC,KAAK,EAAE,YAAY,CAAC,EACnD,KAAK,EACL,OAAO,CAAC,SAAS,EAAE,CACpB,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAc,EAAE,YAAoB;IAC/D,IAAI,CAAC,CAAC,KAAK,YAAY,GAAG,CAAC,EAAE,CAAC;QAC5B,OAAO,YAAY,IAAI,CAAC,KAAK,CAAC,wBAAwB,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC;IAC9E,CAAC;IAED,OAAO,YAAY,IAAI,CAAC,KAAK,CAAC,iBAAiB,IAAI,CAAC,YAAY,CAAC,qBAAqB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;AAC5G,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { type MapOfSizeMatcher } from "./map-size.type.js";
2
+ /**
3
+ * Matcher for a Map with exactly the expected size.
4
+ */
5
+ export declare function mapOfSize<const N extends number>(expectedSize: N): MapOfSizeMatcher<N>;
6
+ //# sourceMappingURL=map-size.match.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map-size.match.d.ts","sourceRoot":"","sources":["../../../src/assert/map-size/map-size.match.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,CAAC,CAAC,SAAS,MAAM,EAC9C,YAAY,EAAE,CAAC,GACd,gBAAgB,CAAC,CAAC,CAAC,CAYrB"}
@@ -0,0 +1,15 @@
1
+ import { createMatcher } from "../../match/match.js";
2
+ import { repr } from "../../describe/describe.js";
3
+ import { mapOfSizeMatcher, } from "./map-size.type.js";
4
+ /**
5
+ * Matcher for a Map with exactly the expected size.
6
+ */
7
+ export function mapOfSize(expectedSize) {
8
+ return {
9
+ ...createMatcher((value) => value instanceof Map && value.size === expectedSize, () => `Map of size ${repr(expectedSize)}`, () => `Map(${repr(expectedSize)})`),
10
+ // Runtime marker used only to make the matcher type nominal for type-level
11
+ // refinement dispatch. It is not part of the user-facing matcher behaviour.
12
+ [mapOfSizeMatcher]: expectedSize,
13
+ };
14
+ }
15
+ //# sourceMappingURL=map-size.match.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map-size.match.js","sourceRoot":"","sources":["../../../src/assert/map-size/map-size.match.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EACL,gBAAgB,GAGjB,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,MAAM,UAAU,SAAS,CACvB,YAAe;IAEf,OAAO;QACL,GAAG,aAAa,CACd,CAAC,KAAK,EAA2C,EAAE,CACjD,KAAK,YAAY,GAAG,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,EACrD,GAAG,EAAE,CAAC,eAAe,IAAI,CAAC,YAAY,CAAC,EAAE,EACzC,GAAG,EAAE,CAAC,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CACnC;QACD,2EAA2E;QAC3E,4EAA4E;QAC5E,CAAC,gBAAgB,CAAC,EAAE,YAAY;KACjC,CAAC;AACJ,CAAC"}