bupkis 0.18.1 → 0.18.2

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 (376) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/package.json +1 -4
  3. package/src/assertion/assertion-types.ts +4 -4
  4. package/src/assertion/impl/sync-parametric.ts +1 -1
  5. package/src/expect.ts +0 -4
  6. package/src/guards.ts +24 -24
  7. package/src/internal-schema.ts +16 -32
  8. package/src/value-to-schema.ts +1 -1
  9. package/dist/assertion/assertion-async.cjs +0 -268
  10. package/dist/assertion/assertion-async.cjs.map +0 -1
  11. package/dist/assertion/assertion-async.d.cts +0 -40
  12. package/dist/assertion/assertion-async.d.cts.map +0 -1
  13. package/dist/assertion/assertion-async.d.ts +0 -40
  14. package/dist/assertion/assertion-async.d.ts.map +0 -1
  15. package/dist/assertion/assertion-async.js +0 -259
  16. package/dist/assertion/assertion-async.js.map +0 -1
  17. package/dist/assertion/assertion-standard-schema-async.cjs +0 -132
  18. package/dist/assertion/assertion-standard-schema-async.cjs.map +0 -1
  19. package/dist/assertion/assertion-standard-schema-async.d.cts +0 -52
  20. package/dist/assertion/assertion-standard-schema-async.d.cts.map +0 -1
  21. package/dist/assertion/assertion-standard-schema-async.d.ts +0 -52
  22. package/dist/assertion/assertion-standard-schema-async.d.ts.map +0 -1
  23. package/dist/assertion/assertion-standard-schema-async.js +0 -128
  24. package/dist/assertion/assertion-standard-schema-async.js.map +0 -1
  25. package/dist/assertion/assertion-standard-schema-sync.cjs +0 -141
  26. package/dist/assertion/assertion-standard-schema-sync.cjs.map +0 -1
  27. package/dist/assertion/assertion-standard-schema-sync.d.cts +0 -52
  28. package/dist/assertion/assertion-standard-schema-sync.d.cts.map +0 -1
  29. package/dist/assertion/assertion-standard-schema-sync.d.ts +0 -52
  30. package/dist/assertion/assertion-standard-schema-sync.d.ts.map +0 -1
  31. package/dist/assertion/assertion-standard-schema-sync.js +0 -137
  32. package/dist/assertion/assertion-standard-schema-sync.js.map +0 -1
  33. package/dist/assertion/assertion-sync.cjs +0 -284
  34. package/dist/assertion/assertion-sync.cjs.map +0 -1
  35. package/dist/assertion/assertion-sync.d.cts +0 -60
  36. package/dist/assertion/assertion-sync.d.cts.map +0 -1
  37. package/dist/assertion/assertion-sync.d.ts +0 -60
  38. package/dist/assertion/assertion-sync.d.ts.map +0 -1
  39. package/dist/assertion/assertion-sync.js +0 -275
  40. package/dist/assertion/assertion-sync.js.map +0 -1
  41. package/dist/assertion/assertion-types.cjs +0 -20
  42. package/dist/assertion/assertion-types.cjs.map +0 -1
  43. package/dist/assertion/assertion-types.d.cts +0 -1086
  44. package/dist/assertion/assertion-types.d.cts.map +0 -1
  45. package/dist/assertion/assertion-types.d.ts +0 -1086
  46. package/dist/assertion/assertion-types.d.ts.map +0 -1
  47. package/dist/assertion/assertion-types.js +0 -19
  48. package/dist/assertion/assertion-types.js.map +0 -1
  49. package/dist/assertion/assertion.cjs +0 -382
  50. package/dist/assertion/assertion.cjs.map +0 -1
  51. package/dist/assertion/assertion.d.cts +0 -109
  52. package/dist/assertion/assertion.d.cts.map +0 -1
  53. package/dist/assertion/assertion.d.ts +0 -109
  54. package/dist/assertion/assertion.d.ts.map +0 -1
  55. package/dist/assertion/assertion.js +0 -375
  56. package/dist/assertion/assertion.js.map +0 -1
  57. package/dist/assertion/create.cjs +0 -148
  58. package/dist/assertion/create.cjs.map +0 -1
  59. package/dist/assertion/create.d.cts +0 -85
  60. package/dist/assertion/create.d.cts.map +0 -1
  61. package/dist/assertion/create.d.ts +0 -85
  62. package/dist/assertion/create.d.ts.map +0 -1
  63. package/dist/assertion/create.js +0 -143
  64. package/dist/assertion/create.js.map +0 -1
  65. package/dist/assertion/format-assertion-failure.cjs +0 -63
  66. package/dist/assertion/format-assertion-failure.cjs.map +0 -1
  67. package/dist/assertion/format-assertion-failure.d.cts +0 -21
  68. package/dist/assertion/format-assertion-failure.d.cts.map +0 -1
  69. package/dist/assertion/format-assertion-failure.d.ts +0 -21
  70. package/dist/assertion/format-assertion-failure.d.ts.map +0 -1
  71. package/dist/assertion/format-assertion-failure.js +0 -59
  72. package/dist/assertion/format-assertion-failure.js.map +0 -1
  73. package/dist/assertion/impl/assertion-util.cjs +0 -68
  74. package/dist/assertion/impl/assertion-util.cjs.map +0 -1
  75. package/dist/assertion/impl/assertion-util.d.cts +0 -36
  76. package/dist/assertion/impl/assertion-util.d.cts.map +0 -1
  77. package/dist/assertion/impl/assertion-util.d.ts +0 -36
  78. package/dist/assertion/impl/assertion-util.d.ts.map +0 -1
  79. package/dist/assertion/impl/assertion-util.js +0 -62
  80. package/dist/assertion/impl/assertion-util.js.map +0 -1
  81. package/dist/assertion/impl/async-iterable.cjs +0 -627
  82. package/dist/assertion/impl/async-iterable.cjs.map +0 -1
  83. package/dist/assertion/impl/async-iterable.d.cts +0 -406
  84. package/dist/assertion/impl/async-iterable.d.cts.map +0 -1
  85. package/dist/assertion/impl/async-iterable.d.ts +0 -406
  86. package/dist/assertion/impl/async-iterable.d.ts.map +0 -1
  87. package/dist/assertion/impl/async-iterable.js +0 -624
  88. package/dist/assertion/impl/async-iterable.js.map +0 -1
  89. package/dist/assertion/impl/async-parametric.cjs +0 -412
  90. package/dist/assertion/impl/async-parametric.cjs.map +0 -1
  91. package/dist/assertion/impl/async-parametric.d.cts +0 -278
  92. package/dist/assertion/impl/async-parametric.d.cts.map +0 -1
  93. package/dist/assertion/impl/async-parametric.d.ts +0 -278
  94. package/dist/assertion/impl/async-parametric.d.ts.map +0 -1
  95. package/dist/assertion/impl/async-parametric.js +0 -409
  96. package/dist/assertion/impl/async-parametric.js.map +0 -1
  97. package/dist/assertion/impl/async.cjs +0 -56
  98. package/dist/assertion/impl/async.cjs.map +0 -1
  99. package/dist/assertion/impl/async.d.cts +0 -179
  100. package/dist/assertion/impl/async.d.cts.map +0 -1
  101. package/dist/assertion/impl/async.d.ts +0 -179
  102. package/dist/assertion/impl/async.d.ts.map +0 -1
  103. package/dist/assertion/impl/async.js +0 -39
  104. package/dist/assertion/impl/async.js.map +0 -1
  105. package/dist/assertion/impl/index.cjs +0 -37
  106. package/dist/assertion/impl/index.cjs.map +0 -1
  107. package/dist/assertion/impl/index.d.cts +0 -21
  108. package/dist/assertion/impl/index.d.cts.map +0 -1
  109. package/dist/assertion/impl/index.d.ts +0 -21
  110. package/dist/assertion/impl/index.d.ts.map +0 -1
  111. package/dist/assertion/impl/index.js +0 -21
  112. package/dist/assertion/impl/index.js.map +0 -1
  113. package/dist/assertion/impl/iteration-util.cjs +0 -297
  114. package/dist/assertion/impl/iteration-util.cjs.map +0 -1
  115. package/dist/assertion/impl/iteration-util.d.cts +0 -12
  116. package/dist/assertion/impl/iteration-util.d.cts.map +0 -1
  117. package/dist/assertion/impl/iteration-util.d.ts +0 -12
  118. package/dist/assertion/impl/iteration-util.d.ts.map +0 -1
  119. package/dist/assertion/impl/iteration-util.js +0 -282
  120. package/dist/assertion/impl/iteration-util.js.map +0 -1
  121. package/dist/assertion/impl/snapshot.cjs +0 -276
  122. package/dist/assertion/impl/snapshot.cjs.map +0 -1
  123. package/dist/assertion/impl/snapshot.d.cts +0 -278
  124. package/dist/assertion/impl/snapshot.d.cts.map +0 -1
  125. package/dist/assertion/impl/snapshot.d.ts +0 -278
  126. package/dist/assertion/impl/snapshot.d.ts.map +0 -1
  127. package/dist/assertion/impl/snapshot.js +0 -273
  128. package/dist/assertion/impl/snapshot.js.map +0 -1
  129. package/dist/assertion/impl/sync-basic.cjs +0 -553
  130. package/dist/assertion/impl/sync-basic.cjs.map +0 -1
  131. package/dist/assertion/impl/sync-basic.d.cts +0 -528
  132. package/dist/assertion/impl/sync-basic.d.cts.map +0 -1
  133. package/dist/assertion/impl/sync-basic.d.ts +0 -528
  134. package/dist/assertion/impl/sync-basic.d.ts.map +0 -1
  135. package/dist/assertion/impl/sync-basic.js +0 -550
  136. package/dist/assertion/impl/sync-basic.js.map +0 -1
  137. package/dist/assertion/impl/sync-collection.cjs +0 -856
  138. package/dist/assertion/impl/sync-collection.cjs.map +0 -1
  139. package/dist/assertion/impl/sync-collection.d.cts +0 -607
  140. package/dist/assertion/impl/sync-collection.d.cts.map +0 -1
  141. package/dist/assertion/impl/sync-collection.d.ts +0 -607
  142. package/dist/assertion/impl/sync-collection.d.ts.map +0 -1
  143. package/dist/assertion/impl/sync-collection.js +0 -850
  144. package/dist/assertion/impl/sync-collection.js.map +0 -1
  145. package/dist/assertion/impl/sync-date.cjs +0 -341
  146. package/dist/assertion/impl/sync-date.cjs.map +0 -1
  147. package/dist/assertion/impl/sync-date.d.cts +0 -209
  148. package/dist/assertion/impl/sync-date.d.cts.map +0 -1
  149. package/dist/assertion/impl/sync-date.d.ts +0 -209
  150. package/dist/assertion/impl/sync-date.d.ts.map +0 -1
  151. package/dist/assertion/impl/sync-date.js +0 -338
  152. package/dist/assertion/impl/sync-date.js.map +0 -1
  153. package/dist/assertion/impl/sync-esoteric.cjs +0 -214
  154. package/dist/assertion/impl/sync-esoteric.cjs.map +0 -1
  155. package/dist/assertion/impl/sync-esoteric.d.cts +0 -191
  156. package/dist/assertion/impl/sync-esoteric.d.cts.map +0 -1
  157. package/dist/assertion/impl/sync-esoteric.d.ts +0 -191
  158. package/dist/assertion/impl/sync-esoteric.d.ts.map +0 -1
  159. package/dist/assertion/impl/sync-esoteric.js +0 -211
  160. package/dist/assertion/impl/sync-esoteric.js.map +0 -1
  161. package/dist/assertion/impl/sync-iterable.cjs +0 -512
  162. package/dist/assertion/impl/sync-iterable.cjs.map +0 -1
  163. package/dist/assertion/impl/sync-iterable.d.cts +0 -334
  164. package/dist/assertion/impl/sync-iterable.d.cts.map +0 -1
  165. package/dist/assertion/impl/sync-iterable.d.ts +0 -334
  166. package/dist/assertion/impl/sync-iterable.d.ts.map +0 -1
  167. package/dist/assertion/impl/sync-iterable.js +0 -509
  168. package/dist/assertion/impl/sync-iterable.js.map +0 -1
  169. package/dist/assertion/impl/sync-parametric.cjs +0 -805
  170. package/dist/assertion/impl/sync-parametric.cjs.map +0 -1
  171. package/dist/assertion/impl/sync-parametric.d.cts +0 -560
  172. package/dist/assertion/impl/sync-parametric.d.cts.map +0 -1
  173. package/dist/assertion/impl/sync-parametric.d.ts +0 -560
  174. package/dist/assertion/impl/sync-parametric.d.ts.map +0 -1
  175. package/dist/assertion/impl/sync-parametric.js +0 -802
  176. package/dist/assertion/impl/sync-parametric.js.map +0 -1
  177. package/dist/assertion/impl/sync.cjs +0 -214
  178. package/dist/assertion/impl/sync.cjs.map +0 -1
  179. package/dist/assertion/impl/sync.d.cts +0 -512
  180. package/dist/assertion/impl/sync.d.cts.map +0 -1
  181. package/dist/assertion/impl/sync.d.ts +0 -512
  182. package/dist/assertion/impl/sync.d.ts.map +0 -1
  183. package/dist/assertion/impl/sync.js +0 -197
  184. package/dist/assertion/impl/sync.js.map +0 -1
  185. package/dist/assertion/index.cjs +0 -38
  186. package/dist/assertion/index.cjs.map +0 -1
  187. package/dist/assertion/index.d.cts +0 -18
  188. package/dist/assertion/index.d.cts.map +0 -1
  189. package/dist/assertion/index.d.ts +0 -18
  190. package/dist/assertion/index.d.ts.map +0 -1
  191. package/dist/assertion/index.js +0 -17
  192. package/dist/assertion/index.js.map +0 -1
  193. package/dist/assertion/slotify.cjs +0 -165
  194. package/dist/assertion/slotify.cjs.map +0 -1
  195. package/dist/assertion/slotify.d.cts +0 -11
  196. package/dist/assertion/slotify.d.cts.map +0 -1
  197. package/dist/assertion/slotify.d.ts +0 -11
  198. package/dist/assertion/slotify.d.ts.map +0 -1
  199. package/dist/assertion/slotify.js +0 -161
  200. package/dist/assertion/slotify.js.map +0 -1
  201. package/dist/bootstrap.cjs +0 -43
  202. package/dist/bootstrap.cjs.map +0 -1
  203. package/dist/bootstrap.d.cts +0 -27
  204. package/dist/bootstrap.d.cts.map +0 -1
  205. package/dist/bootstrap.d.ts +0 -27
  206. package/dist/bootstrap.d.ts.map +0 -1
  207. package/dist/bootstrap.js +0 -40
  208. package/dist/bootstrap.js.map +0 -1
  209. package/dist/constant.cjs +0 -82
  210. package/dist/constant.cjs.map +0 -1
  211. package/dist/constant.d.cts +0 -69
  212. package/dist/constant.d.cts.map +0 -1
  213. package/dist/constant.d.ts +0 -69
  214. package/dist/constant.d.ts.map +0 -1
  215. package/dist/constant.js +0 -79
  216. package/dist/constant.js.map +0 -1
  217. package/dist/diff.cjs +0 -340
  218. package/dist/diff.cjs.map +0 -1
  219. package/dist/diff.d.cts +0 -51
  220. package/dist/diff.d.cts.map +0 -1
  221. package/dist/diff.d.ts +0 -51
  222. package/dist/diff.d.ts.map +0 -1
  223. package/dist/diff.js +0 -334
  224. package/dist/diff.js.map +0 -1
  225. package/dist/error.cjs +0 -204
  226. package/dist/error.cjs.map +0 -1
  227. package/dist/error.d.cts +0 -212
  228. package/dist/error.d.cts.map +0 -1
  229. package/dist/error.d.ts +0 -212
  230. package/dist/error.d.ts.map +0 -1
  231. package/dist/error.js +0 -191
  232. package/dist/error.js.map +0 -1
  233. package/dist/expect.cjs +0 -590
  234. package/dist/expect.cjs.map +0 -1
  235. package/dist/expect.d.cts +0 -138
  236. package/dist/expect.d.cts.map +0 -1
  237. package/dist/expect.d.ts +0 -138
  238. package/dist/expect.d.ts.map +0 -1
  239. package/dist/expect.js +0 -582
  240. package/dist/expect.js.map +0 -1
  241. package/dist/guards.cjs +0 -297
  242. package/dist/guards.cjs.map +0 -1
  243. package/dist/guards.d.cts +0 -231
  244. package/dist/guards.d.cts.map +0 -1
  245. package/dist/guards.d.ts +0 -231
  246. package/dist/guards.d.ts.map +0 -1
  247. package/dist/guards.js +0 -277
  248. package/dist/guards.js.map +0 -1
  249. package/dist/index.cjs +0 -111
  250. package/dist/index.cjs.map +0 -1
  251. package/dist/index.d.cts +0 -448
  252. package/dist/index.d.cts.map +0 -1
  253. package/dist/index.d.ts +0 -448
  254. package/dist/index.d.ts.map +0 -1
  255. package/dist/index.js +0 -71
  256. package/dist/index.js.map +0 -1
  257. package/dist/internal-schema.cjs +0 -253
  258. package/dist/internal-schema.cjs.map +0 -1
  259. package/dist/internal-schema.d.cts +0 -8
  260. package/dist/internal-schema.d.cts.map +0 -1
  261. package/dist/internal-schema.d.ts +0 -8
  262. package/dist/internal-schema.d.ts.map +0 -1
  263. package/dist/internal-schema.js +0 -248
  264. package/dist/internal-schema.js.map +0 -1
  265. package/dist/metadata.cjs +0 -57
  266. package/dist/metadata.cjs.map +0 -1
  267. package/dist/metadata.d.cts +0 -27
  268. package/dist/metadata.d.cts.map +0 -1
  269. package/dist/metadata.d.ts +0 -27
  270. package/dist/metadata.d.ts.map +0 -1
  271. package/dist/metadata.js +0 -54
  272. package/dist/metadata.js.map +0 -1
  273. package/dist/schema.cjs +0 -1522
  274. package/dist/schema.cjs.map +0 -1
  275. package/dist/schema.d.cts +0 -1196
  276. package/dist/schema.d.cts.map +0 -1
  277. package/dist/schema.d.ts +0 -1196
  278. package/dist/schema.d.ts.map +0 -1
  279. package/dist/schema.js +0 -1516
  280. package/dist/schema.js.map +0 -1
  281. package/dist/snapshot/adapter.cjs +0 -31
  282. package/dist/snapshot/adapter.cjs.map +0 -1
  283. package/dist/snapshot/adapter.d.cts +0 -258
  284. package/dist/snapshot/adapter.d.cts.map +0 -1
  285. package/dist/snapshot/adapter.d.ts +0 -258
  286. package/dist/snapshot/adapter.d.ts.map +0 -1
  287. package/dist/snapshot/adapter.js +0 -27
  288. package/dist/snapshot/adapter.js.map +0 -1
  289. package/dist/snapshot/adapters/fallback.cjs +0 -453
  290. package/dist/snapshot/adapters/fallback.cjs.map +0 -1
  291. package/dist/snapshot/adapters/fallback.d.cts +0 -185
  292. package/dist/snapshot/adapters/fallback.d.cts.map +0 -1
  293. package/dist/snapshot/adapters/fallback.d.ts +0 -185
  294. package/dist/snapshot/adapters/fallback.d.ts.map +0 -1
  295. package/dist/snapshot/adapters/fallback.js +0 -446
  296. package/dist/snapshot/adapters/fallback.js.map +0 -1
  297. package/dist/snapshot/adapters/node-test.cjs +0 -301
  298. package/dist/snapshot/adapters/node-test.cjs.map +0 -1
  299. package/dist/snapshot/adapters/node-test.d.cts +0 -131
  300. package/dist/snapshot/adapters/node-test.d.cts.map +0 -1
  301. package/dist/snapshot/adapters/node-test.d.ts +0 -131
  302. package/dist/snapshot/adapters/node-test.d.ts.map +0 -1
  303. package/dist/snapshot/adapters/node-test.js +0 -297
  304. package/dist/snapshot/adapters/node-test.js.map +0 -1
  305. package/dist/snapshot/index.cjs +0 -61
  306. package/dist/snapshot/index.cjs.map +0 -1
  307. package/dist/snapshot/index.d.cts +0 -40
  308. package/dist/snapshot/index.d.cts.map +0 -1
  309. package/dist/snapshot/index.d.ts +0 -40
  310. package/dist/snapshot/index.d.ts.map +0 -1
  311. package/dist/snapshot/index.js +0 -44
  312. package/dist/snapshot/index.js.map +0 -1
  313. package/dist/snapshot/node-version.cjs +0 -49
  314. package/dist/snapshot/node-version.cjs.map +0 -1
  315. package/dist/snapshot/node-version.d.cts +0 -34
  316. package/dist/snapshot/node-version.d.cts.map +0 -1
  317. package/dist/snapshot/node-version.d.ts +0 -34
  318. package/dist/snapshot/node-version.d.ts.map +0 -1
  319. package/dist/snapshot/node-version.js +0 -44
  320. package/dist/snapshot/node-version.js.map +0 -1
  321. package/dist/snapshot/select-adapter.cjs +0 -170
  322. package/dist/snapshot/select-adapter.cjs.map +0 -1
  323. package/dist/snapshot/select-adapter.d.cts +0 -128
  324. package/dist/snapshot/select-adapter.d.cts.map +0 -1
  325. package/dist/snapshot/select-adapter.d.ts +0 -128
  326. package/dist/snapshot/select-adapter.d.ts.map +0 -1
  327. package/dist/snapshot/select-adapter.js +0 -164
  328. package/dist/snapshot/select-adapter.js.map +0 -1
  329. package/dist/snapshot/serializer.cjs +0 -246
  330. package/dist/snapshot/serializer.cjs.map +0 -1
  331. package/dist/snapshot/serializer.d.cts +0 -126
  332. package/dist/snapshot/serializer.d.cts.map +0 -1
  333. package/dist/snapshot/serializer.d.ts +0 -126
  334. package/dist/snapshot/serializer.d.ts.map +0 -1
  335. package/dist/snapshot/serializer.js +0 -238
  336. package/dist/snapshot/serializer.js.map +0 -1
  337. package/dist/standard-schema.cjs +0 -13
  338. package/dist/standard-schema.cjs.map +0 -1
  339. package/dist/standard-schema.d.cts +0 -192
  340. package/dist/standard-schema.d.cts.map +0 -1
  341. package/dist/standard-schema.d.ts +0 -192
  342. package/dist/standard-schema.d.ts.map +0 -1
  343. package/dist/standard-schema.js +0 -12
  344. package/dist/standard-schema.js.map +0 -1
  345. package/dist/types.cjs +0 -22
  346. package/dist/types.cjs.map +0 -1
  347. package/dist/types.d.cts +0 -905
  348. package/dist/types.d.cts.map +0 -1
  349. package/dist/types.d.ts +0 -905
  350. package/dist/types.d.ts.map +0 -1
  351. package/dist/types.js +0 -21
  352. package/dist/types.js.map +0 -1
  353. package/dist/use.cjs +0 -240
  354. package/dist/use.cjs.map +0 -1
  355. package/dist/use.d.cts +0 -8
  356. package/dist/use.d.cts.map +0 -1
  357. package/dist/use.d.ts +0 -8
  358. package/dist/use.d.ts.map +0 -1
  359. package/dist/use.js +0 -236
  360. package/dist/use.js.map +0 -1
  361. package/dist/util.cjs +0 -255
  362. package/dist/util.cjs.map +0 -1
  363. package/dist/util.d.cts +0 -141
  364. package/dist/util.d.cts.map +0 -1
  365. package/dist/util.d.ts +0 -141
  366. package/dist/util.d.ts.map +0 -1
  367. package/dist/util.js +0 -234
  368. package/dist/util.js.map +0 -1
  369. package/dist/value-to-schema.cjs +0 -537
  370. package/dist/value-to-schema.cjs.map +0 -1
  371. package/dist/value-to-schema.d.cts +0 -144
  372. package/dist/value-to-schema.d.cts.map +0 -1
  373. package/dist/value-to-schema.d.ts +0 -144
  374. package/dist/value-to-schema.d.ts.map +0 -1
  375. package/dist/value-to-schema.js +0 -533
  376. package/dist/value-to-schema.js.map +0 -1
@@ -1,21 +0,0 @@
1
- /**
2
- * This namespace contains all of <span class="bupkis">BUPKIS</span>' built-in
3
- * assertions.
4
- *
5
- * Each implements {@link bupkis!types.Assertion | Assertion}. While these
6
- * contain example usage, it may be more helpful to refer to the [Assertions
7
- * Reference](/assertions); these are exposed for those building on top of <span
8
- * class="bupkis">BUPKIS</span>.
9
- *
10
- * @packageDocumentation
11
- */
12
- export * from "./async-parametric.js";
13
- export * from "./async.js";
14
- export * from "./snapshot.js";
15
- export * from "./sync-basic.js";
16
- export * from "./sync-collection.js";
17
- export * from "./sync-date.js";
18
- export * from "./sync-esoteric.js";
19
- export * from "./sync-parametric.js";
20
- export * from "./sync.js";
21
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/assertion/impl/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,sCAAsC;AACtC,2BAA2B;AAC3B,8BAA8B;AAC9B,gCAAgC;AAChC,qCAAqC;AACrC,+BAA+B;AAC/B,mCAAmC;AACnC,qCAAqC;AACrC,0BAA0B"}
@@ -1,21 +0,0 @@
1
- /**
2
- * This namespace contains all of <span class="bupkis">BUPKIS</span>' built-in
3
- * assertions.
4
- *
5
- * Each implements {@link bupkis!types.Assertion | Assertion}. While these
6
- * contain example usage, it may be more helpful to refer to the [Assertions
7
- * Reference](/assertions); these are exposed for those building on top of <span
8
- * class="bupkis">BUPKIS</span>.
9
- *
10
- * @packageDocumentation
11
- */
12
- export * from "./async-parametric.js";
13
- export * from "./async.js";
14
- export * from "./snapshot.js";
15
- export * from "./sync-basic.js";
16
- export * from "./sync-collection.js";
17
- export * from "./sync-date.js";
18
- export * from "./sync-esoteric.js";
19
- export * from "./sync-parametric.js";
20
- export * from "./sync.js";
21
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/assertion/impl/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,sCAAsC;AACtC,2BAA2B;AAC3B,8BAA8B;AAC9B,gCAAgC;AAChC,qCAAqC;AACrC,+BAA+B;AAC/B,mCAAmC;AACnC,qCAAqC;AACrC,0BAA0B"}
@@ -1,297 +0,0 @@
1
- "use strict";
2
- /**
3
- * Utility functions for working with sync and async iterables/iterators.
4
- *
5
- * These helpers normalize the various forms of iterables (arrays, generators,
6
- * streams, raw iterators) into a consistent iterator interface for use in
7
- * assertions.
8
- *
9
- * @module assertion/impl/iteration-util
10
- * @internal
11
- */
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.toAsyncIterator = exports.iterateFullyAsync = exports.lastAsync = exports.firstAsync = exports.countAsync = exports.collectAsync = exports.toIterator = exports.iterateFullySync = exports.lastSync = exports.firstSync = exports.countSync = exports.collectSync = void 0;
14
- const { asyncIterator: asyncIteratorSymbol, iterator: iteratorSymbol } = Symbol;
15
- // =============================================================================
16
- // Sync Iteration Helpers
17
- // =============================================================================
18
- /**
19
- * Collects all values from an iterable/iterator into an array.
20
- *
21
- * @function
22
- * @param source - An iterable or iterator to collect from
23
- * @returns Array containing all yielded values
24
- * @internal
25
- */
26
- const collectSync = (source) => {
27
- const result = [];
28
- const iterator = (0, exports.toIterator)(source);
29
- let next = iterator.next();
30
- while (!next.done) {
31
- result.push(next.value);
32
- next = iterator.next();
33
- }
34
- return result;
35
- };
36
- exports.collectSync = collectSync;
37
- /**
38
- * Counts items yielded by an iterable/iterator.
39
- *
40
- * Note: This fully consumes the iterator.
41
- *
42
- * @function
43
- * @param source - An iterable or iterator to count
44
- * @returns The number of items yielded
45
- * @internal
46
- */
47
- const countSync = (source) => {
48
- let count = 0;
49
- const iterator = (0, exports.toIterator)(source);
50
- while (!iterator.next().done) {
51
- count++;
52
- }
53
- return count;
54
- };
55
- exports.countSync = countSync;
56
- /**
57
- * Gets the first value from an iterable/iterator.
58
- *
59
- * @function
60
- * @param source - An iterable or iterator
61
- * @returns The first yielded value, or undefined if empty
62
- * @internal
63
- */
64
- const firstSync = (source) => {
65
- const iterator = (0, exports.toIterator)(source);
66
- const next = iterator.next();
67
- return next.done ? undefined : next.value;
68
- };
69
- exports.firstSync = firstSync;
70
- /**
71
- * Gets the last value from an iterable/iterator.
72
- *
73
- * Note: This fully consumes the iterator.
74
- *
75
- * @function
76
- * @param source - An iterable or iterator
77
- * @returns The last yielded value, or undefined if empty
78
- * @internal
79
- */
80
- const lastSync = (source) => {
81
- const iterator = (0, exports.toIterator)(source);
82
- let lastValue;
83
- let hasValue = false;
84
- let next = iterator.next();
85
- while (!next.done) {
86
- lastValue = next.value;
87
- hasValue = true;
88
- next = iterator.next();
89
- }
90
- return hasValue ? lastValue : undefined;
91
- };
92
- exports.lastSync = lastSync;
93
- /**
94
- * Iterates fully and returns metadata about the iteration.
95
- *
96
- * @function
97
- * @param source - An iterable or iterator
98
- * @returns Iteration result with count and last value
99
- * @internal
100
- */
101
- const iterateFullySync = (source) => {
102
- const iterator = (0, exports.toIterator)(source);
103
- let count = 0;
104
- let lastValue;
105
- let hasValue = false;
106
- let next = iterator.next();
107
- while (!next.done) {
108
- lastValue = next.value;
109
- hasValue = true;
110
- count++;
111
- next = iterator.next();
112
- }
113
- return { count, hasValue, lastValue };
114
- };
115
- exports.iterateFullySync = iterateFullySync;
116
- /**
117
- * Normalizes an iterable or iterator to an iterator.
118
- *
119
- * If the source has `Symbol.iterator`, calls it to get an iterator. Otherwise,
120
- * assumes the source is already an iterator.
121
- *
122
- * @function
123
- * @param source - An iterable or iterator
124
- * @returns An iterator
125
- * @internal
126
- */
127
- const toIterator = (source) => {
128
- if (isIterable(source)) {
129
- return source[iteratorSymbol]();
130
- }
131
- return source;
132
- };
133
- exports.toIterator = toIterator;
134
- // =============================================================================
135
- // Async Iteration Helpers
136
- // =============================================================================
137
- /**
138
- * Collects all values from an async iterable/iterator into an array.
139
- *
140
- * @function
141
- * @param source - An async iterable, async iterator, or sync iterable
142
- * @returns Promise resolving to array of all yielded values
143
- * @internal
144
- */
145
- const collectAsync = async (source) => {
146
- const result = [];
147
- const iterator = (0, exports.toAsyncIterator)(source);
148
- let next = await iterator.next();
149
- while (!next.done) {
150
- result.push(next.value);
151
- next = await iterator.next();
152
- }
153
- return result;
154
- };
155
- exports.collectAsync = collectAsync;
156
- /**
157
- * Counts items yielded by an async iterable/iterator.
158
- *
159
- * Note: This fully consumes the iterator.
160
- *
161
- * @function
162
- * @param source - An async iterable, async iterator, or sync iterable
163
- * @returns Promise resolving to the number of items yielded
164
- * @internal
165
- */
166
- const countAsync = async (source) => {
167
- let count = 0;
168
- const iterator = (0, exports.toAsyncIterator)(source);
169
- while (!(await iterator.next()).done) {
170
- count++;
171
- }
172
- return count;
173
- };
174
- exports.countAsync = countAsync;
175
- /**
176
- * Gets the first value from an async iterable/iterator.
177
- *
178
- * @function
179
- * @param source - An async iterable, async iterator, or sync iterable
180
- * @returns Promise resolving to the first yielded value, or undefined if empty
181
- * @internal
182
- */
183
- const firstAsync = async (source) => {
184
- const iterator = (0, exports.toAsyncIterator)(source);
185
- const next = await iterator.next();
186
- return next.done ? undefined : next.value;
187
- };
188
- exports.firstAsync = firstAsync;
189
- /**
190
- * Gets the last value from an async iterable/iterator.
191
- *
192
- * Note: This fully consumes the iterator.
193
- *
194
- * @function
195
- * @param source - An async iterable, async iterator, or sync iterable
196
- * @returns Promise resolving to the last yielded value, or undefined if empty
197
- * @internal
198
- */
199
- const lastAsync = async (source) => {
200
- const iterator = (0, exports.toAsyncIterator)(source);
201
- let lastValue;
202
- let hasValue = false;
203
- let next = await iterator.next();
204
- while (!next.done) {
205
- lastValue = next.value;
206
- hasValue = true;
207
- next = await iterator.next();
208
- }
209
- return hasValue ? lastValue : undefined;
210
- };
211
- exports.lastAsync = lastAsync;
212
- /**
213
- * Iterates fully and returns metadata about the async iteration.
214
- *
215
- * Unlike the sync version, this catches errors during iteration and returns
216
- * them in the result, allowing assertions to check for expected failures.
217
- *
218
- * @function
219
- * @param source - An async iterable, async iterator, or sync iterable
220
- * @returns Promise resolving to iteration result with count, last value, and
221
- * error info
222
- * @internal
223
- */
224
- const iterateFullyAsync = async (source) => {
225
- const iterator = (0, exports.toAsyncIterator)(source);
226
- let count = 0;
227
- let lastValue;
228
- let hasValue = false;
229
- try {
230
- let next = await iterator.next();
231
- while (!next.done) {
232
- lastValue = next.value;
233
- hasValue = true;
234
- count++;
235
- next = await iterator.next();
236
- }
237
- return { completed: true, count, hasValue, lastValue };
238
- }
239
- catch (error) {
240
- return { completed: false, count, error, hasValue, lastValue };
241
- }
242
- };
243
- exports.iterateFullyAsync = iterateFullyAsync;
244
- /**
245
- * Normalizes an async iterable/iterator to an async iterator. Also handles sync
246
- * iterables for convenience.
247
- *
248
- * @function
249
- * @param source - An async iterable, async iterator, or sync iterable
250
- * @returns An async iterator
251
- * @internal
252
- */
253
- const toAsyncIterator = (source) => {
254
- // Check for async iterable first (Symbol.asyncIterator)
255
- if (isAsyncIterable(source)) {
256
- return source[asyncIteratorSymbol]();
257
- }
258
- // Check for sync iterable (Symbol.iterator) - wrap as async
259
- if (isIterable(source)) {
260
- const syncIterator = source[iteratorSymbol]();
261
- return {
262
- async next() {
263
- return syncIterator.next();
264
- },
265
- };
266
- }
267
- // Assume it's already an async iterator (has next() method)
268
- return source;
269
- };
270
- exports.toAsyncIterator = toAsyncIterator;
271
- // =============================================================================
272
- // Internal Helpers
273
- // =============================================================================
274
- /**
275
- * Checks if a value is async iterable (has Symbol.asyncIterator).
276
- *
277
- * @function
278
- * @param value - Value to check
279
- * @returns True if the value is async iterable
280
- * @internal
281
- */
282
- const isAsyncIterable = (value) => value != null &&
283
- typeof value[asyncIteratorSymbol] === 'function';
284
- /**
285
- * Checks if a value is iterable (has Symbol.iterator).
286
- *
287
- * Works with both objects and primitives (like strings).
288
- *
289
- * @function
290
- * @param value - Value to check
291
- * @returns True if the value is iterable
292
- * @internal
293
- */
294
- const isIterable = (value) => value != null &&
295
- typeof value[iteratorSymbol] ===
296
- 'function';
297
- //# sourceMappingURL=iteration-util.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"iteration-util.js","sourceRoot":"","sources":["../../../src/assertion/impl/iteration-util.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GAS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* Utility functions for working with sync and async iterables/iterators.
3
- *
4
- * These helpers normalize the various forms of iterables (arrays, generators,
5
- * streams, raw iterators) into a consistent iterator interface for use in
6
- * assertions.
7
- *
8
- * @module assertion/impl/iteration-util
9
- * @internal
10
- */
11
- export {};
12
- //# sourceMappingURL=iteration-util.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"iteration-util.d.ts","sourceRoot":"","sources":["../../../src/assertion/impl/iteration-util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Utility functions for working with sync and async iterables/iterators.
3
- *
4
- * These helpers normalize the various forms of iterables (arrays, generators,
5
- * streams, raw iterators) into a consistent iterator interface for use in
6
- * assertions.
7
- *
8
- * @module assertion/impl/iteration-util
9
- * @internal
10
- */
11
- export {};
12
- //# sourceMappingURL=iteration-util.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"iteration-util.d.ts","sourceRoot":"","sources":["../../../src/assertion/impl/iteration-util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
@@ -1,282 +0,0 @@
1
- /**
2
- * Utility functions for working with sync and async iterables/iterators.
3
- *
4
- * These helpers normalize the various forms of iterables (arrays, generators,
5
- * streams, raw iterators) into a consistent iterator interface for use in
6
- * assertions.
7
- *
8
- * @module assertion/impl/iteration-util
9
- * @internal
10
- */
11
- const { asyncIterator: asyncIteratorSymbol, iterator: iteratorSymbol } = Symbol;
12
- // =============================================================================
13
- // Sync Iteration Helpers
14
- // =============================================================================
15
- /**
16
- * Collects all values from an iterable/iterator into an array.
17
- *
18
- * @function
19
- * @param source - An iterable or iterator to collect from
20
- * @returns Array containing all yielded values
21
- * @internal
22
- */
23
- export const collectSync = (source) => {
24
- const result = [];
25
- const iterator = toIterator(source);
26
- let next = iterator.next();
27
- while (!next.done) {
28
- result.push(next.value);
29
- next = iterator.next();
30
- }
31
- return result;
32
- };
33
- /**
34
- * Counts items yielded by an iterable/iterator.
35
- *
36
- * Note: This fully consumes the iterator.
37
- *
38
- * @function
39
- * @param source - An iterable or iterator to count
40
- * @returns The number of items yielded
41
- * @internal
42
- */
43
- export const countSync = (source) => {
44
- let count = 0;
45
- const iterator = toIterator(source);
46
- while (!iterator.next().done) {
47
- count++;
48
- }
49
- return count;
50
- };
51
- /**
52
- * Gets the first value from an iterable/iterator.
53
- *
54
- * @function
55
- * @param source - An iterable or iterator
56
- * @returns The first yielded value, or undefined if empty
57
- * @internal
58
- */
59
- export const firstSync = (source) => {
60
- const iterator = toIterator(source);
61
- const next = iterator.next();
62
- return next.done ? undefined : next.value;
63
- };
64
- /**
65
- * Gets the last value from an iterable/iterator.
66
- *
67
- * Note: This fully consumes the iterator.
68
- *
69
- * @function
70
- * @param source - An iterable or iterator
71
- * @returns The last yielded value, or undefined if empty
72
- * @internal
73
- */
74
- export const lastSync = (source) => {
75
- const iterator = toIterator(source);
76
- let lastValue;
77
- let hasValue = false;
78
- let next = iterator.next();
79
- while (!next.done) {
80
- lastValue = next.value;
81
- hasValue = true;
82
- next = iterator.next();
83
- }
84
- return hasValue ? lastValue : undefined;
85
- };
86
- /**
87
- * Iterates fully and returns metadata about the iteration.
88
- *
89
- * @function
90
- * @param source - An iterable or iterator
91
- * @returns Iteration result with count and last value
92
- * @internal
93
- */
94
- export const iterateFullySync = (source) => {
95
- const iterator = toIterator(source);
96
- let count = 0;
97
- let lastValue;
98
- let hasValue = false;
99
- let next = iterator.next();
100
- while (!next.done) {
101
- lastValue = next.value;
102
- hasValue = true;
103
- count++;
104
- next = iterator.next();
105
- }
106
- return { count, hasValue, lastValue };
107
- };
108
- /**
109
- * Normalizes an iterable or iterator to an iterator.
110
- *
111
- * If the source has `Symbol.iterator`, calls it to get an iterator. Otherwise,
112
- * assumes the source is already an iterator.
113
- *
114
- * @function
115
- * @param source - An iterable or iterator
116
- * @returns An iterator
117
- * @internal
118
- */
119
- export const toIterator = (source) => {
120
- if (isIterable(source)) {
121
- return source[iteratorSymbol]();
122
- }
123
- return source;
124
- };
125
- // =============================================================================
126
- // Async Iteration Helpers
127
- // =============================================================================
128
- /**
129
- * Collects all values from an async iterable/iterator into an array.
130
- *
131
- * @function
132
- * @param source - An async iterable, async iterator, or sync iterable
133
- * @returns Promise resolving to array of all yielded values
134
- * @internal
135
- */
136
- export const collectAsync = async (source) => {
137
- const result = [];
138
- const iterator = toAsyncIterator(source);
139
- let next = await iterator.next();
140
- while (!next.done) {
141
- result.push(next.value);
142
- next = await iterator.next();
143
- }
144
- return result;
145
- };
146
- /**
147
- * Counts items yielded by an async iterable/iterator.
148
- *
149
- * Note: This fully consumes the iterator.
150
- *
151
- * @function
152
- * @param source - An async iterable, async iterator, or sync iterable
153
- * @returns Promise resolving to the number of items yielded
154
- * @internal
155
- */
156
- export const countAsync = async (source) => {
157
- let count = 0;
158
- const iterator = toAsyncIterator(source);
159
- while (!(await iterator.next()).done) {
160
- count++;
161
- }
162
- return count;
163
- };
164
- /**
165
- * Gets the first value from an async iterable/iterator.
166
- *
167
- * @function
168
- * @param source - An async iterable, async iterator, or sync iterable
169
- * @returns Promise resolving to the first yielded value, or undefined if empty
170
- * @internal
171
- */
172
- export const firstAsync = async (source) => {
173
- const iterator = toAsyncIterator(source);
174
- const next = await iterator.next();
175
- return next.done ? undefined : next.value;
176
- };
177
- /**
178
- * Gets the last value from an async iterable/iterator.
179
- *
180
- * Note: This fully consumes the iterator.
181
- *
182
- * @function
183
- * @param source - An async iterable, async iterator, or sync iterable
184
- * @returns Promise resolving to the last yielded value, or undefined if empty
185
- * @internal
186
- */
187
- export const lastAsync = async (source) => {
188
- const iterator = toAsyncIterator(source);
189
- let lastValue;
190
- let hasValue = false;
191
- let next = await iterator.next();
192
- while (!next.done) {
193
- lastValue = next.value;
194
- hasValue = true;
195
- next = await iterator.next();
196
- }
197
- return hasValue ? lastValue : undefined;
198
- };
199
- /**
200
- * Iterates fully and returns metadata about the async iteration.
201
- *
202
- * Unlike the sync version, this catches errors during iteration and returns
203
- * them in the result, allowing assertions to check for expected failures.
204
- *
205
- * @function
206
- * @param source - An async iterable, async iterator, or sync iterable
207
- * @returns Promise resolving to iteration result with count, last value, and
208
- * error info
209
- * @internal
210
- */
211
- export const iterateFullyAsync = async (source) => {
212
- const iterator = toAsyncIterator(source);
213
- let count = 0;
214
- let lastValue;
215
- let hasValue = false;
216
- try {
217
- let next = await iterator.next();
218
- while (!next.done) {
219
- lastValue = next.value;
220
- hasValue = true;
221
- count++;
222
- next = await iterator.next();
223
- }
224
- return { completed: true, count, hasValue, lastValue };
225
- }
226
- catch (error) {
227
- return { completed: false, count, error, hasValue, lastValue };
228
- }
229
- };
230
- /**
231
- * Normalizes an async iterable/iterator to an async iterator. Also handles sync
232
- * iterables for convenience.
233
- *
234
- * @function
235
- * @param source - An async iterable, async iterator, or sync iterable
236
- * @returns An async iterator
237
- * @internal
238
- */
239
- export const toAsyncIterator = (source) => {
240
- // Check for async iterable first (Symbol.asyncIterator)
241
- if (isAsyncIterable(source)) {
242
- return source[asyncIteratorSymbol]();
243
- }
244
- // Check for sync iterable (Symbol.iterator) - wrap as async
245
- if (isIterable(source)) {
246
- const syncIterator = source[iteratorSymbol]();
247
- return {
248
- async next() {
249
- return syncIterator.next();
250
- },
251
- };
252
- }
253
- // Assume it's already an async iterator (has next() method)
254
- return source;
255
- };
256
- // =============================================================================
257
- // Internal Helpers
258
- // =============================================================================
259
- /**
260
- * Checks if a value is async iterable (has Symbol.asyncIterator).
261
- *
262
- * @function
263
- * @param value - Value to check
264
- * @returns True if the value is async iterable
265
- * @internal
266
- */
267
- const isAsyncIterable = (value) => value != null &&
268
- typeof value[asyncIteratorSymbol] === 'function';
269
- /**
270
- * Checks if a value is iterable (has Symbol.iterator).
271
- *
272
- * Works with both objects and primitives (like strings).
273
- *
274
- * @function
275
- * @param value - Value to check
276
- * @returns True if the value is iterable
277
- * @internal
278
- */
279
- const isIterable = (value) => value != null &&
280
- typeof value[iteratorSymbol] ===
281
- 'function';
282
- //# sourceMappingURL=iteration-util.js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