bupkis 0.18.3 → 1.0.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 (388) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +1 -1
  3. package/dist/assertion/assertion-async.cjs +268 -0
  4. package/dist/assertion/assertion-async.cjs.map +1 -0
  5. package/dist/assertion/assertion-async.d.cts +40 -0
  6. package/dist/assertion/assertion-async.d.cts.map +1 -0
  7. package/dist/assertion/assertion-async.d.ts +40 -0
  8. package/dist/assertion/assertion-async.d.ts.map +1 -0
  9. package/dist/assertion/assertion-async.js +259 -0
  10. package/dist/assertion/assertion-async.js.map +1 -0
  11. package/dist/assertion/assertion-standard-schema-async.cjs +132 -0
  12. package/dist/assertion/assertion-standard-schema-async.cjs.map +1 -0
  13. package/dist/assertion/assertion-standard-schema-async.d.cts +52 -0
  14. package/dist/assertion/assertion-standard-schema-async.d.cts.map +1 -0
  15. package/dist/assertion/assertion-standard-schema-async.d.ts +52 -0
  16. package/dist/assertion/assertion-standard-schema-async.d.ts.map +1 -0
  17. package/dist/assertion/assertion-standard-schema-async.js +128 -0
  18. package/dist/assertion/assertion-standard-schema-async.js.map +1 -0
  19. package/dist/assertion/assertion-standard-schema-sync.cjs +141 -0
  20. package/dist/assertion/assertion-standard-schema-sync.cjs.map +1 -0
  21. package/dist/assertion/assertion-standard-schema-sync.d.cts +52 -0
  22. package/dist/assertion/assertion-standard-schema-sync.d.cts.map +1 -0
  23. package/dist/assertion/assertion-standard-schema-sync.d.ts +52 -0
  24. package/dist/assertion/assertion-standard-schema-sync.d.ts.map +1 -0
  25. package/dist/assertion/assertion-standard-schema-sync.js +137 -0
  26. package/dist/assertion/assertion-standard-schema-sync.js.map +1 -0
  27. package/dist/assertion/assertion-sync.cjs +281 -0
  28. package/dist/assertion/assertion-sync.cjs.map +1 -0
  29. package/dist/assertion/assertion-sync.d.cts +60 -0
  30. package/dist/assertion/assertion-sync.d.cts.map +1 -0
  31. package/dist/assertion/assertion-sync.d.ts +60 -0
  32. package/dist/assertion/assertion-sync.d.ts.map +1 -0
  33. package/dist/assertion/assertion-sync.js +275 -0
  34. package/dist/assertion/assertion-sync.js.map +1 -0
  35. package/dist/assertion/assertion-types.cjs +20 -0
  36. package/dist/assertion/assertion-types.cjs.map +1 -0
  37. package/dist/assertion/assertion-types.d.cts +1086 -0
  38. package/dist/assertion/assertion-types.d.cts.map +1 -0
  39. package/dist/assertion/assertion-types.d.ts +1086 -0
  40. package/dist/assertion/assertion-types.d.ts.map +1 -0
  41. package/dist/assertion/assertion-types.js +19 -0
  42. package/dist/assertion/assertion-types.js.map +1 -0
  43. package/dist/assertion/assertion.cjs +382 -0
  44. package/dist/assertion/assertion.cjs.map +1 -0
  45. package/dist/assertion/assertion.d.cts +109 -0
  46. package/dist/assertion/assertion.d.cts.map +1 -0
  47. package/dist/assertion/assertion.d.ts +109 -0
  48. package/dist/assertion/assertion.d.ts.map +1 -0
  49. package/dist/assertion/assertion.js +375 -0
  50. package/dist/assertion/assertion.js.map +1 -0
  51. package/dist/assertion/create.cjs +148 -0
  52. package/dist/assertion/create.cjs.map +1 -0
  53. package/dist/assertion/create.d.cts +85 -0
  54. package/dist/assertion/create.d.cts.map +1 -0
  55. package/dist/assertion/create.d.ts +85 -0
  56. package/dist/assertion/create.d.ts.map +1 -0
  57. package/dist/assertion/create.js +143 -0
  58. package/dist/assertion/create.js.map +1 -0
  59. package/dist/assertion/format-assertion-failure.cjs +63 -0
  60. package/dist/assertion/format-assertion-failure.cjs.map +1 -0
  61. package/dist/assertion/format-assertion-failure.d.cts +21 -0
  62. package/dist/assertion/format-assertion-failure.d.cts.map +1 -0
  63. package/dist/assertion/format-assertion-failure.d.ts +21 -0
  64. package/dist/assertion/format-assertion-failure.d.ts.map +1 -0
  65. package/dist/assertion/format-assertion-failure.js +59 -0
  66. package/dist/assertion/format-assertion-failure.js.map +1 -0
  67. package/dist/assertion/impl/assertion-util.cjs +68 -0
  68. package/dist/assertion/impl/assertion-util.cjs.map +1 -0
  69. package/dist/assertion/impl/assertion-util.d.cts +36 -0
  70. package/dist/assertion/impl/assertion-util.d.cts.map +1 -0
  71. package/dist/assertion/impl/assertion-util.d.ts +36 -0
  72. package/dist/assertion/impl/assertion-util.d.ts.map +1 -0
  73. package/dist/assertion/impl/assertion-util.js +62 -0
  74. package/dist/assertion/impl/assertion-util.js.map +1 -0
  75. package/dist/assertion/impl/async-iterable.cjs +627 -0
  76. package/dist/assertion/impl/async-iterable.cjs.map +1 -0
  77. package/dist/assertion/impl/async-iterable.d.cts +406 -0
  78. package/dist/assertion/impl/async-iterable.d.cts.map +1 -0
  79. package/dist/assertion/impl/async-iterable.d.ts +406 -0
  80. package/dist/assertion/impl/async-iterable.d.ts.map +1 -0
  81. package/dist/assertion/impl/async-iterable.js +624 -0
  82. package/dist/assertion/impl/async-iterable.js.map +1 -0
  83. package/dist/assertion/impl/async-parametric.cjs +412 -0
  84. package/dist/assertion/impl/async-parametric.cjs.map +1 -0
  85. package/dist/assertion/impl/async-parametric.d.cts +278 -0
  86. package/dist/assertion/impl/async-parametric.d.cts.map +1 -0
  87. package/dist/assertion/impl/async-parametric.d.ts +278 -0
  88. package/dist/assertion/impl/async-parametric.d.ts.map +1 -0
  89. package/dist/assertion/impl/async-parametric.js +409 -0
  90. package/dist/assertion/impl/async-parametric.js.map +1 -0
  91. package/dist/assertion/impl/async.cjs +56 -0
  92. package/dist/assertion/impl/async.cjs.map +1 -0
  93. package/dist/assertion/impl/async.d.cts +179 -0
  94. package/dist/assertion/impl/async.d.cts.map +1 -0
  95. package/dist/assertion/impl/async.d.ts +179 -0
  96. package/dist/assertion/impl/async.d.ts.map +1 -0
  97. package/dist/assertion/impl/async.js +39 -0
  98. package/dist/assertion/impl/async.js.map +1 -0
  99. package/dist/assertion/impl/index.cjs +37 -0
  100. package/dist/assertion/impl/index.cjs.map +1 -0
  101. package/dist/assertion/impl/index.d.cts +21 -0
  102. package/dist/assertion/impl/index.d.cts.map +1 -0
  103. package/dist/assertion/impl/index.d.ts +21 -0
  104. package/dist/assertion/impl/index.d.ts.map +1 -0
  105. package/dist/assertion/impl/index.js +21 -0
  106. package/dist/assertion/impl/index.js.map +1 -0
  107. package/dist/assertion/impl/iteration-util.cjs +297 -0
  108. package/dist/assertion/impl/iteration-util.cjs.map +1 -0
  109. package/dist/assertion/impl/iteration-util.d.cts +12 -0
  110. package/dist/assertion/impl/iteration-util.d.cts.map +1 -0
  111. package/dist/assertion/impl/iteration-util.d.ts +12 -0
  112. package/dist/assertion/impl/iteration-util.d.ts.map +1 -0
  113. package/dist/assertion/impl/iteration-util.js +282 -0
  114. package/dist/assertion/impl/iteration-util.js.map +1 -0
  115. package/dist/assertion/impl/snapshot.cjs +276 -0
  116. package/dist/assertion/impl/snapshot.cjs.map +1 -0
  117. package/dist/assertion/impl/snapshot.d.cts +278 -0
  118. package/dist/assertion/impl/snapshot.d.cts.map +1 -0
  119. package/dist/assertion/impl/snapshot.d.ts +278 -0
  120. package/dist/assertion/impl/snapshot.d.ts.map +1 -0
  121. package/dist/assertion/impl/snapshot.js +273 -0
  122. package/dist/assertion/impl/snapshot.js.map +1 -0
  123. package/dist/assertion/impl/sync-basic.cjs +553 -0
  124. package/dist/assertion/impl/sync-basic.cjs.map +1 -0
  125. package/dist/assertion/impl/sync-basic.d.cts +528 -0
  126. package/dist/assertion/impl/sync-basic.d.cts.map +1 -0
  127. package/dist/assertion/impl/sync-basic.d.ts +528 -0
  128. package/dist/assertion/impl/sync-basic.d.ts.map +1 -0
  129. package/dist/assertion/impl/sync-basic.js +550 -0
  130. package/dist/assertion/impl/sync-basic.js.map +1 -0
  131. package/dist/assertion/impl/sync-collection.cjs +1424 -0
  132. package/dist/assertion/impl/sync-collection.cjs.map +1 -0
  133. package/dist/assertion/impl/sync-collection.d.cts +922 -0
  134. package/dist/assertion/impl/sync-collection.d.cts.map +1 -0
  135. package/dist/assertion/impl/sync-collection.d.ts +922 -0
  136. package/dist/assertion/impl/sync-collection.d.ts.map +1 -0
  137. package/dist/assertion/impl/sync-collection.js +1418 -0
  138. package/dist/assertion/impl/sync-collection.js.map +1 -0
  139. package/dist/assertion/impl/sync-date.cjs +341 -0
  140. package/dist/assertion/impl/sync-date.cjs.map +1 -0
  141. package/dist/assertion/impl/sync-date.d.cts +209 -0
  142. package/dist/assertion/impl/sync-date.d.cts.map +1 -0
  143. package/dist/assertion/impl/sync-date.d.ts +209 -0
  144. package/dist/assertion/impl/sync-date.d.ts.map +1 -0
  145. package/dist/assertion/impl/sync-date.js +338 -0
  146. package/dist/assertion/impl/sync-date.js.map +1 -0
  147. package/dist/assertion/impl/sync-esoteric.cjs +214 -0
  148. package/dist/assertion/impl/sync-esoteric.cjs.map +1 -0
  149. package/dist/assertion/impl/sync-esoteric.d.cts +191 -0
  150. package/dist/assertion/impl/sync-esoteric.d.cts.map +1 -0
  151. package/dist/assertion/impl/sync-esoteric.d.ts +191 -0
  152. package/dist/assertion/impl/sync-esoteric.d.ts.map +1 -0
  153. package/dist/assertion/impl/sync-esoteric.js +211 -0
  154. package/dist/assertion/impl/sync-esoteric.js.map +1 -0
  155. package/dist/assertion/impl/sync-iterable.cjs +512 -0
  156. package/dist/assertion/impl/sync-iterable.cjs.map +1 -0
  157. package/dist/assertion/impl/sync-iterable.d.cts +334 -0
  158. package/dist/assertion/impl/sync-iterable.d.cts.map +1 -0
  159. package/dist/assertion/impl/sync-iterable.d.ts +334 -0
  160. package/dist/assertion/impl/sync-iterable.d.ts.map +1 -0
  161. package/dist/assertion/impl/sync-iterable.js +509 -0
  162. package/dist/assertion/impl/sync-iterable.js.map +1 -0
  163. package/dist/assertion/impl/sync-parametric.cjs +805 -0
  164. package/dist/assertion/impl/sync-parametric.cjs.map +1 -0
  165. package/dist/assertion/impl/sync-parametric.d.cts +560 -0
  166. package/dist/assertion/impl/sync-parametric.d.cts.map +1 -0
  167. package/dist/assertion/impl/sync-parametric.d.ts +560 -0
  168. package/dist/assertion/impl/sync-parametric.d.ts.map +1 -0
  169. package/dist/assertion/impl/sync-parametric.js +802 -0
  170. package/dist/assertion/impl/sync-parametric.js.map +1 -0
  171. package/dist/assertion/impl/sync.cjs +229 -0
  172. package/dist/assertion/impl/sync.cjs.map +1 -0
  173. package/dist/assertion/impl/sync.d.cts +536 -0
  174. package/dist/assertion/impl/sync.d.cts.map +1 -0
  175. package/dist/assertion/impl/sync.d.ts +536 -0
  176. package/dist/assertion/impl/sync.d.ts.map +1 -0
  177. package/dist/assertion/impl/sync.js +212 -0
  178. package/dist/assertion/impl/sync.js.map +1 -0
  179. package/dist/assertion/index.cjs +38 -0
  180. package/dist/assertion/index.cjs.map +1 -0
  181. package/dist/assertion/index.d.cts +18 -0
  182. package/dist/assertion/index.d.cts.map +1 -0
  183. package/dist/assertion/index.d.ts +18 -0
  184. package/dist/assertion/index.d.ts.map +1 -0
  185. package/dist/assertion/index.js +17 -0
  186. package/dist/assertion/index.js.map +1 -0
  187. package/dist/assertion/slotify.cjs +165 -0
  188. package/dist/assertion/slotify.cjs.map +1 -0
  189. package/dist/assertion/slotify.d.cts +11 -0
  190. package/dist/assertion/slotify.d.cts.map +1 -0
  191. package/dist/assertion/slotify.d.ts +11 -0
  192. package/dist/assertion/slotify.d.ts.map +1 -0
  193. package/dist/assertion/slotify.js +161 -0
  194. package/dist/assertion/slotify.js.map +1 -0
  195. package/dist/bootstrap.cjs +43 -0
  196. package/dist/bootstrap.cjs.map +1 -0
  197. package/dist/bootstrap.d.cts +27 -0
  198. package/dist/bootstrap.d.cts.map +1 -0
  199. package/dist/bootstrap.d.ts +27 -0
  200. package/dist/bootstrap.d.ts.map +1 -0
  201. package/dist/bootstrap.js +40 -0
  202. package/dist/bootstrap.js.map +1 -0
  203. package/dist/constant.cjs +82 -0
  204. package/dist/constant.cjs.map +1 -0
  205. package/dist/constant.d.cts +69 -0
  206. package/dist/constant.d.cts.map +1 -0
  207. package/dist/constant.d.ts +69 -0
  208. package/dist/constant.d.ts.map +1 -0
  209. package/dist/constant.js +79 -0
  210. package/dist/constant.js.map +1 -0
  211. package/dist/diff.cjs +340 -0
  212. package/dist/diff.cjs.map +1 -0
  213. package/dist/diff.d.cts +51 -0
  214. package/dist/diff.d.cts.map +1 -0
  215. package/dist/diff.d.ts +51 -0
  216. package/dist/diff.d.ts.map +1 -0
  217. package/dist/diff.js +334 -0
  218. package/dist/diff.js.map +1 -0
  219. package/dist/error.cjs +194 -0
  220. package/dist/error.cjs.map +1 -0
  221. package/dist/error.d.cts +212 -0
  222. package/dist/error.d.cts.map +1 -0
  223. package/dist/error.d.ts +212 -0
  224. package/dist/error.d.ts.map +1 -0
  225. package/dist/error.js +181 -0
  226. package/dist/error.js.map +1 -0
  227. package/dist/expect.cjs +587 -0
  228. package/dist/expect.cjs.map +1 -0
  229. package/dist/expect.d.cts +138 -0
  230. package/dist/expect.d.cts.map +1 -0
  231. package/dist/expect.d.ts +138 -0
  232. package/dist/expect.d.ts.map +1 -0
  233. package/dist/expect.js +582 -0
  234. package/dist/expect.js.map +1 -0
  235. package/dist/guards.cjs +291 -0
  236. package/dist/guards.cjs.map +1 -0
  237. package/dist/guards.d.cts +225 -0
  238. package/dist/guards.d.cts.map +1 -0
  239. package/dist/guards.d.ts +225 -0
  240. package/dist/guards.d.ts.map +1 -0
  241. package/dist/guards.js +273 -0
  242. package/dist/guards.js.map +1 -0
  243. package/dist/index.cjs +111 -0
  244. package/dist/index.cjs.map +1 -0
  245. package/dist/index.d.cts +460 -0
  246. package/dist/index.d.cts.map +1 -0
  247. package/dist/index.d.ts +460 -0
  248. package/dist/index.d.ts.map +1 -0
  249. package/dist/index.js +71 -0
  250. package/dist/index.js.map +1 -0
  251. package/dist/internal-schema.cjs +234 -0
  252. package/dist/internal-schema.cjs.map +1 -0
  253. package/dist/internal-schema.d.cts +8 -0
  254. package/dist/internal-schema.d.cts.map +1 -0
  255. package/dist/internal-schema.d.ts +8 -0
  256. package/dist/internal-schema.d.ts.map +1 -0
  257. package/dist/internal-schema.js +229 -0
  258. package/dist/internal-schema.js.map +1 -0
  259. package/dist/metadata.cjs +57 -0
  260. package/dist/metadata.cjs.map +1 -0
  261. package/dist/metadata.d.cts +27 -0
  262. package/dist/metadata.d.cts.map +1 -0
  263. package/dist/metadata.d.ts +27 -0
  264. package/dist/metadata.d.ts.map +1 -0
  265. package/dist/metadata.js +54 -0
  266. package/dist/metadata.js.map +1 -0
  267. package/dist/schema.cjs +1522 -0
  268. package/dist/schema.cjs.map +1 -0
  269. package/dist/schema.d.cts +1196 -0
  270. package/dist/schema.d.cts.map +1 -0
  271. package/dist/schema.d.ts +1196 -0
  272. package/dist/schema.d.ts.map +1 -0
  273. package/dist/schema.js +1516 -0
  274. package/dist/schema.js.map +1 -0
  275. package/dist/snapshot/adapter.cjs +29 -0
  276. package/dist/snapshot/adapter.cjs.map +1 -0
  277. package/dist/snapshot/adapter.d.cts +258 -0
  278. package/dist/snapshot/adapter.d.cts.map +1 -0
  279. package/dist/snapshot/adapter.d.ts +258 -0
  280. package/dist/snapshot/adapter.d.ts.map +1 -0
  281. package/dist/snapshot/adapter.js +25 -0
  282. package/dist/snapshot/adapter.js.map +1 -0
  283. package/dist/snapshot/adapters/fallback.cjs +452 -0
  284. package/dist/snapshot/adapters/fallback.cjs.map +1 -0
  285. package/dist/snapshot/adapters/fallback.d.cts +185 -0
  286. package/dist/snapshot/adapters/fallback.d.cts.map +1 -0
  287. package/dist/snapshot/adapters/fallback.d.ts +185 -0
  288. package/dist/snapshot/adapters/fallback.d.ts.map +1 -0
  289. package/dist/snapshot/adapters/fallback.js +445 -0
  290. package/dist/snapshot/adapters/fallback.js.map +1 -0
  291. package/dist/snapshot/adapters/node-test.cjs +297 -0
  292. package/dist/snapshot/adapters/node-test.cjs.map +1 -0
  293. package/dist/snapshot/adapters/node-test.d.cts +131 -0
  294. package/dist/snapshot/adapters/node-test.d.cts.map +1 -0
  295. package/dist/snapshot/adapters/node-test.d.ts +131 -0
  296. package/dist/snapshot/adapters/node-test.d.ts.map +1 -0
  297. package/dist/snapshot/adapters/node-test.js +293 -0
  298. package/dist/snapshot/adapters/node-test.js.map +1 -0
  299. package/dist/snapshot/index.cjs +61 -0
  300. package/dist/snapshot/index.cjs.map +1 -0
  301. package/dist/snapshot/index.d.cts +40 -0
  302. package/dist/snapshot/index.d.cts.map +1 -0
  303. package/dist/snapshot/index.d.ts +40 -0
  304. package/dist/snapshot/index.d.ts.map +1 -0
  305. package/dist/snapshot/index.js +44 -0
  306. package/dist/snapshot/index.js.map +1 -0
  307. package/dist/snapshot/node-version.cjs +49 -0
  308. package/dist/snapshot/node-version.cjs.map +1 -0
  309. package/dist/snapshot/node-version.d.cts +34 -0
  310. package/dist/snapshot/node-version.d.cts.map +1 -0
  311. package/dist/snapshot/node-version.d.ts +34 -0
  312. package/dist/snapshot/node-version.d.ts.map +1 -0
  313. package/dist/snapshot/node-version.js +44 -0
  314. package/dist/snapshot/node-version.js.map +1 -0
  315. package/dist/snapshot/select-adapter.cjs +170 -0
  316. package/dist/snapshot/select-adapter.cjs.map +1 -0
  317. package/dist/snapshot/select-adapter.d.cts +128 -0
  318. package/dist/snapshot/select-adapter.d.cts.map +1 -0
  319. package/dist/snapshot/select-adapter.d.ts +128 -0
  320. package/dist/snapshot/select-adapter.d.ts.map +1 -0
  321. package/dist/snapshot/select-adapter.js +164 -0
  322. package/dist/snapshot/select-adapter.js.map +1 -0
  323. package/dist/snapshot/serializer.cjs +245 -0
  324. package/dist/snapshot/serializer.cjs.map +1 -0
  325. package/dist/snapshot/serializer.d.cts +126 -0
  326. package/dist/snapshot/serializer.d.cts.map +1 -0
  327. package/dist/snapshot/serializer.d.ts +126 -0
  328. package/dist/snapshot/serializer.d.ts.map +1 -0
  329. package/dist/snapshot/serializer.js +237 -0
  330. package/dist/snapshot/serializer.js.map +1 -0
  331. package/dist/standard-schema.cjs +13 -0
  332. package/dist/standard-schema.cjs.map +1 -0
  333. package/dist/standard-schema.d.cts +192 -0
  334. package/dist/standard-schema.d.cts.map +1 -0
  335. package/dist/standard-schema.d.ts +192 -0
  336. package/dist/standard-schema.d.ts.map +1 -0
  337. package/dist/standard-schema.js +12 -0
  338. package/dist/standard-schema.js.map +1 -0
  339. package/dist/types.cjs +22 -0
  340. package/dist/types.cjs.map +1 -0
  341. package/dist/types.d.cts +756 -0
  342. package/dist/types.d.cts.map +1 -0
  343. package/dist/types.d.ts +756 -0
  344. package/dist/types.d.ts.map +1 -0
  345. package/dist/types.js +21 -0
  346. package/dist/types.js.map +1 -0
  347. package/dist/use.cjs +240 -0
  348. package/dist/use.cjs.map +1 -0
  349. package/dist/use.d.cts +8 -0
  350. package/dist/use.d.cts.map +1 -0
  351. package/dist/use.d.ts +8 -0
  352. package/dist/use.d.ts.map +1 -0
  353. package/dist/use.js +236 -0
  354. package/dist/use.js.map +1 -0
  355. package/dist/util.cjs +255 -0
  356. package/dist/util.cjs.map +1 -0
  357. package/dist/util.d.cts +141 -0
  358. package/dist/util.d.cts.map +1 -0
  359. package/dist/util.d.ts +141 -0
  360. package/dist/util.d.ts.map +1 -0
  361. package/dist/util.js +234 -0
  362. package/dist/util.js.map +1 -0
  363. package/dist/value-to-schema.cjs +537 -0
  364. package/dist/value-to-schema.cjs.map +1 -0
  365. package/dist/value-to-schema.d.cts +144 -0
  366. package/dist/value-to-schema.d.cts.map +1 -0
  367. package/dist/value-to-schema.d.ts +144 -0
  368. package/dist/value-to-schema.d.ts.map +1 -0
  369. package/dist/value-to-schema.js +533 -0
  370. package/dist/value-to-schema.js.map +1 -0
  371. package/package.json +22 -19
  372. package/src/assertion/assertion-types.ts +4 -8
  373. package/src/assertion/assertion.ts +1 -1
  374. package/src/assertion/format-assertion-failure.ts +2 -0
  375. package/src/assertion/impl/assertion-util.ts +1 -2
  376. package/src/assertion/impl/iteration-util.ts +1 -3
  377. package/src/assertion/impl/sync-collection.ts +633 -7
  378. package/src/assertion/impl/sync.ts +27 -0
  379. package/src/error.ts +13 -22
  380. package/src/guards.ts +8 -14
  381. package/src/internal-schema.ts +4 -8
  382. package/src/metadata.ts +1 -2
  383. package/src/snapshot/adapter.ts +2 -3
  384. package/src/snapshot/adapters/fallback.ts +2 -3
  385. package/src/snapshot/adapters/node-test.ts +14 -20
  386. package/src/snapshot/select-adapter.ts +3 -3
  387. package/src/snapshot/serializer.ts +2 -3
  388. package/src/types.ts +2 -162
@@ -0,0 +1,225 @@
1
+ /**
2
+ * Type guard functions and runtime type checking utilities.
3
+ *
4
+ * This module provides various type guard functions for runtime type checking,
5
+ * including guards for Zod schemas, constructors, {@link PromiseLike} objects,
6
+ * and assertion parts. These are used throughout the library for safe type
7
+ * narrowing and validation.
8
+ *
9
+ * @module guards
10
+ * @category API
11
+ * @example
12
+ *
13
+ * ```ts
14
+ * import * as guards from 'bupkis/guards';
15
+ * ```
16
+ */
17
+ import { type z } from 'zod';
18
+ import type { PhraseLiteralChoice } from "./assertion/assertion-types.js";
19
+ import type { StandardSchemaV1 } from "./standard-schema.js";
20
+ import type { Constructor, ExpectItExecutor, PhraseLiteral, ZodTypeMap } from "./types.js";
21
+ /**
22
+ * Returns `true` if the given value looks like a Zod v4 schema, determined by
23
+ * the presence of an internal {@link z.core.$ZodTypeDef} field.
24
+ *
25
+ * Note: This relies on Zod's internal shape and is intended for runtime
26
+ * discrimination within this library.
27
+ *
28
+ * @template T - The specific ZodType to check for (based on def.type)
29
+ * @param value - Value to test
30
+ * @returns Whether the value is `ZodType`-like
31
+ */
32
+ export declare function isZodType<T extends keyof ZodTypeMap>(value: unknown, type: T): value is ZodTypeMap[T];
33
+ /**
34
+ * Returns `true` if the given value looks like a Zod v4 schema, determined by
35
+ * the presence of an internal {@link z.core.$ZodTypeDef} field.
36
+ *
37
+ * Note: This relies on Zod's internal shape and is intended for runtime
38
+ * discrimination within this library.
39
+ *
40
+ * @param value - Value to test
41
+ * @returns Whether the value is `ZodType`-like
42
+ */
43
+ export declare function isZodType(value: unknown): value is z.ZodType;
44
+ /**
45
+ * Returns `true` if the given value implements the Standard Schema v1
46
+ * interface.
47
+ *
48
+ * This guard checks for the presence of the `~standard` property with the
49
+ * required shape (version 1, vendor, validate function). It can detect any
50
+ * Standard Schema compliant library including Zod v4 (which implements the
51
+ * spec).
52
+ *
53
+ * @function
54
+ * @param value - Value to test
55
+ * @returns Whether the value is a Standard Schema v1 instance
56
+ * @see {@link https://standardschema.dev | Standard Schema Specification}
57
+ */
58
+ export declare const isStandardSchema: (value: unknown) => value is StandardSchemaV1;
59
+ /**
60
+ * Type guard for a plain object.
61
+ *
62
+ * @function
63
+ * @param value Value to test
64
+ * @returns `true` if the value is a plain object, `false` otherwise
65
+ */
66
+ export declare const isObject: (value: unknown) => value is NonNullable<object>;
67
+ /**
68
+ * Checks if a value is "promise-like", meaning it is a "thenable" object.
69
+ *
70
+ * @function
71
+ * @param value - Value to test
72
+ * @returns `true` if the value is promise-like, `false` otherwise
73
+ */
74
+ export declare const isPromiseLike: (value: unknown) => value is PromiseLike<unknown>;
75
+ /**
76
+ * Returns `true` if the given value is a constructable function (i.e., a
77
+ * class).
78
+ *
79
+ * This works by wrapping `fn` in a {@link Proxy}, attaching a no-op
80
+ * {@link ProxyHandler.construct} trap to it, then attempting to construct the
81
+ * proxy via `new`.
82
+ *
83
+ * @privateRemarks
84
+ * This may be the only way we can determine, at runtime, if a function is a
85
+ * constructor without actually calling it. I am unsure if this only works for
86
+ * classes.
87
+ * @function
88
+ * @param fn - Function to test
89
+ * @returns Whether the function is constructable
90
+ */
91
+ export declare const isConstructible: (fn: unknown) => fn is Constructor;
92
+ /**
93
+ * Type guard for a boolean value
94
+ *
95
+ * @function
96
+ * @param value Value to check
97
+ * @returns `true` if the value is a boolean, `false` otherwise
98
+ */
99
+ export declare const isBoolean: (value: unknown) => value is boolean;
100
+ /**
101
+ * Type guard for a function value
102
+ *
103
+ * @function
104
+ * @param value Value to check
105
+ * @returns `true` if the value is a function, `false` otherwise
106
+ */
107
+ export declare const isFunction: (value: unknown) => value is (...args: any[]) => any;
108
+ /**
109
+ * Type guard for a string value
110
+ *
111
+ * @function
112
+ * @param value Value to check
113
+ * @returns `true` if the value is a string, `false` otherwise
114
+ */
115
+ export declare const isString: (value: unknown) => value is string;
116
+ /**
117
+ * Type guard for a non-null object value
118
+ *
119
+ * @function
120
+ * @param value Value to check
121
+ * @returns `true` if the value is an object and not null, `false` otherwise
122
+ */
123
+ export declare const isNonNullObject: (value: unknown) => value is object;
124
+ /**
125
+ * Type guard for a valid WeakKey (object, function, or symbol).
126
+ *
127
+ * WeakMaps and WeakSets can only use objects (including functions) or symbols
128
+ * as keys, not primitives like strings, numbers, booleans, null, or undefined.
129
+ *
130
+ * @function
131
+ * @param value Value to check
132
+ * @returns `true` if the value is a valid WeakKey (object, function, or
133
+ * symbol), `false` otherwise
134
+ */
135
+ export declare const isWeakKey: (value: unknown) => value is WeakKey;
136
+ /**
137
+ * Type guard for a {@link PhraseLiteral} or {@link PhraseLiteralChoice}.
138
+ *
139
+ * @function
140
+ * @param value Value to check
141
+ * @returns `true` if the value is a `PhraseLiteral` or `PhraseLiteralChoice`,
142
+ * `false` otherwise
143
+ */
144
+ export declare const isPhrase: (value: unknown) => value is PhraseLiteral | PhraseLiteralChoice;
145
+ /**
146
+ * Generic type guard for instanceof checks.
147
+ *
148
+ * This function provides a type-safe way to check if a value is an instance of
149
+ * a given constructor, with proper type narrowing for TypeScript. It combines
150
+ * the null/object check with instanceof to ensure the value is a valid object
151
+ * before performing the instance check.
152
+ *
153
+ * @example
154
+ *
155
+ * ```typescript
156
+ * const obj = new Date();
157
+ * if (isA(obj, Date)) {
158
+ * // obj is now typed as Date
159
+ * console.log(obj.getTime());
160
+ * }
161
+ * ```
162
+ *
163
+ * @template T - The constructor type to check against
164
+ * @function
165
+ * @param value - Value to test
166
+ * @param ctor - Constructor function to check instanceof
167
+ * @returns `true` if the value is an instance of the constructor, `false`
168
+ * otherwise
169
+ */
170
+ export declare const isA: <T extends Constructor>(value: unknown, ctor: T) => value is InstanceType<T>;
171
+ /**
172
+ * Type guard for Error instances.
173
+ *
174
+ * This function checks if a value is an instance of the Error class or any of
175
+ * its subclasses. It's useful for error handling and type narrowing when
176
+ * working with unknown values that might be errors.
177
+ *
178
+ * Uses `Error.isError` if available.
179
+ *
180
+ * @example
181
+ *
182
+ * ```typescript
183
+ * try {
184
+ * throw new TypeError('Something went wrong');
185
+ * } catch (err) {
186
+ * if (isError(err)) {
187
+ * // err is now typed as Error
188
+ * console.log(err.message);
189
+ * }
190
+ * }
191
+ * ```
192
+ *
193
+ * @function
194
+ * @param value - Value to test
195
+ * @returns `true` if the value is an Error instance, `false` otherwise
196
+ */
197
+ export declare const isError: (value: unknown) => value is Error;
198
+ /**
199
+ * Type guard for {@link ExpectItExecutor} functions.
200
+ *
201
+ * This function checks if a value is an {@link ExpectItExecutor} function
202
+ * created by {@link bupkis!expect.it | expect.it()}. {@link ExpectItExecutor}
203
+ * functions are special functions that contain assertion logic and are marked
204
+ * with an internal symbol for identification. They are used in nested
205
+ * assertions within "to satisfy" patterns and other complex assertion
206
+ * scenarios.
207
+ *
208
+ * @example
209
+ *
210
+ * ```typescript
211
+ * const executor = expect.it('to be a string');
212
+ * if (isExpectItExecutor(executor)) {
213
+ * // executor is now typed as ExpectItExecutor
214
+ * // Can be used in satisfaction patterns
215
+ * }
216
+ * ```
217
+ *
218
+ * @template Subject - The subject type that the executor function operates on
219
+ * @function
220
+ * @param value - Value to test
221
+ * @returns `true` if the value is an ExpectItExecutor function, `false`
222
+ * otherwise
223
+ */
224
+ export declare const isExpectItExecutor: <Subject extends z.ZodType = z.ZodUnknown>(value: unknown) => value is ExpectItExecutor<Subject>;
225
+ //# sourceMappingURL=guards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../src/guards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,mBAAmB,EAAE,uCAAuC;AAC1E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;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,OACsB,CAAC;AA6B3E;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,GACnB,OAAO,OAAO,KACb,KAAK,IAAI,aAAa,GAAG,mBAC4B,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,GAAG,GAAI,CAAC,SAAS,WAAW,EACvC,OAAO,OAAO,EACd,MAAM,CAAC,KACN,KAAK,IAAI,YAAY,CAAC,CAAC,CAAoD,CAAC;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,OAAO,UAIN,OAAO,KAAG,KAAK,IAAI,KAC0B,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,kBAAkB,GAAI,OAAO,SAAS,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,UAAU,EACzE,OAAO,OAAO,KACb,KAAK,IAAI,gBAAgB,CAAC,OAAO,CAG+B,CAAC"}
package/dist/guards.js ADDED
@@ -0,0 +1,273 @@
1
+ /**
2
+ * Type guard functions and runtime type checking utilities.
3
+ *
4
+ * This module provides various type guard functions for runtime type checking,
5
+ * including guards for Zod schemas, constructors, {@link PromiseLike} objects,
6
+ * and assertion parts. These are used throughout the library for safe type
7
+ * narrowing and validation.
8
+ *
9
+ * @module guards
10
+ * @category API
11
+ * @example
12
+ *
13
+ * ```ts
14
+ * import * as guards from 'bupkis/guards';
15
+ * ```
16
+ */
17
+ import { kExpectIt } from "./constant.js";
18
+ const { isArray } = Array;
19
+ export function isZodType(value, type) {
20
+ const isValid = isObject(value) &&
21
+ 'def' in value &&
22
+ !!value.def &&
23
+ typeof value.def === 'object' &&
24
+ 'type' in value.def;
25
+ if (!isValid) {
26
+ return false;
27
+ }
28
+ if (type === undefined) {
29
+ return true;
30
+ }
31
+ return value.def.type === type;
32
+ }
33
+ /**
34
+ * Returns `true` if the given value implements the Standard Schema v1
35
+ * interface.
36
+ *
37
+ * This guard checks for the presence of the `~standard` property with the
38
+ * required shape (version 1, vendor, validate function). It can detect any
39
+ * Standard Schema compliant library including Zod v4 (which implements the
40
+ * spec).
41
+ *
42
+ * @function
43
+ * @param value - Value to test
44
+ * @returns Whether the value is a Standard Schema v1 instance
45
+ * @see {@link https://standardschema.dev | Standard Schema Specification}
46
+ */
47
+ export const isStandardSchema = (value) => {
48
+ // Some Standard Schema compliant libraries (e.g. ArkType) implement schemas
49
+ // as callable objects (functions with properties), so we must accept both
50
+ // plain objects and functions here.
51
+ if (!isObject(value) && !isFunction(value)) {
52
+ return false;
53
+ }
54
+ const v = value;
55
+ const std = v['~standard'];
56
+ return (isObject(std) &&
57
+ 'version' in std &&
58
+ std.version === 1 &&
59
+ 'vendor' in std &&
60
+ typeof std.vendor === 'string' &&
61
+ 'validate' in std &&
62
+ typeof std.validate === 'function');
63
+ };
64
+ /**
65
+ * Type guard for a plain object.
66
+ *
67
+ * @function
68
+ * @param value Value to test
69
+ * @returns `true` if the value is a plain object, `false` otherwise
70
+ */
71
+ export const isObject = (value) => typeof value === 'object' && value !== null && !isArray(value);
72
+ /**
73
+ * Checks if a value is "promise-like", meaning it is a "thenable" object.
74
+ *
75
+ * @function
76
+ * @param value - Value to test
77
+ * @returns `true` if the value is promise-like, `false` otherwise
78
+ */
79
+ export const isPromiseLike = (value) => isObject(value) &&
80
+ 'then' in value &&
81
+ isFunction(value.then) &&
82
+ value.then.length > 0;
83
+ /**
84
+ * Returns `true` if the given value is a constructable function (i.e., a
85
+ * class).
86
+ *
87
+ * This works by wrapping `fn` in a {@link Proxy}, attaching a no-op
88
+ * {@link ProxyHandler.construct} trap to it, then attempting to construct the
89
+ * proxy via `new`.
90
+ *
91
+ * @privateRemarks
92
+ * This may be the only way we can determine, at runtime, if a function is a
93
+ * constructor without actually calling it. I am unsure if this only works for
94
+ * classes.
95
+ * @function
96
+ * @param fn - Function to test
97
+ * @returns Whether the function is constructable
98
+ */
99
+ export const isConstructible = (fn) => {
100
+ if (fn === Symbol || fn === BigInt) {
101
+ return false;
102
+ }
103
+ try {
104
+ // this will throw if there is no `[[construct]]` slot.. or so I've heard.
105
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @bupkis/require-function-tag-in-arrow-functions
106
+ new new Proxy(fn, { construct: () => ({}) })();
107
+ return true;
108
+ }
109
+ catch {
110
+ return false;
111
+ }
112
+ };
113
+ /**
114
+ * Type guard for a boolean value
115
+ *
116
+ * @function
117
+ * @param value Value to check
118
+ * @returns `true` if the value is a boolean, `false` otherwise
119
+ */
120
+ export const isBoolean = (value) => typeof value === 'boolean';
121
+ /**
122
+ * Type guard for a function value
123
+ *
124
+ * @function
125
+ * @param value Value to check
126
+ * @returns `true` if the value is a function, `false` otherwise
127
+ */
128
+ export const isFunction = (value) => typeof value === 'function';
129
+ /**
130
+ * Type guard for a string value
131
+ *
132
+ * @function
133
+ * @param value Value to check
134
+ * @returns `true` if the value is a string, `false` otherwise
135
+ */
136
+ export const isString = (value) => typeof value === 'string';
137
+ /**
138
+ * Type guard for a non-null object value
139
+ *
140
+ * @function
141
+ * @param value Value to check
142
+ * @returns `true` if the value is an object and not null, `false` otherwise
143
+ */
144
+ export const isNonNullObject = (value) => typeof value === 'object' && value !== null;
145
+ /**
146
+ * Type guard for a valid WeakKey (object, function, or symbol).
147
+ *
148
+ * WeakMaps and WeakSets can only use objects (including functions) or symbols
149
+ * as keys, not primitives like strings, numbers, booleans, null, or undefined.
150
+ *
151
+ * @function
152
+ * @param value Value to check
153
+ * @returns `true` if the value is a valid WeakKey (object, function, or
154
+ * symbol), `false` otherwise
155
+ */
156
+ export const isWeakKey = (value) => isNonNullObject(value) || isFunction(value) || typeof value === 'symbol';
157
+ /**
158
+ * Type guard for a {@link PhraseLiteral}, which is just a string that does not
159
+ * begin with `not `.
160
+ *
161
+ * @function
162
+ * @param value Value to check
163
+ * @returns `true` if the value is a `PhraseLiteral`, `false` otherwise
164
+ * @internal
165
+ */
166
+ export const isPhraseLiteral = (value) => isString(value) && value !== 'and';
167
+ /**
168
+ * Type guard for a {@link PhraseLiteralChoice}, which is a tuple of strings.
169
+ *
170
+ * @function
171
+ * @param value Value to check
172
+ * @returns `true` if the value is a `PhraseLiteralChoice`, `false` otherwise
173
+ * @internal
174
+ */
175
+ export const isPhraseLiteralChoice = (value) => isArray(value) &&
176
+ value.length >= 1 &&
177
+ value.every((item) => isPhraseLiteral(item));
178
+ /**
179
+ * Type guard for a {@link PhraseLiteral} or {@link PhraseLiteralChoice}.
180
+ *
181
+ * @function
182
+ * @param value Value to check
183
+ * @returns `true` if the value is a `PhraseLiteral` or `PhraseLiteralChoice`,
184
+ * `false` otherwise
185
+ */
186
+ export const isPhrase = (value) => isPhraseLiteral(value) || isPhraseLiteralChoice(value);
187
+ /**
188
+ * Generic type guard for instanceof checks.
189
+ *
190
+ * This function provides a type-safe way to check if a value is an instance of
191
+ * a given constructor, with proper type narrowing for TypeScript. It combines
192
+ * the null/object check with instanceof to ensure the value is a valid object
193
+ * before performing the instance check.
194
+ *
195
+ * @example
196
+ *
197
+ * ```typescript
198
+ * const obj = new Date();
199
+ * if (isA(obj, Date)) {
200
+ * // obj is now typed as Date
201
+ * console.log(obj.getTime());
202
+ * }
203
+ * ```
204
+ *
205
+ * @template T - The constructor type to check against
206
+ * @function
207
+ * @param value - Value to test
208
+ * @param ctor - Constructor function to check instanceof
209
+ * @returns `true` if the value is an instance of the constructor, `false`
210
+ * otherwise
211
+ */
212
+ export const isA = (value, ctor) => isNonNullObject(value) && value instanceof ctor;
213
+ /**
214
+ * Type guard for Error instances.
215
+ *
216
+ * This function checks if a value is an instance of the Error class or any of
217
+ * its subclasses. It's useful for error handling and type narrowing when
218
+ * working with unknown values that might be errors.
219
+ *
220
+ * Uses `Error.isError` if available.
221
+ *
222
+ * @example
223
+ *
224
+ * ```typescript
225
+ * try {
226
+ * throw new TypeError('Something went wrong');
227
+ * } catch (err) {
228
+ * if (isError(err)) {
229
+ * // err is now typed as Error
230
+ * console.log(err.message);
231
+ * }
232
+ * }
233
+ * ```
234
+ *
235
+ * @function
236
+ * @param value - Value to test
237
+ * @returns `true` if the value is an Error instance, `false` otherwise
238
+ */
239
+ export const isError = 'isError' in Error && isFunction(Error.isError)
240
+ ? // @ts-expect-error - Error.isError is new
241
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call
242
+ (value) => Error.isError(value)
243
+ : (value) => isA(value, Error);
244
+ /**
245
+ * Type guard for {@link ExpectItExecutor} functions.
246
+ *
247
+ * This function checks if a value is an {@link ExpectItExecutor} function
248
+ * created by {@link bupkis!expect.it | expect.it()}. {@link ExpectItExecutor}
249
+ * functions are special functions that contain assertion logic and are marked
250
+ * with an internal symbol for identification. They are used in nested
251
+ * assertions within "to satisfy" patterns and other complex assertion
252
+ * scenarios.
253
+ *
254
+ * @example
255
+ *
256
+ * ```typescript
257
+ * const executor = expect.it('to be a string');
258
+ * if (isExpectItExecutor(executor)) {
259
+ * // executor is now typed as ExpectItExecutor
260
+ * // Can be used in satisfaction patterns
261
+ * }
262
+ * ```
263
+ *
264
+ * @template Subject - The subject type that the executor function operates on
265
+ * @function
266
+ * @param value - Value to test
267
+ * @returns `true` if the value is an ExpectItExecutor function, `false`
268
+ * otherwise
269
+ */
270
+ export const isExpectItExecutor = (value) => isFunction(value) &&
271
+ kExpectIt in value &&
272
+ value[kExpectIt] === true;
273
+ //# sourceMappingURL=guards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guards.js","sourceRoot":"","sources":["../src/guards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAaH,OAAO,EAAE,SAAS,EAAE,sBAAsB;AAE1C,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;AA4B1B,MAAM,UAAU,SAAS,CACvB,KAAc,EACd,IAAQ;IAER,MAAM,OAAO,GACX,QAAQ,CAAC,KAAK,CAAC;QACf,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AC,KAAK,CAAC;IACjB,SAAS,IAAI,KAAK;IACjB,KAA4C,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC"}
package/dist/index.cjs ADDED
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ /**
3
+ * Main entry point for the Bupkis assertion library.
4
+ *
5
+ * This module exports all public APIs including the main `expect` function,
6
+ * asynchronous `expectAsync` function, assertion creation utilities, type
7
+ * guards, schema definitions, utility functions, and error types.
8
+ *
9
+ * @module bupkis
10
+ * @category API
11
+ * @example
12
+ *
13
+ * ```ts
14
+ * import { expect, expectAsync, z, createAssertion } from 'bupkis';
15
+ * ```
16
+ *
17
+ * {@link https://zod.dev | Zod v4} is exported as `z` if you aren't already
18
+ * using a {@link https://standardschema.dev | Standard Schema V1}-compatible
19
+ * validation library.
20
+ */
21
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
22
+ if (k2 === undefined) k2 = k;
23
+ var desc = Object.getOwnPropertyDescriptor(m, k);
24
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
25
+ desc = { enumerable: true, get: function() { return m[k]; } };
26
+ }
27
+ Object.defineProperty(o, k2, desc);
28
+ }) : (function(o, m, k, k2) {
29
+ if (k2 === undefined) k2 = k;
30
+ o[k2] = m[k];
31
+ }));
32
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
33
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
34
+ }) : function(o, v) {
35
+ o["default"] = v;
36
+ });
37
+ var __importStar = (this && this.__importStar) || (function () {
38
+ var ownKeys = function(o) {
39
+ ownKeys = Object.getOwnPropertyNames || function (o) {
40
+ var ar = [];
41
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
42
+ return ar;
43
+ };
44
+ return ownKeys(o);
45
+ };
46
+ return function (mod) {
47
+ if (mod && mod.__esModule) return mod;
48
+ var result = {};
49
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
50
+ __setModuleDefault(result, mod);
51
+ return result;
52
+ };
53
+ })();
54
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
55
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
56
+ };
57
+ Object.defineProperty(exports, "__esModule", { value: true });
58
+ exports.use = exports.fail = exports.createAsyncAssertion = exports.createAssertion = exports.z = exports.schema = exports.expectAsync = exports.expect = exports.assertions = void 0;
59
+ const zod_1 = require("zod");
60
+ Object.defineProperty(exports, "z", { enumerable: true, get: function () { return zod_1.z; } });
61
+ const bootstrap_js_1 = require("./bootstrap.cjs");
62
+ exports.assertions = __importStar(require("./assertion/impl/index.cjs"));
63
+ var bootstrap_js_2 = require("./bootstrap.cjs");
64
+ Object.defineProperty(exports, "expect", { enumerable: true, get: function () { return bootstrap_js_2.expect; } });
65
+ Object.defineProperty(exports, "expectAsync", { enumerable: true, get: function () { return bootstrap_js_2.expectAsync; } });
66
+ __exportStar(require("./error.cjs"), exports);
67
+ exports.schema = __importStar(require("./schema.cjs"));
68
+ const {
69
+ /**
70
+ * The main factory function for creating asynchronous assertions.
71
+ *
72
+ * Exported from the entry point; is also a property of {@link Expect} and
73
+ * {@link ExpectAsync}.
74
+ *
75
+ * @function
76
+ * @primaryExport
77
+ * @group Core API
78
+ */
79
+ createAssertion,
80
+ /**
81
+ * The main factory function for creating asynchronous assertions.
82
+ *
83
+ * Exported from the entry point; is also a property of {@link Expect} and
84
+ * {@link ExpectAsync}.
85
+ *
86
+ * @function
87
+ * @primaryExport
88
+ * @group Core API
89
+ */
90
+ createAsyncAssertion,
91
+ /**
92
+ * {@inheritDoc FailFn}
93
+ *
94
+ * @function
95
+ * @primaryExport
96
+ * @group Core API
97
+ */
98
+ fail,
99
+ /**
100
+ * {@inheritDoc UseFn}
101
+ *
102
+ * @function
103
+ * @primaryExport
104
+ * @group Core API
105
+ */
106
+ use, ..._rest } = bootstrap_js_1.expect;
107
+ exports.createAssertion = createAssertion;
108
+ exports.createAsyncAssertion = createAsyncAssertion;
109
+ exports.fail = fail;
110
+ exports.use = use;
111
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6BAAwB;AAgCf,kFAhCA,OAAC,OAgCA;AA9BV,kDAA6D;AAC7D,yEAAwD;AACxD,gDAAqD;AAA5C,sGAAA,MAAM,OAAA;AAAE,2GAAA,WAAW,OAAA;AAQ5B,8CAA2B;AAE3B,uDAAsC;AA2DtC,MAAM;AACJ;;;;;;;;;GASG;AACH,eAAe;AACf;;;;;;;;;GASG;AACH,oBAAoB;AACpB;;;;;;GAMG;AACH,IAAI;AACJ;;;;;;GAMG;AACH,GAAG,EACH,GAAG,KAAK,EACT,GAAG,qBAAiB,CAAC;AAzCb,0CAAe;AAAE,oDAAoB;AAAE,oBAAI;AAAE,kBAAG"}