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,214 +0,0 @@
1
- "use strict";
2
- /**
3
- * "Esoteric" object assertions that don't fit into more common categories.
4
- *
5
- * These are probably less commonly used, but still useful in certain scenarios.
6
- *
7
- * @module
8
- * @groupDescription Esoteric Assertions
9
- * Individual assertions are documented where they are exported.
10
- *
11
- * @showGroups
12
- */
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.extensibleAssertion = exports.frozenAssertion = exports.sealedAssertion = exports.enumerablePropertyAssertion2 = exports.enumerablePropertyAssertion = exports.nullPrototypeAssertion = void 0;
15
- const zod_1 = require("zod");
16
- const guards_js_1 = require("../../guards.cjs");
17
- const schema_js_1 = require("../../schema.cjs");
18
- const create_js_1 = require("../create.cjs");
19
- const { getOwnPropertyDescriptor, isExtensible, isFrozen, isSealed } = Object;
20
- /**
21
- * Asserts that an object has a null prototype (i.e.,
22
- * `Object.getPrototypeOf(obj) === null`).
23
- *
24
- * This is useful for checking if an object was created with
25
- * `Object.create(null)` or similar patterns that create truly "dictionary-like"
26
- * objects without any inherited properties.
27
- *
28
- * @example
29
- *
30
- * ```typescript
31
- * const obj = Object.create(null);
32
- * expect(obj, 'to have a null prototype'); // ✓ passes
33
- *
34
- * const regular = {};
35
- * expect(regular, 'to have a null prototype'); // ✗ fails - has Object.prototype
36
- * ```
37
- *
38
- * @group Esoteric Assertions
39
- * @bupkisAnchor object-to-have-a-null-prototype
40
- * @bupkisAssertionCategory object
41
- */
42
- exports.nullPrototypeAssertion = (0, create_js_1.createAssertion)([['to have a null prototype', 'to be a dictionary']], schema_js_1.DictionarySchema);
43
- /**
44
- * Asserts that a given property key is an enumerable property of the target
45
- * object.
46
- *
47
- * This checks the `enumerable` descriptor property using
48
- * `Object.getOwnPropertyDescriptor()`. Only own properties (not inherited ones)
49
- * are considered, and the property must be enumerable (i.e., would appear in
50
- * `for...in` loops and `Object.keys()` results).
51
- *
52
- * @example
53
- *
54
- * ```typescript
55
- * const obj = { visible: 'value' };
56
- * Object.defineProperty(obj, 'hidden', {
57
- * value: 'secret',
58
- * enumerable: false,
59
- * });
60
- *
61
- * expect('visible', 'to be an enumerable property of', obj); // ✓ passes
62
- * expect('hidden', 'to be an enumerable property of', obj); // ✗ fails - not enumerable
63
- * expect('toString', 'to be an enumerable property of', obj); // ✗ fails - inherited property
64
- * ```
65
- *
66
- * @group Esoteric Assertions
67
- * @bupkisAnchor string-number-symbol-to-be-an-enumerable-property-of-non-null
68
- * @bupkisAssertionCategory object
69
- */
70
- exports.enumerablePropertyAssertion = (0, create_js_1.createAssertion)([
71
- schema_js_1.PropertyKeySchema,
72
- 'to be an enumerable property of',
73
- zod_1.z.unknown().nonoptional(),
74
- ], (subject, obj) => {
75
- if (!getOwnPropertyDescriptor(obj, subject)?.enumerable) {
76
- return {
77
- actual: false,
78
- expected: true,
79
- message: `Expected property ${String(subject)} to be enumerable`,
80
- };
81
- }
82
- });
83
- /**
84
- * Asserts that an object has a specified property that is enumerable.
85
- *
86
- * This is an alternative form of {@link enumerablePropertyAssertion} with the
87
- * object and property key parameters in reverse order. It checks that the given
88
- * property exists on the object and has its `enumerable` descriptor set to
89
- * `true` using `Object.getOwnPropertyDescriptor()`. Only own properties (not
90
- * inherited ones) are considered.
91
- *
92
- * @example
93
- *
94
- * ```typescript
95
- * const obj = { visible: 'value' };
96
- * Object.defineProperty(obj, 'hidden', {
97
- * value: 'secret',
98
- * enumerable: false,
99
- * });
100
- *
101
- * expect(obj, 'to have enumerable property', 'visible'); // ✓ passes
102
- * expect(obj, 'to have enumerable property', 'hidden'); // ✗ fails - not enumerable
103
- * expect(obj, 'to have enumerable property', 'nonexistent'); // ✗ fails - property doesn't exist
104
- * ```
105
- *
106
- * @param subject - The object to check for the enumerable property
107
- * @param key - The property key to test for enumerability
108
- * @group Esoteric Assertions
109
- * @see {@link enumerablePropertyAssertion} - Alternative parameter order
110
- */
111
- exports.enumerablePropertyAssertion2 = (0, create_js_1.createAssertion)([zod_1.z.unknown().nonoptional(), 'to have enumerable property', schema_js_1.PropertyKeySchema], (_subject, key) => zod_1.z.custom((value) => (0, guards_js_1.isNonNullObject)(value) &&
112
- key in value &&
113
- !!getOwnPropertyDescriptor(value, key)?.enumerable, {
114
- error: `Expected property "${String(key)}" to be enumerable`,
115
- }));
116
- /**
117
- * Asserts that an object is sealed using `Object.isSealed()`.
118
- *
119
- * A sealed object cannot have new properties added to it, and all existing
120
- * properties are marked as non-configurable. However, writable properties can
121
- * still be modified. This is less restrictive than being frozen but more
122
- * restrictive than being non-extensible.
123
- *
124
- * @example
125
- *
126
- * ```typescript
127
- * const obj = { prop: 'value' };
128
- * Object.seal(obj);
129
- *
130
- * expect(obj, 'to be sealed'); // ✓ passes
131
- *
132
- * obj.prop = 'new value'; // This still works
133
- * obj.newProp = 'fail'; // This will fail (in strict mode)
134
- *
135
- * const regular = {};
136
- * expect(regular, 'to be sealed'); // ✗ fails - not sealed
137
- * ```
138
- *
139
- * @group Esoteric Assertions
140
- * @bupkisAnchor unknown-to-be-sealed
141
- * @bupkisAssertionCategory object
142
- */
143
- exports.sealedAssertion = (0, create_js_1.createAssertion)(['to be sealed'], schema_js_1.UnknownSchema.refine((obj) => isSealed(obj)));
144
- /**
145
- * Asserts that an object is frozen using `Object.isFrozen()`.
146
- *
147
- * A frozen object is completely immutable - no properties can be added,
148
- * removed, or modified, and no property descriptors can be changed. This is the
149
- * most restrictive object state. Frozen objects are automatically sealed and
150
- * non-extensible.
151
- *
152
- * @example
153
- *
154
- * ```typescript
155
- * const obj = { prop: 'value' };
156
- * Object.freeze(obj);
157
- *
158
- * expect(obj, 'to be frozen'); // ✓ passes
159
- *
160
- * // All of these operations will fail silently (or throw in strict mode):
161
- * obj.prop = 'new value'; // Cannot modify existing property
162
- * obj.newProp = 'fail'; // Cannot add new property
163
- * delete obj.prop; // Cannot delete property
164
- *
165
- * const regular = {};
166
- * expect(regular, 'to be frozen'); // ✗ fails - not frozen
167
- * ```
168
- *
169
- * @group Esoteric Assertions
170
- * @bupkisAnchor unknown-to-be-frozen
171
- * @bupkisAssertionCategory object
172
- */
173
- exports.frozenAssertion = (0, create_js_1.createAssertion)(['to be frozen'], (subject) => {
174
- if (!isFrozen(subject)) {
175
- return {
176
- actual: false,
177
- expected: true,
178
- message: `Expected object to be frozen`,
179
- };
180
- }
181
- });
182
- /**
183
- * Asserts that an object is extensible using `Object.isExtensible()`.
184
- *
185
- * An extensible object allows new properties to be added to it. This is the
186
- * default state for objects, but can be disabled using
187
- * `Object.preventExtensions()`, `Object.seal()`, or `Object.freeze()`. This
188
- * assertion is useful for testing that an object hasn't been made
189
- * non-extensible by any of these operations.
190
- *
191
- * @example
192
- *
193
- * ```typescript
194
- * const obj = {};
195
- * expect(obj, 'to be extensible'); // ✓ passes - objects are extensible by default
196
- *
197
- * obj.newProp = 'value'; // This works
198
- *
199
- * Object.preventExtensions(obj);
200
- * expect(obj, 'to be extensible'); // ✗ fails - no longer extensible
201
- *
202
- * const sealed = Object.seal({});
203
- * expect(sealed, 'to be extensible'); // ✗ fails - sealed objects are non-extensible
204
- *
205
- * const frozen = Object.freeze({});
206
- * expect(frozen, 'to be extensible'); // ✗ fails - frozen objects are non-extensible
207
- * ```
208
- *
209
- * @group Esoteric Assertions
210
- * @bupkisAnchor unknown-to-be-extensible
211
- * @bupkisAssertionCategory object
212
- */
213
- exports.extensibleAssertion = (0, create_js_1.createAssertion)(['to be extensible'], schema_js_1.UnknownSchema.refine((obj) => isExtensible(obj)));
214
- //# sourceMappingURL=sync-esoteric.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sync-esoteric.js","sourceRoot":"","sources":["../../../src/assertion/impl/sync-esoteric.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAEH,6BAAwB;AAExB,gDAAkD;AAClD,gDAIyB;AACzB,6CAA+C;AAE/C,MAAM,EAAE,wBAAwB,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACU,QAAA,sBAAsB,GAAG,IAAA,2BAAe,EACnD,CAAC,CAAC,0BAA0B,EAAE,oBAAoB,CAAC,CAAC,EACpD,4BAAgB,CACjB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACU,QAAA,2BAA2B,GAAG,IAAA,2BAAe,EACxD;IACE,6BAAiB;IACjB,iCAAiC;IACjC,OAAC,CAAC,OAAO,EAAE,CAAC,WAAW,EAAE;CAC1B,EACD,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE;IACf,IAAI,CAAC,wBAAwB,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;QACxD,OAAO;YACL,MAAM,EAAE,KAAK;YACb,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,qBAAqB,MAAM,CAAC,OAAO,CAAC,mBAAmB;SACjE,CAAC;IACJ,CAAC;AACH,CAAC,CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACU,QAAA,4BAA4B,GAAG,IAAA,2BAAe,EACzD,CAAC,OAAC,CAAC,OAAO,EAAE,CAAC,WAAW,EAAE,EAAE,6BAA6B,EAAE,6BAAiB,CAAC,EAC7E,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE,CAChB,OAAC,CAAC,MAAM,CACN,CAAC,KAAK,EAAE,EAAE,CACR,IAAA,2BAAe,EAAC,KAAK,CAAC;IACtB,GAAG,IAAI,KAAK;IACZ,CAAC,CAAC,wBAAwB,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,UAAU,EACpD;IACE,KAAK,EAAE,sBAAsB,MAAM,CAAC,GAAG,CAAC,oBAAoB;CAC7D,CACF,CACJ,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACU,QAAA,eAAe,GAAG,IAAA,2BAAe,EAC5C,CAAC,cAAc,CAAC,EAChB,yBAAa,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAC7C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACU,QAAA,eAAe,GAAG,IAAA,2BAAe,EAAC,CAAC,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE;IAC3E,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACvB,OAAO;YACL,MAAM,EAAE,KAAK;YACb,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,8BAA8B;SACxC,CAAC;IACJ,CAAC;AACH,CAAC,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACU,QAAA,mBAAmB,GAAG,IAAA,2BAAe,EAChD,CAAC,kBAAkB,CAAC,EACpB,yBAAa,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CACjD,CAAC"}
@@ -1,191 +0,0 @@
1
- /**
2
- * "Esoteric" object assertions that don't fit into more common categories.
3
- *
4
- * These are probably less commonly used, but still useful in certain scenarios.
5
- *
6
- * @module
7
- * @groupDescription Esoteric Assertions
8
- * Individual assertions are documented where they are exported.
9
- *
10
- * @showGroups
11
- */
12
- import { z } from 'zod';
13
- /**
14
- * Asserts that an object has a null prototype (i.e.,
15
- * `Object.getPrototypeOf(obj) === null`).
16
- *
17
- * This is useful for checking if an object was created with
18
- * `Object.create(null)` or similar patterns that create truly "dictionary-like"
19
- * objects without any inherited properties.
20
- *
21
- * @example
22
- *
23
- * ```typescript
24
- * const obj = Object.create(null);
25
- * expect(obj, 'to have a null prototype'); // ✓ passes
26
- *
27
- * const regular = {};
28
- * expect(regular, 'to have a null prototype'); // ✗ fails - has Object.prototype
29
- * ```
30
- *
31
- * @group Esoteric Assertions
32
- * @bupkisAnchor object-to-have-a-null-prototype
33
- * @bupkisAssertionCategory object
34
- */
35
- export declare const nullPrototypeAssertion: import("../assertion-types.js").AssertionStandardSchemaSync<readonly [readonly ["to have a null prototype", "to be a dictionary"]], z.ZodCustom<Record<PropertyKey, unknown>, Record<PropertyKey, unknown>>, never>;
36
- /**
37
- * Asserts that a given property key is an enumerable property of the target
38
- * object.
39
- *
40
- * This checks the `enumerable` descriptor property using
41
- * `Object.getOwnPropertyDescriptor()`. Only own properties (not inherited ones)
42
- * are considered, and the property must be enumerable (i.e., would appear in
43
- * `for...in` loops and `Object.keys()` results).
44
- *
45
- * @example
46
- *
47
- * ```typescript
48
- * const obj = { visible: 'value' };
49
- * Object.defineProperty(obj, 'hidden', {
50
- * value: 'secret',
51
- * enumerable: false,
52
- * });
53
- *
54
- * expect('visible', 'to be an enumerable property of', obj); // ✓ passes
55
- * expect('hidden', 'to be an enumerable property of', obj); // ✗ fails - not enumerable
56
- * expect('toString', 'to be an enumerable property of', obj); // ✗ fails - inherited property
57
- * ```
58
- *
59
- * @group Esoteric Assertions
60
- * @bupkisAnchor string-number-symbol-to-be-an-enumerable-property-of-non-null
61
- * @bupkisAssertionCategory object
62
- */
63
- export declare const enumerablePropertyAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodSymbol]>, "to be an enumerable property of", z.ZodNonOptional<z.ZodUnknown>], (subject: string | number | symbol, obj: unknown) => {
64
- actual: boolean;
65
- expected: boolean;
66
- message: string;
67
- } | undefined, readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodSymbol]>, import("../assertion-types.js").PhraseLiteralSlot<"to be an enumerable property of">, z.ZodNonOptional<z.ZodUnknown>]>;
68
- /**
69
- * Asserts that an object has a specified property that is enumerable.
70
- *
71
- * This is an alternative form of {@link enumerablePropertyAssertion} with the
72
- * object and property key parameters in reverse order. It checks that the given
73
- * property exists on the object and has its `enumerable` descriptor set to
74
- * `true` using `Object.getOwnPropertyDescriptor()`. Only own properties (not
75
- * inherited ones) are considered.
76
- *
77
- * @example
78
- *
79
- * ```typescript
80
- * const obj = { visible: 'value' };
81
- * Object.defineProperty(obj, 'hidden', {
82
- * value: 'secret',
83
- * enumerable: false,
84
- * });
85
- *
86
- * expect(obj, 'to have enumerable property', 'visible'); // ✓ passes
87
- * expect(obj, 'to have enumerable property', 'hidden'); // ✗ fails - not enumerable
88
- * expect(obj, 'to have enumerable property', 'nonexistent'); // ✗ fails - property doesn't exist
89
- * ```
90
- *
91
- * @param subject - The object to check for the enumerable property
92
- * @param key - The property key to test for enumerability
93
- * @group Esoteric Assertions
94
- * @see {@link enumerablePropertyAssertion} - Alternative parameter order
95
- */
96
- export declare const enumerablePropertyAssertion2: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodNonOptional<z.ZodUnknown>, "to have enumerable property", z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodSymbol]>], (_subject: unknown, key: string | number | symbol) => z.ZodCustom<unknown, unknown>, readonly [z.ZodNonOptional<z.ZodUnknown>, import("../assertion-types.js").PhraseLiteralSlot<"to have enumerable property">, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodSymbol]>]>;
97
- /**
98
- * Asserts that an object is sealed using `Object.isSealed()`.
99
- *
100
- * A sealed object cannot have new properties added to it, and all existing
101
- * properties are marked as non-configurable. However, writable properties can
102
- * still be modified. This is less restrictive than being frozen but more
103
- * restrictive than being non-extensible.
104
- *
105
- * @example
106
- *
107
- * ```typescript
108
- * const obj = { prop: 'value' };
109
- * Object.seal(obj);
110
- *
111
- * expect(obj, 'to be sealed'); // ✓ passes
112
- *
113
- * obj.prop = 'new value'; // This still works
114
- * obj.newProp = 'fail'; // This will fail (in strict mode)
115
- *
116
- * const regular = {};
117
- * expect(regular, 'to be sealed'); // ✗ fails - not sealed
118
- * ```
119
- *
120
- * @group Esoteric Assertions
121
- * @bupkisAnchor unknown-to-be-sealed
122
- * @bupkisAssertionCategory object
123
- */
124
- export declare const sealedAssertion: import("../assertion-types.js").AssertionStandardSchemaSync<readonly ["to be sealed"], z.ZodUnknown, never>;
125
- /**
126
- * Asserts that an object is frozen using `Object.isFrozen()`.
127
- *
128
- * A frozen object is completely immutable - no properties can be added,
129
- * removed, or modified, and no property descriptors can be changed. This is the
130
- * most restrictive object state. Frozen objects are automatically sealed and
131
- * non-extensible.
132
- *
133
- * @example
134
- *
135
- * ```typescript
136
- * const obj = { prop: 'value' };
137
- * Object.freeze(obj);
138
- *
139
- * expect(obj, 'to be frozen'); // ✓ passes
140
- *
141
- * // All of these operations will fail silently (or throw in strict mode):
142
- * obj.prop = 'new value'; // Cannot modify existing property
143
- * obj.newProp = 'fail'; // Cannot add new property
144
- * delete obj.prop; // Cannot delete property
145
- *
146
- * const regular = {};
147
- * expect(regular, 'to be frozen'); // ✗ fails - not frozen
148
- * ```
149
- *
150
- * @group Esoteric Assertions
151
- * @bupkisAnchor unknown-to-be-frozen
152
- * @bupkisAssertionCategory object
153
- */
154
- export declare const frozenAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly ["to be frozen"], (subject: unknown) => {
155
- actual: boolean;
156
- expected: boolean;
157
- message: string;
158
- } | undefined, never>;
159
- /**
160
- * Asserts that an object is extensible using `Object.isExtensible()`.
161
- *
162
- * An extensible object allows new properties to be added to it. This is the
163
- * default state for objects, but can be disabled using
164
- * `Object.preventExtensions()`, `Object.seal()`, or `Object.freeze()`. This
165
- * assertion is useful for testing that an object hasn't been made
166
- * non-extensible by any of these operations.
167
- *
168
- * @example
169
- *
170
- * ```typescript
171
- * const obj = {};
172
- * expect(obj, 'to be extensible'); // ✓ passes - objects are extensible by default
173
- *
174
- * obj.newProp = 'value'; // This works
175
- *
176
- * Object.preventExtensions(obj);
177
- * expect(obj, 'to be extensible'); // ✗ fails - no longer extensible
178
- *
179
- * const sealed = Object.seal({});
180
- * expect(sealed, 'to be extensible'); // ✗ fails - sealed objects are non-extensible
181
- *
182
- * const frozen = Object.freeze({});
183
- * expect(frozen, 'to be extensible'); // ✗ fails - frozen objects are non-extensible
184
- * ```
185
- *
186
- * @group Esoteric Assertions
187
- * @bupkisAnchor unknown-to-be-extensible
188
- * @bupkisAssertionCategory object
189
- */
190
- export declare const extensibleAssertion: import("../assertion-types.js").AssertionStandardSchemaSync<readonly ["to be extensible"], z.ZodUnknown, never>;
191
- //# sourceMappingURL=sync-esoteric.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sync-esoteric.d.ts","sourceRoot":"","sources":["../../../src/assertion/impl/sync-esoteric.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,sBAAsB,qNAGlC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,2BAA2B;;;;6MAevC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,4BAA4B,+cAYxC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,eAAe,6GAG3B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,eAAe;;;;qBAQ1B,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,mBAAmB,iHAG/B,CAAC"}
@@ -1,191 +0,0 @@
1
- /**
2
- * "Esoteric" object assertions that don't fit into more common categories.
3
- *
4
- * These are probably less commonly used, but still useful in certain scenarios.
5
- *
6
- * @module
7
- * @groupDescription Esoteric Assertions
8
- * Individual assertions are documented where they are exported.
9
- *
10
- * @showGroups
11
- */
12
- import { z } from 'zod';
13
- /**
14
- * Asserts that an object has a null prototype (i.e.,
15
- * `Object.getPrototypeOf(obj) === null`).
16
- *
17
- * This is useful for checking if an object was created with
18
- * `Object.create(null)` or similar patterns that create truly "dictionary-like"
19
- * objects without any inherited properties.
20
- *
21
- * @example
22
- *
23
- * ```typescript
24
- * const obj = Object.create(null);
25
- * expect(obj, 'to have a null prototype'); // ✓ passes
26
- *
27
- * const regular = {};
28
- * expect(regular, 'to have a null prototype'); // ✗ fails - has Object.prototype
29
- * ```
30
- *
31
- * @group Esoteric Assertions
32
- * @bupkisAnchor object-to-have-a-null-prototype
33
- * @bupkisAssertionCategory object
34
- */
35
- export declare const nullPrototypeAssertion: import("../assertion-types.js").AssertionStandardSchemaSync<readonly [readonly ["to have a null prototype", "to be a dictionary"]], z.ZodCustom<Record<PropertyKey, unknown>, Record<PropertyKey, unknown>>, never>;
36
- /**
37
- * Asserts that a given property key is an enumerable property of the target
38
- * object.
39
- *
40
- * This checks the `enumerable` descriptor property using
41
- * `Object.getOwnPropertyDescriptor()`. Only own properties (not inherited ones)
42
- * are considered, and the property must be enumerable (i.e., would appear in
43
- * `for...in` loops and `Object.keys()` results).
44
- *
45
- * @example
46
- *
47
- * ```typescript
48
- * const obj = { visible: 'value' };
49
- * Object.defineProperty(obj, 'hidden', {
50
- * value: 'secret',
51
- * enumerable: false,
52
- * });
53
- *
54
- * expect('visible', 'to be an enumerable property of', obj); // ✓ passes
55
- * expect('hidden', 'to be an enumerable property of', obj); // ✗ fails - not enumerable
56
- * expect('toString', 'to be an enumerable property of', obj); // ✗ fails - inherited property
57
- * ```
58
- *
59
- * @group Esoteric Assertions
60
- * @bupkisAnchor string-number-symbol-to-be-an-enumerable-property-of-non-null
61
- * @bupkisAssertionCategory object
62
- */
63
- export declare const enumerablePropertyAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodSymbol]>, "to be an enumerable property of", z.ZodNonOptional<z.ZodUnknown>], (subject: string | number | symbol, obj: unknown) => {
64
- actual: boolean;
65
- expected: boolean;
66
- message: string;
67
- } | undefined, readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodSymbol]>, import("../assertion-types.js").PhraseLiteralSlot<"to be an enumerable property of">, z.ZodNonOptional<z.ZodUnknown>]>;
68
- /**
69
- * Asserts that an object has a specified property that is enumerable.
70
- *
71
- * This is an alternative form of {@link enumerablePropertyAssertion} with the
72
- * object and property key parameters in reverse order. It checks that the given
73
- * property exists on the object and has its `enumerable` descriptor set to
74
- * `true` using `Object.getOwnPropertyDescriptor()`. Only own properties (not
75
- * inherited ones) are considered.
76
- *
77
- * @example
78
- *
79
- * ```typescript
80
- * const obj = { visible: 'value' };
81
- * Object.defineProperty(obj, 'hidden', {
82
- * value: 'secret',
83
- * enumerable: false,
84
- * });
85
- *
86
- * expect(obj, 'to have enumerable property', 'visible'); // ✓ passes
87
- * expect(obj, 'to have enumerable property', 'hidden'); // ✗ fails - not enumerable
88
- * expect(obj, 'to have enumerable property', 'nonexistent'); // ✗ fails - property doesn't exist
89
- * ```
90
- *
91
- * @param subject - The object to check for the enumerable property
92
- * @param key - The property key to test for enumerability
93
- * @group Esoteric Assertions
94
- * @see {@link enumerablePropertyAssertion} - Alternative parameter order
95
- */
96
- export declare const enumerablePropertyAssertion2: import("../assertion-types.js").AssertionFunctionSync<readonly [z.ZodNonOptional<z.ZodUnknown>, "to have enumerable property", z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodSymbol]>], (_subject: unknown, key: string | number | symbol) => z.ZodCustom<unknown, unknown>, readonly [z.ZodNonOptional<z.ZodUnknown>, import("../assertion-types.js").PhraseLiteralSlot<"to have enumerable property">, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodSymbol]>]>;
97
- /**
98
- * Asserts that an object is sealed using `Object.isSealed()`.
99
- *
100
- * A sealed object cannot have new properties added to it, and all existing
101
- * properties are marked as non-configurable. However, writable properties can
102
- * still be modified. This is less restrictive than being frozen but more
103
- * restrictive than being non-extensible.
104
- *
105
- * @example
106
- *
107
- * ```typescript
108
- * const obj = { prop: 'value' };
109
- * Object.seal(obj);
110
- *
111
- * expect(obj, 'to be sealed'); // ✓ passes
112
- *
113
- * obj.prop = 'new value'; // This still works
114
- * obj.newProp = 'fail'; // This will fail (in strict mode)
115
- *
116
- * const regular = {};
117
- * expect(regular, 'to be sealed'); // ✗ fails - not sealed
118
- * ```
119
- *
120
- * @group Esoteric Assertions
121
- * @bupkisAnchor unknown-to-be-sealed
122
- * @bupkisAssertionCategory object
123
- */
124
- export declare const sealedAssertion: import("../assertion-types.js").AssertionStandardSchemaSync<readonly ["to be sealed"], z.ZodUnknown, never>;
125
- /**
126
- * Asserts that an object is frozen using `Object.isFrozen()`.
127
- *
128
- * A frozen object is completely immutable - no properties can be added,
129
- * removed, or modified, and no property descriptors can be changed. This is the
130
- * most restrictive object state. Frozen objects are automatically sealed and
131
- * non-extensible.
132
- *
133
- * @example
134
- *
135
- * ```typescript
136
- * const obj = { prop: 'value' };
137
- * Object.freeze(obj);
138
- *
139
- * expect(obj, 'to be frozen'); // ✓ passes
140
- *
141
- * // All of these operations will fail silently (or throw in strict mode):
142
- * obj.prop = 'new value'; // Cannot modify existing property
143
- * obj.newProp = 'fail'; // Cannot add new property
144
- * delete obj.prop; // Cannot delete property
145
- *
146
- * const regular = {};
147
- * expect(regular, 'to be frozen'); // ✗ fails - not frozen
148
- * ```
149
- *
150
- * @group Esoteric Assertions
151
- * @bupkisAnchor unknown-to-be-frozen
152
- * @bupkisAssertionCategory object
153
- */
154
- export declare const frozenAssertion: import("../assertion-types.js").AssertionFunctionSync<readonly ["to be frozen"], (subject: unknown) => {
155
- actual: boolean;
156
- expected: boolean;
157
- message: string;
158
- } | undefined, never>;
159
- /**
160
- * Asserts that an object is extensible using `Object.isExtensible()`.
161
- *
162
- * An extensible object allows new properties to be added to it. This is the
163
- * default state for objects, but can be disabled using
164
- * `Object.preventExtensions()`, `Object.seal()`, or `Object.freeze()`. This
165
- * assertion is useful for testing that an object hasn't been made
166
- * non-extensible by any of these operations.
167
- *
168
- * @example
169
- *
170
- * ```typescript
171
- * const obj = {};
172
- * expect(obj, 'to be extensible'); // ✓ passes - objects are extensible by default
173
- *
174
- * obj.newProp = 'value'; // This works
175
- *
176
- * Object.preventExtensions(obj);
177
- * expect(obj, 'to be extensible'); // ✗ fails - no longer extensible
178
- *
179
- * const sealed = Object.seal({});
180
- * expect(sealed, 'to be extensible'); // ✗ fails - sealed objects are non-extensible
181
- *
182
- * const frozen = Object.freeze({});
183
- * expect(frozen, 'to be extensible'); // ✗ fails - frozen objects are non-extensible
184
- * ```
185
- *
186
- * @group Esoteric Assertions
187
- * @bupkisAnchor unknown-to-be-extensible
188
- * @bupkisAssertionCategory object
189
- */
190
- export declare const extensibleAssertion: import("../assertion-types.js").AssertionStandardSchemaSync<readonly ["to be extensible"], z.ZodUnknown, never>;
191
- //# sourceMappingURL=sync-esoteric.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sync-esoteric.d.ts","sourceRoot":"","sources":["../../../src/assertion/impl/sync-esoteric.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,sBAAsB,qNAGlC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,2BAA2B;;;;6MAevC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,4BAA4B,+cAYxC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,eAAe,6GAG3B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,eAAe;;;;qBAQ1B,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,mBAAmB,iHAG/B,CAAC"}