solve-engine 1.2.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (384) hide show
  1. package/README.md +12 -17
  2. package/dist/{BytecodeBuilder-Bp9xeTmX.d.cts → BytecodeBuilder-DGGeByAP.d.cts} +18 -0
  3. package/dist/{BytecodeBuilder-Bp9xeTmX.d.ts → BytecodeBuilder-DGGeByAP.d.ts} +18 -0
  4. package/dist/{Configuration-C9W8tJv_.d.cts → Configuration-B6W0-T67.d.cts} +17 -4
  5. package/dist/{Configuration-C9W8tJv_.d.ts → Configuration-B6W0-T67.d.ts} +17 -4
  6. package/dist/{EngineError-CNA_rHY-.d.cts → EngineError-Ce1lPkjZ.d.cts} +2 -0
  7. package/dist/{EngineError-CNA_rHY-.d.ts → EngineError-Ce1lPkjZ.d.ts} +2 -0
  8. package/dist/{PackageCompatibility-B6NX9IaN.d.cts → PackageCompatibility-Bn5jnBtA.d.cts} +2 -2
  9. package/dist/{PackageCompatibility-Ceg5XdAp.d.ts → PackageCompatibility-CIvq2MP5.d.ts} +2 -2
  10. package/dist/{PackageRegistry-DrCPQNyy.d.ts → PackageRegistry-DzeiWcv4.d.ts} +93 -172
  11. package/dist/{PackageRegistry-DnJYVw9G.d.cts → PackageRegistry-dpdurBVO.d.cts} +93 -172
  12. package/dist/{Parselet-Bhf7d0_W.d.ts → Parselet-B-zoPrTa.d.ts} +8 -5
  13. package/dist/{Parselet-Cv7S7KRt.d.cts → Parselet-C4Wu055_.d.cts} +8 -5
  14. package/dist/{ScopeManager-Bzq87GfA.d.ts → ScopeManager-C2LDOrDx.d.ts} +7 -16
  15. package/dist/{ScopeManager-DRDBVfan.d.cts → ScopeManager-D7uMXbhS.d.cts} +7 -16
  16. package/dist/{VMCheckpoints-C6c17Hbo.d.ts → VMCheckpoints-CGyFhivM.d.ts} +3 -3
  17. package/dist/{VMCheckpoints-dZxSMGHG.d.cts → VMCheckpoints-I9jg3jWR.d.cts} +3 -3
  18. package/dist/{Value-DZNQ_PU7.d.cts → Value-CCi_Eecs.d.cts} +40 -0
  19. package/dist/{Value-DZNQ_PU7.d.ts → Value-CCi_Eecs.d.ts} +40 -0
  20. package/dist/{WorkerError-Djd7GGGa.d.cts → WorkerError-B4p6PNfx.d.cts} +1 -1
  21. package/dist/{WorkerError-B7t7R2-m.d.ts → WorkerError-Dhj9BQ_A.d.ts} +1 -1
  22. package/dist/chunk-2JMFUQZH.js +2 -0
  23. package/dist/chunk-2JMFUQZH.js.map +1 -0
  24. package/dist/chunk-2RWAXT6O.js +0 -1
  25. package/dist/chunk-4BZIYU7S.cjs +3 -0
  26. package/dist/chunk-4BZIYU7S.cjs.map +1 -0
  27. package/dist/chunk-4J7XZSZJ.cjs +5 -0
  28. package/dist/chunk-4J7XZSZJ.cjs.map +1 -0
  29. package/dist/chunk-4QVBSG6B.cjs +2 -0
  30. package/dist/chunk-4QVBSG6B.cjs.map +1 -0
  31. package/dist/chunk-5IJD5L3O.cjs +2 -0
  32. package/dist/chunk-5IJD5L3O.cjs.map +1 -0
  33. package/dist/chunk-62LMTO4F.js +2 -0
  34. package/dist/chunk-62LMTO4F.js.map +1 -0
  35. package/dist/chunk-6CY44ZPG.js +2 -0
  36. package/dist/chunk-6CY44ZPG.js.map +1 -0
  37. package/dist/chunk-6G3PMEPA.js +2 -0
  38. package/dist/chunk-6G3PMEPA.js.map +1 -0
  39. package/dist/chunk-6INX773F.cjs +2 -0
  40. package/dist/chunk-6INX773F.cjs.map +1 -0
  41. package/dist/chunk-6KFVG6UY.cjs +2 -0
  42. package/dist/{chunk-YJHY7CMN.cjs.map → chunk-6KFVG6UY.cjs.map} +1 -1
  43. package/dist/chunk-76F3LCIL.js +4 -0
  44. package/dist/chunk-76F3LCIL.js.map +1 -0
  45. package/dist/chunk-7GK3XEZF.js +2 -0
  46. package/dist/chunk-7GK3XEZF.js.map +1 -0
  47. package/dist/chunk-APN442VD.cjs +2 -0
  48. package/dist/chunk-APN442VD.cjs.map +1 -0
  49. package/dist/chunk-AXMQG5TS.cjs +2 -0
  50. package/dist/chunk-AXMQG5TS.cjs.map +1 -0
  51. package/dist/chunk-CIQOK7Q4.cjs +2 -0
  52. package/dist/chunk-CIQOK7Q4.cjs.map +1 -0
  53. package/dist/chunk-E6Z4NQAS.js +2 -0
  54. package/dist/chunk-E6Z4NQAS.js.map +1 -0
  55. package/dist/chunk-EFJCC6FJ.cjs +2 -0
  56. package/dist/chunk-EFJCC6FJ.cjs.map +1 -0
  57. package/dist/chunk-ESUN2THE.cjs +2 -0
  58. package/dist/chunk-ESUN2THE.cjs.map +1 -0
  59. package/dist/chunk-EVAOPEO4.js +2 -0
  60. package/dist/chunk-EVAOPEO4.js.map +1 -0
  61. package/dist/chunk-EYRBENHC.js +3 -0
  62. package/dist/chunk-EYRBENHC.js.map +1 -0
  63. package/dist/chunk-FDE5HWDI.cjs +2 -0
  64. package/dist/chunk-FDE5HWDI.cjs.map +1 -0
  65. package/dist/chunk-FWW3M36J.cjs +2 -0
  66. package/dist/chunk-FWW3M36J.cjs.map +1 -0
  67. package/dist/chunk-GOIQYUWV.js +2 -0
  68. package/dist/chunk-GOIQYUWV.js.map +1 -0
  69. package/dist/chunk-HFKDWQUL.js +2 -0
  70. package/dist/chunk-HFKDWQUL.js.map +1 -0
  71. package/dist/chunk-HLBYHXQD.cjs +3 -0
  72. package/dist/chunk-HLBYHXQD.cjs.map +1 -0
  73. package/dist/chunk-IANAMBJQ.cjs +2 -0
  74. package/dist/chunk-IANAMBJQ.cjs.map +1 -0
  75. package/dist/chunk-IJMNVBIS.js +2 -0
  76. package/dist/chunk-IJMNVBIS.js.map +1 -0
  77. package/dist/chunk-J4LZD4ZY.js +3 -0
  78. package/dist/chunk-J4LZD4ZY.js.map +1 -0
  79. package/dist/chunk-JAK3RAFA.cjs +2 -0
  80. package/dist/chunk-JAK3RAFA.cjs.map +1 -0
  81. package/dist/chunk-JFAJN3C2.cjs +2 -0
  82. package/dist/chunk-JFAJN3C2.cjs.map +1 -0
  83. package/dist/chunk-JPFCXLJV.js +2 -0
  84. package/dist/chunk-JPFCXLJV.js.map +1 -0
  85. package/dist/chunk-JSPKKNPQ.js +3 -0
  86. package/dist/chunk-JSPKKNPQ.js.map +1 -0
  87. package/dist/chunk-L3FPQSGN.js +2 -0
  88. package/dist/chunk-L3FPQSGN.js.map +1 -0
  89. package/dist/chunk-LR4E4A4W.cjs +2 -0
  90. package/dist/chunk-LR4E4A4W.cjs.map +1 -0
  91. package/dist/chunk-MIQBJGGR.js +2 -0
  92. package/dist/chunk-MIQBJGGR.js.map +1 -0
  93. package/dist/chunk-MPB7KUN5.js +3 -0
  94. package/dist/chunk-MPB7KUN5.js.map +1 -0
  95. package/dist/chunk-MSYX32PF.cjs +2 -0
  96. package/dist/chunk-MSYX32PF.cjs.map +1 -0
  97. package/dist/chunk-MVZUTETT.js +2 -0
  98. package/dist/chunk-MVZUTETT.js.map +1 -0
  99. package/dist/chunk-N7N7MPMK.cjs +2 -0
  100. package/dist/chunk-N7N7MPMK.cjs.map +1 -0
  101. package/dist/chunk-NGBBNL4K.cjs +1 -3
  102. package/dist/chunk-P6WPEUAJ.cjs +2 -0
  103. package/dist/chunk-P6WPEUAJ.cjs.map +1 -0
  104. package/dist/chunk-PS272DZJ.cjs +2 -0
  105. package/dist/chunk-PS272DZJ.cjs.map +1 -0
  106. package/dist/chunk-QXQE7X4S.js +2 -0
  107. package/dist/chunk-QXQE7X4S.js.map +1 -0
  108. package/dist/chunk-R2ENWQ76.js +2 -0
  109. package/dist/chunk-R2ENWQ76.js.map +1 -0
  110. package/dist/chunk-R2SZFJTT.cjs +2 -0
  111. package/dist/chunk-R2SZFJTT.cjs.map +1 -0
  112. package/dist/chunk-RAF57WYO.js +2 -0
  113. package/dist/chunk-RAF57WYO.js.map +1 -0
  114. package/dist/chunk-RSF25YSJ.js +2 -0
  115. package/dist/chunk-RSF25YSJ.js.map +1 -0
  116. package/dist/chunk-SOMGSIO4.cjs +3 -0
  117. package/dist/chunk-SOMGSIO4.cjs.map +1 -0
  118. package/dist/chunk-SUXRZWH2.cjs +3 -0
  119. package/dist/chunk-SUXRZWH2.cjs.map +1 -0
  120. package/dist/chunk-SYYE3QAX.cjs +2 -0
  121. package/dist/chunk-SYYE3QAX.cjs.map +1 -0
  122. package/dist/chunk-SZGK6RIP.cjs +2 -0
  123. package/dist/chunk-SZGK6RIP.cjs.map +1 -0
  124. package/dist/chunk-TCZSPH4A.js +2 -0
  125. package/dist/chunk-TCZSPH4A.js.map +1 -0
  126. package/dist/chunk-TLG7VZRX.cjs +2 -0
  127. package/dist/chunk-TLG7VZRX.cjs.map +1 -0
  128. package/dist/chunk-TRBXW6HW.js +2 -0
  129. package/dist/{chunk-AQNHHJMJ.cjs.map → chunk-TRBXW6HW.js.map} +1 -1
  130. package/dist/chunk-TTFO4YDP.cjs +2 -0
  131. package/dist/chunk-TTFO4YDP.cjs.map +1 -0
  132. package/dist/chunk-TWC7K3ZX.js +2 -0
  133. package/dist/chunk-TWC7K3ZX.js.map +1 -0
  134. package/dist/chunk-UDQ57ZRX.cjs +2 -0
  135. package/dist/chunk-UDQ57ZRX.cjs.map +1 -0
  136. package/dist/chunk-UI6IFGBT.js +2 -0
  137. package/dist/chunk-UI6IFGBT.js.map +1 -0
  138. package/dist/chunk-UURM7P3P.cjs +4 -0
  139. package/dist/chunk-UURM7P3P.cjs.map +1 -0
  140. package/dist/chunk-W2JAR233.js +2 -0
  141. package/dist/chunk-W2JAR233.js.map +1 -0
  142. package/dist/chunk-WGZ3FNHI.js +2 -0
  143. package/dist/chunk-WGZ3FNHI.js.map +1 -0
  144. package/dist/chunk-WN5CMP4T.cjs +3 -0
  145. package/dist/chunk-WN5CMP4T.cjs.map +1 -0
  146. package/dist/chunk-XEIDV5JP.js +2 -0
  147. package/dist/chunk-XEIDV5JP.js.map +1 -0
  148. package/dist/chunk-XNIWQHXY.js +2 -0
  149. package/dist/chunk-XNIWQHXY.js.map +1 -0
  150. package/dist/chunk-XR7HEC7B.js +5 -0
  151. package/dist/chunk-XR7HEC7B.js.map +1 -0
  152. package/dist/chunk-Y7O4D3BJ.cjs +2 -0
  153. package/dist/chunk-Y7O4D3BJ.cjs.map +1 -0
  154. package/dist/chunk-YAYBVVG2.js +3 -0
  155. package/dist/chunk-YAYBVVG2.js.map +1 -0
  156. package/dist/chunk-YJ2OPULK.js +2 -0
  157. package/dist/chunk-YJ2OPULK.js.map +1 -0
  158. package/dist/chunk-YVKHEAFT.js +2 -0
  159. package/dist/chunk-YVKHEAFT.js.map +1 -0
  160. package/dist/chunk-ZCNBT44X.cjs +2 -0
  161. package/dist/chunk-ZCNBT44X.cjs.map +1 -0
  162. package/dist/chunk-ZLRJ7TDP.cjs +2 -0
  163. package/dist/chunk-ZLRJ7TDP.cjs.map +1 -0
  164. package/dist/constants.cjs +1 -21
  165. package/dist/constants.d.cts +1 -1
  166. package/dist/constants.d.ts +1 -1
  167. package/dist/constants.js +1 -4
  168. package/dist/engine.cjs +1 -94
  169. package/dist/engine.d.cts +10 -11
  170. package/dist/engine.d.ts +10 -11
  171. package/dist/engine.js +1 -37
  172. package/dist/errors.cjs +1 -105
  173. package/dist/errors.d.cts +3 -3
  174. package/dist/errors.d.ts +3 -3
  175. package/dist/errors.js +1 -4
  176. package/dist/format.cjs +1 -26
  177. package/dist/format.d.cts +2 -2
  178. package/dist/format.d.ts +2 -2
  179. package/dist/format.js +1 -9
  180. package/dist/index.cjs +1 -314
  181. package/dist/index.cjs.map +1 -1
  182. package/dist/index.d.cts +52 -20
  183. package/dist/index.d.ts +52 -20
  184. package/dist/index.js +1 -278
  185. package/dist/index.js.map +1 -1
  186. package/dist/language.cjs +1 -369
  187. package/dist/language.cjs.map +1 -1
  188. package/dist/language.d.cts +9 -10
  189. package/dist/language.d.ts +9 -10
  190. package/dist/language.js +1 -348
  191. package/dist/language.js.map +1 -1
  192. package/dist/lexer.cjs +1 -63
  193. package/dist/lexer.js +1 -10
  194. package/dist/normalizer.cjs +1 -39
  195. package/dist/normalizer.js +1 -10
  196. package/dist/packages.cjs +1 -132
  197. package/dist/packages.d.cts +8 -9
  198. package/dist/packages.d.ts +8 -9
  199. package/dist/packages.js +1 -23
  200. package/dist/parser.cjs +1 -54
  201. package/dist/parser.d.cts +8 -8
  202. package/dist/parser.d.ts +8 -8
  203. package/dist/parser.js +1 -9
  204. package/dist/{pipeline-D-PS9gVw.d.ts → pipeline-72QmQlGx.d.ts} +1 -1
  205. package/dist/{pipeline-DtSBJ8TS.d.cts → pipeline-DCQicwWX.d.cts} +1 -1
  206. package/dist/resolvers.cjs +1 -12
  207. package/dist/resolvers.d.cts +2 -2
  208. package/dist/resolvers.d.ts +2 -2
  209. package/dist/resolvers.js +1 -3
  210. package/dist/services.cjs +1 -20
  211. package/dist/services.js +1 -3
  212. package/dist/testing.cjs +3 -477
  213. package/dist/testing.cjs.map +1 -1
  214. package/dist/testing.d.cts +9 -10
  215. package/dist/testing.d.ts +9 -10
  216. package/dist/testing.js +3 -469
  217. package/dist/testing.js.map +1 -1
  218. package/dist/uom.cjs +1 -55
  219. package/dist/uom.d.cts +2 -2
  220. package/dist/uom.d.ts +2 -2
  221. package/dist/uom.js +1 -10
  222. package/dist/utilities.cjs +1 -36
  223. package/dist/utilities.js +1 -7
  224. package/dist/vm.cjs +1 -295
  225. package/dist/vm.cjs.map +1 -1
  226. package/dist/vm.d.cts +22 -10
  227. package/dist/vm.d.ts +22 -10
  228. package/dist/vm.js +1 -193
  229. package/dist/vm.js.map +1 -1
  230. package/dist/worker.cjs +2 -492
  231. package/dist/worker.cjs.map +1 -1
  232. package/dist/worker.d.cts +16 -17
  233. package/dist/worker.d.ts +16 -17
  234. package/dist/worker.js +2 -483
  235. package/dist/worker.js.map +1 -1
  236. package/package.json +1 -13
  237. package/dist/chunk-3BOK2LDK.js +0 -17
  238. package/dist/chunk-3BOK2LDK.js.map +0 -1
  239. package/dist/chunk-3VGDNEE3.js +0 -84
  240. package/dist/chunk-3VGDNEE3.js.map +0 -1
  241. package/dist/chunk-4K5W7EH2.cjs +0 -112
  242. package/dist/chunk-4K5W7EH2.cjs.map +0 -1
  243. package/dist/chunk-5EFKSKMA.js +0 -413
  244. package/dist/chunk-5EFKSKMA.js.map +0 -1
  245. package/dist/chunk-5HRB36DK.js +0 -405
  246. package/dist/chunk-5HRB36DK.js.map +0 -1
  247. package/dist/chunk-5ON7PUAZ.js +0 -12
  248. package/dist/chunk-5ON7PUAZ.js.map +0 -1
  249. package/dist/chunk-7AXJNQMF.cjs +0 -297
  250. package/dist/chunk-7AXJNQMF.cjs.map +0 -1
  251. package/dist/chunk-7JM3F4KL.js +0 -1795
  252. package/dist/chunk-7JM3F4KL.js.map +0 -1
  253. package/dist/chunk-7USV76HV.cjs +0 -341
  254. package/dist/chunk-7USV76HV.cjs.map +0 -1
  255. package/dist/chunk-A2DZ5BEJ.cjs +0 -1930
  256. package/dist/chunk-A2DZ5BEJ.cjs.map +0 -1
  257. package/dist/chunk-ADBA3XBE.cjs +0 -20
  258. package/dist/chunk-ADBA3XBE.cjs.map +0 -1
  259. package/dist/chunk-AKNGX4TZ.cjs +0 -236
  260. package/dist/chunk-AKNGX4TZ.cjs.map +0 -1
  261. package/dist/chunk-ALYRJ72W.cjs +0 -434
  262. package/dist/chunk-ALYRJ72W.cjs.map +0 -1
  263. package/dist/chunk-AMOJYLG2.cjs +0 -1692
  264. package/dist/chunk-AMOJYLG2.cjs.map +0 -1
  265. package/dist/chunk-AOH6UR2L.js +0 -825
  266. package/dist/chunk-AOH6UR2L.js.map +0 -1
  267. package/dist/chunk-AQNHHJMJ.cjs +0 -261
  268. package/dist/chunk-B7LXJ6LC.cjs +0 -36
  269. package/dist/chunk-B7LXJ6LC.cjs.map +0 -1
  270. package/dist/chunk-BESTLPRK.cjs +0 -6919
  271. package/dist/chunk-BESTLPRK.cjs.map +0 -1
  272. package/dist/chunk-BLI4NIQY.js +0 -98
  273. package/dist/chunk-BLI4NIQY.js.map +0 -1
  274. package/dist/chunk-BSPXMGIS.js +0 -455
  275. package/dist/chunk-BSPXMGIS.js.map +0 -1
  276. package/dist/chunk-C2OMO3WN.cjs +0 -2806
  277. package/dist/chunk-C2OMO3WN.cjs.map +0 -1
  278. package/dist/chunk-CSDQMDU2.js +0 -204
  279. package/dist/chunk-CSDQMDU2.js.map +0 -1
  280. package/dist/chunk-EJ3ILXX6.cjs +0 -223
  281. package/dist/chunk-EJ3ILXX6.cjs.map +0 -1
  282. package/dist/chunk-ENRIK36Q.cjs +0 -94
  283. package/dist/chunk-ENRIK36Q.cjs.map +0 -1
  284. package/dist/chunk-F4UB4XIL.js +0 -109
  285. package/dist/chunk-F4UB4XIL.js.map +0 -1
  286. package/dist/chunk-FD5ZZHEU.js +0 -92
  287. package/dist/chunk-FD5ZZHEU.js.map +0 -1
  288. package/dist/chunk-FE4RC37D.js +0 -2801
  289. package/dist/chunk-FE4RC37D.js.map +0 -1
  290. package/dist/chunk-FEAIOR7N.cjs +0 -91
  291. package/dist/chunk-FEAIOR7N.cjs.map +0 -1
  292. package/dist/chunk-FR7RNOPT.cjs +0 -3303
  293. package/dist/chunk-FR7RNOPT.cjs.map +0 -1
  294. package/dist/chunk-G2YPPLGX.cjs +0 -484
  295. package/dist/chunk-G2YPPLGX.cjs.map +0 -1
  296. package/dist/chunk-GCM5JHMX.js +0 -88
  297. package/dist/chunk-GCM5JHMX.js.map +0 -1
  298. package/dist/chunk-GDEU72RG.cjs +0 -829
  299. package/dist/chunk-GDEU72RG.cjs.map +0 -1
  300. package/dist/chunk-HKTQCQ4Z.cjs +0 -8383
  301. package/dist/chunk-HKTQCQ4Z.cjs.map +0 -1
  302. package/dist/chunk-HWHU642X.cjs +0 -316
  303. package/dist/chunk-HWHU642X.cjs.map +0 -1
  304. package/dist/chunk-ICEKS6YC.cjs +0 -507
  305. package/dist/chunk-ICEKS6YC.cjs.map +0 -1
  306. package/dist/chunk-IJGOFP2J.js +0 -6904
  307. package/dist/chunk-IJGOFP2J.js.map +0 -1
  308. package/dist/chunk-IQJGDZOP.js +0 -333
  309. package/dist/chunk-IQJGDZOP.js.map +0 -1
  310. package/dist/chunk-IT74O4BE.cjs +0 -456
  311. package/dist/chunk-IT74O4BE.cjs.map +0 -1
  312. package/dist/chunk-KXDQKVNX.cjs +0 -459
  313. package/dist/chunk-KXDQKVNX.cjs.map +0 -1
  314. package/dist/chunk-L2TE7PMO.cjs +0 -14
  315. package/dist/chunk-L2TE7PMO.cjs.map +0 -1
  316. package/dist/chunk-L5YHV6BQ.js +0 -499
  317. package/dist/chunk-L5YHV6BQ.js.map +0 -1
  318. package/dist/chunk-LO7HU5WB.cjs +0 -209
  319. package/dist/chunk-LO7HU5WB.cjs.map +0 -1
  320. package/dist/chunk-LSALB3IN.js +0 -292
  321. package/dist/chunk-LSALB3IN.js.map +0 -1
  322. package/dist/chunk-MI7OTUHL.cjs +0 -339
  323. package/dist/chunk-MI7OTUHL.cjs.map +0 -1
  324. package/dist/chunk-MIGXCBXT.cjs +0 -381
  325. package/dist/chunk-MIGXCBXT.cjs.map +0 -1
  326. package/dist/chunk-MVTOCRV2.js +0 -213
  327. package/dist/chunk-MVTOCRV2.js.map +0 -1
  328. package/dist/chunk-N7FNVFXW.cjs +0 -32
  329. package/dist/chunk-N7FNVFXW.cjs.map +0 -1
  330. package/dist/chunk-N7OA4WPJ.js +0 -362
  331. package/dist/chunk-N7OA4WPJ.js.map +0 -1
  332. package/dist/chunk-NAWZATKT.js +0 -478
  333. package/dist/chunk-NAWZATKT.js.map +0 -1
  334. package/dist/chunk-NLNDMWZC.js +0 -31
  335. package/dist/chunk-NLNDMWZC.js.map +0 -1
  336. package/dist/chunk-ORM7CHYZ.js +0 -1531
  337. package/dist/chunk-ORM7CHYZ.js.map +0 -1
  338. package/dist/chunk-OUHT5Z36.cjs +0 -393
  339. package/dist/chunk-OUHT5Z36.cjs.map +0 -1
  340. package/dist/chunk-PCZVMMWU.cjs +0 -74
  341. package/dist/chunk-PCZVMMWU.cjs.map +0 -1
  342. package/dist/chunk-RNKDIXDV.js +0 -336
  343. package/dist/chunk-RNKDIXDV.js.map +0 -1
  344. package/dist/chunk-SBUFNJVE.js +0 -258
  345. package/dist/chunk-SBUFNJVE.js.map +0 -1
  346. package/dist/chunk-TC6BTUSU.cjs +0 -1799
  347. package/dist/chunk-TC6BTUSU.cjs.map +0 -1
  348. package/dist/chunk-TPOK3UNI.js +0 -8355
  349. package/dist/chunk-TPOK3UNI.js.map +0 -1
  350. package/dist/chunk-UF6JG5SG.js +0 -312
  351. package/dist/chunk-UF6JG5SG.js.map +0 -1
  352. package/dist/chunk-UKQHXPGW.js +0 -30
  353. package/dist/chunk-UKQHXPGW.js.map +0 -1
  354. package/dist/chunk-V4XG5QF6.js +0 -1685
  355. package/dist/chunk-V4XG5QF6.js.map +0 -1
  356. package/dist/chunk-VEKIWQ3F.cjs +0 -39
  357. package/dist/chunk-VEKIWQ3F.cjs.map +0 -1
  358. package/dist/chunk-WMQRJTAO.js +0 -3266
  359. package/dist/chunk-WMQRJTAO.js.map +0 -1
  360. package/dist/chunk-X6K3HUOY.cjs +0 -86
  361. package/dist/chunk-X6K3HUOY.cjs.map +0 -1
  362. package/dist/chunk-XBTEO4OB.js +0 -391
  363. package/dist/chunk-XBTEO4OB.js.map +0 -1
  364. package/dist/chunk-XIYYHA65.cjs +0 -101
  365. package/dist/chunk-XIYYHA65.cjs.map +0 -1
  366. package/dist/chunk-YJHY7CMN.cjs +0 -1534
  367. package/dist/chunk-YLJ4XMA6.js +0 -33
  368. package/dist/chunk-YLJ4XMA6.js.map +0 -1
  369. package/dist/chunk-YNIWOYW6.js +0 -232
  370. package/dist/chunk-YNIWOYW6.js.map +0 -1
  371. package/dist/chunk-Z2XP767T.cjs +0 -35
  372. package/dist/chunk-Z2XP767T.cjs.map +0 -1
  373. package/dist/chunk-Z4X2RWOF.js +0 -37
  374. package/dist/chunk-Z4X2RWOF.js.map +0 -1
  375. package/dist/chunk-ZN6YYPIW.js +0 -67
  376. package/dist/chunk-ZN6YYPIW.js.map +0 -1
  377. package/dist/chunk-ZNFFTYWH.js +0 -1854
  378. package/dist/chunk-ZNFFTYWH.js.map +0 -1
  379. package/dist/variables.cjs +0 -17
  380. package/dist/variables.cjs.map +0 -1
  381. package/dist/variables.d.cts +0 -87
  382. package/dist/variables.d.ts +0 -87
  383. package/dist/variables.js +0 -4
  384. package/dist/variables.js.map +0 -1
package/dist/testing.cjs CHANGED
@@ -1,478 +1,4 @@
1
- 'use strict';
2
-
3
- var chunkBESTLPRK_cjs = require('./chunk-BESTLPRK.cjs');
4
- require('./chunk-GDEU72RG.cjs');
5
- require('./chunk-NGBBNL4K.cjs');
6
- require('./chunk-X6K3HUOY.cjs');
7
- require('./chunk-ENRIK36Q.cjs');
8
- require('./chunk-C2OMO3WN.cjs');
9
- require('./chunk-HWHU642X.cjs');
10
- require('./chunk-AKNGX4TZ.cjs');
11
- require('./chunk-N7FNVFXW.cjs');
12
- var chunkHKTQCQ4Z_cjs = require('./chunk-HKTQCQ4Z.cjs');
13
- require('./chunk-MI7OTUHL.cjs');
14
- require('./chunk-ICEKS6YC.cjs');
15
- require('./chunk-ADBA3XBE.cjs');
16
- require('./chunk-4K5W7EH2.cjs');
17
- require('./chunk-Z2XP767T.cjs');
18
- require('./chunk-FR7RNOPT.cjs');
19
- require('./chunk-FEAIOR7N.cjs');
20
- require('./chunk-KXDQKVNX.cjs');
21
- require('./chunk-XIYYHA65.cjs');
22
- require('./chunk-VEKIWQ3F.cjs');
23
- require('./chunk-ALYRJ72W.cjs');
24
- require('./chunk-A2DZ5BEJ.cjs');
25
- var chunkIT74O4BE_cjs = require('./chunk-IT74O4BE.cjs');
26
- require('./chunk-EJ3ILXX6.cjs');
27
- var chunkLO7HU5WB_cjs = require('./chunk-LO7HU5WB.cjs');
28
- require('./chunk-7USV76HV.cjs');
29
- require('./chunk-7AXJNQMF.cjs');
30
- require('./chunk-YJHY7CMN.cjs');
31
- require('./chunk-G2YPPLGX.cjs');
32
- require('./chunk-OUHT5Z36.cjs');
33
- require('./chunk-AQNHHJMJ.cjs');
34
- require('./chunk-AMOJYLG2.cjs');
35
- var chunkMIGXCBXT_cjs = require('./chunk-MIGXCBXT.cjs');
36
- require('./chunk-B7LXJ6LC.cjs');
37
-
38
- // src/testing/index.ts
39
- var ExpectationError = class _ExpectationError extends Error {
40
- constructor(init) {
41
- super(init.message);
42
- this.name = "ExpectationError";
43
- this.code = init.code;
44
- this.expected = init.expected;
45
- this.actual = init.actual;
46
- Object.setPrototypeOf(this, _ExpectationError.prototype);
47
- }
48
- };
49
- function createTestEngine(packages = [], options = {}) {
50
- const { locale = "en", includeBuiltins = true } = options;
51
- const engine = new chunkBESTLPRK_cjs.ExpressionEngine(locale, false, void 0, void 0, includeBuiltins ? chunkHKTQCQ4Z_cjs.BUILTIN_PACKAGES : []);
52
- for (const pkg of packages) {
53
- engine.registerPackage(pkg);
54
- }
55
- return engine;
56
- }
57
- function evaluate(engine, expression) {
58
- try {
59
- const [value] = engine.evaluateExpression(expression);
60
- if (value === void 0) {
61
- return {
62
- status: "error",
63
- code: "NO_RESULT",
64
- message: "Evaluation returned no value.",
65
- source: new chunkIT74O4BE_cjs.Value(13 /* Error */, "NO_RESULT", "Evaluation returned no value.")
66
- };
67
- }
68
- if (value.type === 13 /* Error */) {
69
- return {
70
- status: "error",
71
- code: String(value.value),
72
- message: typeof value.unit === "string" ? value.unit : "",
73
- source: value
74
- };
75
- }
76
- if (value.type === 12 /* Pending */) {
77
- return { status: "pending", value };
78
- }
79
- return { status: "value", value };
80
- } catch (error) {
81
- if (error instanceof chunkMIGXCBXT_cjs.EngineError) {
82
- return { status: "error", code: error.code, message: error.message, source: error };
83
- }
84
- const message = error instanceof Error ? error.message : String(error);
85
- return {
86
- status: "error",
87
- code: "UNKNOWN_ERROR",
88
- message,
89
- source: new chunkIT74O4BE_cjs.Value(13 /* Error */, "UNKNOWN_ERROR", message)
90
- };
91
- }
92
- }
93
- function numbersEqual(a, b) {
94
- if (Object.is(a, b)) return true;
95
- if (!Number.isFinite(a) || !Number.isFinite(b)) return false;
96
- const epsilon = 1e-9 * Math.max(1, Math.abs(a), Math.abs(b));
97
- return Math.abs(a - b) <= epsilon;
98
- }
99
- function describeValue(value) {
100
- if (value.type === 3 /* String */) return JSON.stringify(value.value);
101
- if (value.type === 6 /* Uom */ && typeof value.unit === "string") {
102
- return `${String(value.value)} ${value.unit}`;
103
- }
104
- return String(value.value);
105
- }
106
- function describeOutcome(outcome) {
107
- switch (outcome.status) {
108
- case "value":
109
- return describeValue(outcome.value);
110
- case "pending":
111
- return "a pending async value";
112
- case "error":
113
- return `an error (${outcome.code}: ${outcome.message})`;
114
- }
115
- }
116
- var ExpressionAssertion = class {
117
- constructor(expression, outcome) {
118
- this.expression = expression;
119
- this.outcome = outcome;
120
- }
121
- /** The raw resolved {@link Value}, for an assertion the matchers do not cover. Throws if the expression failed. */
122
- get value() {
123
- if (this.outcome.status === "error") {
124
- throw new ExpectationError({
125
- code: "EXPECTED_VALUE",
126
- message: `Expected "${this.expression}" to evaluate, but it failed with ${describeOutcome(this.outcome)}.`,
127
- expected: "a resolved value",
128
- actual: describeOutcome(this.outcome)
129
- });
130
- }
131
- return this.outcome.value;
132
- }
133
- /**
134
- * Assert the expression evaluated to a value (not an error, not a pending
135
- * async result). Says nothing about what the value is.
136
- */
137
- toEvaluate() {
138
- if (this.outcome.status !== "value") {
139
- throw new ExpectationError({
140
- code: "EXPECTED_EVALUATE",
141
- message: `Expected "${this.expression}" to evaluate to a value, but got ${describeOutcome(this.outcome)}.`,
142
- expected: "a resolved value",
143
- actual: describeOutcome(this.outcome)
144
- });
145
- }
146
- return this;
147
- }
148
- /**
149
- * Assert the expression evaluated to `expected`, and, when `unit` is given,
150
- * that the result carries exactly that unit. A number compares against the
151
- * value's numeric magnitude within a small floating-point tolerance; a
152
- * string compares against the value's own string; a boolean against its
153
- * boolean reading. Omitting `unit` leaves the unit unchecked, so
154
- * `toEqual(5)` passes for both `5` and `5 gp`.
155
- */
156
- toEqual(expected, unit) {
157
- if (this.outcome.status !== "value") {
158
- throw new ExpectationError({
159
- code: "EXPECTED_EQUAL",
160
- message: `Expected "${this.expression}" to equal ${describeExpected(expected, unit)}, but got ${describeOutcome(this.outcome)}.`,
161
- expected: describeExpected(expected, unit),
162
- actual: describeOutcome(this.outcome)
163
- });
164
- }
165
- const value = this.outcome.value;
166
- let matches;
167
- if (typeof expected === "number") {
168
- matches = numbersEqual(value.toNumber(), expected);
169
- } else if (typeof expected === "boolean") {
170
- matches = value.type === 10 /* Boolean */ && value.value === expected;
171
- } else {
172
- matches = valueToComparableString(value) === expected;
173
- }
174
- if (!matches) {
175
- throw new ExpectationError({
176
- code: "EXPECTED_EQUAL",
177
- message: `Expected "${this.expression}" to equal ${describeExpected(expected, unit)}, but it was ${describeValue(value)}.`,
178
- expected: describeExpected(expected, unit),
179
- actual: describeValue(value)
180
- });
181
- }
182
- if (unit !== void 0 && value.unit !== unit) {
183
- throw new ExpectationError({
184
- code: "EXPECTED_UNIT",
185
- message: `Expected "${this.expression}" to carry the unit "${unit}", but it was ${value.unit === void 0 ? "unitless" : `"${value.unit}"`}.`,
186
- expected: `unit "${unit}"`,
187
- actual: value.unit === void 0 ? "no unit" : `unit "${value.unit}"`
188
- });
189
- }
190
- return this;
191
- }
192
- /** Assert the expression failed (a thrown engine error or a plugin-raised error value). Says nothing about the code. */
193
- toBeError() {
194
- if (this.outcome.status !== "error") {
195
- throw new ExpectationError({
196
- code: "EXPECTED_ERROR",
197
- message: `Expected "${this.expression}" to fail, but it produced ${describeOutcome(this.outcome)}.`,
198
- expected: "an error",
199
- actual: describeOutcome(this.outcome)
200
- });
201
- }
202
- return this;
203
- }
204
- /**
205
- * Assert the expression failed with exactly `code`, the error catalog code
206
- * (e.g. `"UNDEFINED_VARIABLE"`, or a package's own code). Reports the code
207
- * it actually got when they differ, so a near-miss is obvious.
208
- */
209
- toFailWith(code) {
210
- if (this.outcome.status !== "error") {
211
- throw new ExpectationError({
212
- code: "EXPECTED_FAIL_WITH",
213
- message: `Expected "${this.expression}" to fail with "${code}", but it produced ${describeOutcome(this.outcome)}.`,
214
- expected: `error code "${code}"`,
215
- actual: describeOutcome(this.outcome)
216
- });
217
- }
218
- if (this.outcome.code !== code) {
219
- throw new ExpectationError({
220
- code: "EXPECTED_FAIL_WITH",
221
- message: `Expected "${this.expression}" to fail with "${code}", but it failed with "${this.outcome.code}" (${this.outcome.message}).`,
222
- expected: `error code "${code}"`,
223
- actual: `error code "${this.outcome.code}"`
224
- });
225
- }
226
- return this;
227
- }
228
- /**
229
- * Assert the expression returned a value still resolving asynchronously.
230
- * The kit evaluates synchronously, so a package whose result comes from an
231
- * async resolver reports pending on first evaluation, this is how a test
232
- * confirms the async path was taken without resolving it.
233
- */
234
- toBePending() {
235
- if (this.outcome.status !== "pending") {
236
- throw new ExpectationError({
237
- code: "EXPECTED_PENDING",
238
- message: `Expected "${this.expression}" to be pending, but got ${describeOutcome(this.outcome)}.`,
239
- expected: "a pending async value",
240
- actual: describeOutcome(this.outcome)
241
- });
242
- }
243
- return this;
244
- }
245
- };
246
- function describeExpected(expected, unit) {
247
- const base = typeof expected === "string" ? JSON.stringify(expected) : String(expected);
248
- return unit === void 0 ? base : `${base} ${unit}`;
249
- }
250
- function valueToComparableString(value) {
251
- return String(value.value);
252
- }
253
- function expectExpression(engine, expression) {
254
- return new ExpressionAssertion(expression, evaluate(engine, expression));
255
- }
256
- var COMMON_PROSE_WORDS = [
257
- "a",
258
- "an",
259
- "and",
260
- "or",
261
- "but",
262
- "if",
263
- "then",
264
- "the",
265
- "this",
266
- "that",
267
- "these",
268
- "those",
269
- "in",
270
- "on",
271
- "at",
272
- "to",
273
- "of",
274
- "for",
275
- "from",
276
- "with",
277
- "by",
278
- "as",
279
- "per",
280
- "into",
281
- "over",
282
- "is",
283
- "are",
284
- "was",
285
- "were",
286
- "be",
287
- "been",
288
- "being",
289
- "do",
290
- "does",
291
- "did",
292
- "have",
293
- "has",
294
- "had",
295
- "will",
296
- "would",
297
- "can",
298
- "could",
299
- "should",
300
- "may",
301
- "might",
302
- "must",
303
- "price",
304
- "cost",
305
- "value",
306
- "total",
307
- "sum",
308
- "count",
309
- "rate",
310
- "amount",
311
- "number",
312
- "time",
313
- "date",
314
- "day",
315
- "week",
316
- "month",
317
- "year",
318
- "hour",
319
- "minute",
320
- "second",
321
- "add",
322
- "buy",
323
- "sell",
324
- "hold",
325
- "make",
326
- "take",
327
- "give",
328
- "get",
329
- "set",
330
- "run",
331
- "up",
332
- "down",
333
- "out",
334
- "off",
335
- "all",
336
- "some",
337
- "any",
338
- "no",
339
- "not",
340
- "more",
341
- "less",
342
- "one",
343
- "two",
344
- "three",
345
- "first",
346
- "last",
347
- "next",
348
- "each",
349
- "every",
350
- "here",
351
- "there"
352
- ];
353
- var SEVERITY_ORDER = ["error", "warning", "info"];
354
- function claimedWords(pkg) {
355
- const claimed = [];
356
- const vocab = pkg.lexerVocabulary;
357
- if (vocab?.keywords) {
358
- for (const [word, tokenType] of Object.entries(vocab.keywords)) {
359
- claimed.push({ word, via: "keyword", tokenType });
360
- }
361
- }
362
- if (vocab?.units) {
363
- for (const word of vocab.units) {
364
- claimed.push({ word, via: "unit" });
365
- }
366
- }
367
- if (vocab?.operators) {
368
- for (const [word, tokenType] of Object.entries(vocab.operators)) {
369
- claimed.push({ word, via: "operator", tokenType });
370
- }
371
- }
372
- if (pkg.phrases) {
373
- for (const [phrase, tokenType] of Object.entries(pkg.phrases)) {
374
- if (!phrase.includes(" ")) {
375
- claimed.push({ word: phrase, via: "phrase", tokenType });
376
- }
377
- }
378
- }
379
- return claimed;
380
- }
381
- var PackageAssertion = class {
382
- constructor(pkg) {
383
- this.pkg = pkg;
384
- }
385
- /**
386
- * Assert none of the package's claimed words shadow a prose word.
387
- *
388
- * A trigger word that is also an ordinary word turns a line of prose into
389
- * arithmetic, the single most common package mistake and the subject of the
390
- * trigger-words guide. This checks the words the package declares
391
- * (lexer keywords, units, operators, and single-word phrases) against
392
- * `words` (defaulting to {@link COMMON_PROSE_WORDS}), case-insensitively.
393
- *
394
- * @returns the shadowed words, empty when the package is clean, for a test
395
- * that wants to inspect rather than assert.
396
- */
397
- notToShadow(words = COMMON_PROSE_WORDS) {
398
- const prose = new Set(words.map((w) => w.toLowerCase()));
399
- const shadowed = claimedWords(this.pkg).filter((c) => prose.has(c.word.toLowerCase()));
400
- if (shadowed.length > 0) {
401
- const list = shadowed.map((s) => `"${s.word}" (${s.via})`).join(", ");
402
- throw new ExpectationError({
403
- code: "PACKAGE_SHADOWS_PROSE",
404
- message: `Package "${this.pkg.name}" claims prose word(s) as syntax: ${list}. A word that is also ordinary English turns prose into arithmetic; prefer a multi-word phrase or a form that requires a parenthesis.`,
405
- expected: "no prose words claimed as syntax",
406
- actual: list
407
- });
408
- }
409
- return shadowed;
410
- }
411
- /**
412
- * Assert the package does not collide with any of `others` in a way that
413
- * would silently break one of them (two packages claiming the same lexer
414
- * keyword, plugin-function index, async-resolver namespace, and so on).
415
- *
416
- * `strictness` sets which severities fail the assertion: `"error"` (the
417
- * default) fails only on the collisions that always break something,
418
- * `"warning"` also fails on the ones that silently pick a winner, `"info"`
419
- * fails on cosmetic overlaps too.
420
- *
421
- * @returns the full compatibility report, so a test can inspect every
422
- * conflict, including ones below the strictness threshold.
423
- */
424
- notToCollideWith(others, strictness = "error") {
425
- const report = chunkBESTLPRK_cjs.checkPackageCompatibility(this.pkg, others);
426
- const threshold = SEVERITY_ORDER.indexOf(strictness);
427
- const failing = report.conflicts.filter(
428
- (c) => SEVERITY_ORDER.indexOf(c.severity) <= threshold
429
- );
430
- if (failing.length > 0) {
431
- const list = failing.map((c) => `[${c.severity}] ${c.detail}`).join("\n");
432
- throw new ExpectationError({
433
- code: "PACKAGE_VOCABULARY_COLLISION",
434
- message: `Package "${this.pkg.name}" collides with another package:
435
- ${list}`,
436
- expected: `no conflicts at or above "${strictness}" severity`,
437
- actual: `${failing.length} conflict(s)`
438
- });
439
- }
440
- return report;
441
- }
442
- /**
443
- * Assert the package's declared `engineVersion` range is satisfied by the
444
- * running engine (or by `engineVersion` when given).
445
- *
446
- * A package that declares a range and never checks it resolves is the third
447
- * mistake the issue names: it looks fine until the one engine version it
448
- * cannot run against, where the range either fails to match or turns out to
449
- * be a malformed string. A package with no declared range passes (no
450
- * constraint is always compatible).
451
- */
452
- toDeclareCompatibleEngineVersion(engineVersion = chunkLO7HU5WB_cjs.ENGINE_VERSION) {
453
- const result = chunkBESTLPRK_cjs.checkEngineVersionCompatibility(this.pkg, engineVersion);
454
- if (!result.compatible) {
455
- const detail = result.reason === "invalid-range" ? `its range "${result.declaredRange}" is not valid semver` : `its range "${result.declaredRange}" is not satisfied by engine version "${result.engineVersion}"`;
456
- throw new ExpectationError({
457
- code: "PACKAGE_ENGINE_VERSION_INCOMPATIBLE",
458
- message: `Package "${this.pkg.name}" declares an engineVersion that will be rejected at registration: ${detail}.`,
459
- expected: `an engineVersion satisfied by "${engineVersion}"`,
460
- actual: `"${result.declaredRange}"`
461
- });
462
- }
463
- return this;
464
- }
465
- };
466
- function expectPackage(pkg) {
467
- return new PackageAssertion(pkg);
468
- }
469
-
470
- exports.COMMON_PROSE_WORDS = COMMON_PROSE_WORDS;
471
- exports.ExpectationError = ExpectationError;
472
- exports.ExpressionAssertion = ExpressionAssertion;
473
- exports.PackageAssertion = PackageAssertion;
474
- exports.createTestEngine = createTestEngine;
475
- exports.expectExpression = expectExpression;
476
- exports.expectPackage = expectPackage;
477
- //# sourceMappingURL=testing.cjs.map
1
+ 'use strict';var chunk4J7XZSZJ_cjs=require('./chunk-4J7XZSZJ.cjs');require('./chunk-FDE5HWDI.cjs'),require('./chunk-NGBBNL4K.cjs'),require('./chunk-ZCNBT44X.cjs'),require('./chunk-TTFO4YDP.cjs'),require('./chunk-SYYE3QAX.cjs'),require('./chunk-AXMQG5TS.cjs'),require('./chunk-HLBYHXQD.cjs'),require('./chunk-R2SZFJTT.cjs');var chunkSUXRZWH2_cjs=require('./chunk-SUXRZWH2.cjs');require('./chunk-6INX773F.cjs'),require('./chunk-SZGK6RIP.cjs'),require('./chunk-4QVBSG6B.cjs'),require('./chunk-APN442VD.cjs'),require('./chunk-UURM7P3P.cjs'),require('./chunk-ZLRJ7TDP.cjs'),require('./chunk-JAK3RAFA.cjs'),require('./chunk-4BZIYU7S.cjs'),require('./chunk-JFAJN3C2.cjs'),require('./chunk-TLG7VZRX.cjs'),require('./chunk-ESUN2THE.cjs'),require('./chunk-N7N7MPMK.cjs');var chunkPS272DZJ_cjs=require('./chunk-PS272DZJ.cjs');require('./chunk-IANAMBJQ.cjs');var chunkUDQ57ZRX_cjs=require('./chunk-UDQ57ZRX.cjs');require('./chunk-LR4E4A4W.cjs'),require('./chunk-Y7O4D3BJ.cjs'),require('./chunk-6KFVG6UY.cjs'),require('./chunk-5IJD5L3O.cjs'),require('./chunk-MSYX32PF.cjs'),require('./chunk-FWW3M36J.cjs'),require('./chunk-CIQOK7Q4.cjs');var chunkSOMGSIO4_cjs=require('./chunk-SOMGSIO4.cjs');var i=class o extends Error{constructor(t){super(t.message),this.name="ExpectationError",this.code=t.code,this.expected=t.expected,this.actual=t.actual,Object.setPrototypeOf(this,o.prototype);}};function V(o=[],t={}){let{locale:e="en",includeBuiltins:r=true}=t,s=new chunk4J7XZSZJ_cjs.n({locale:e,packages:r?chunkSUXRZWH2_cjs.y:[]});for(let a of o)s.registerPackage(a);return s}function v(o,t){try{let e=o.evaluateExpression(t);return e.isError()?{status:"error",code:e.errorCode??"",message:e.errorMessage??"",source:e}:e.isPending()?{status:"pending",value:e}:{status:"value",value:e}}catch(e){if(e instanceof chunkSOMGSIO4_cjs.b)return {status:"error",code:e.code,message:e.message,source:e};let r=e instanceof Error?e.message:String(e);return {status:"error",code:"UNKNOWN_ERROR",message:r,source:new chunkPS272DZJ_cjs.m(13,"UNKNOWN_ERROR",r)}}}function x(o,t){if(Object.is(o,t))return true;if(!Number.isFinite(o)||!Number.isFinite(t))return false;let e=1e-9*Math.max(1,Math.abs(o),Math.abs(t));return Math.abs(o-t)<=e}function l(o){return o.type===3?JSON.stringify(o.value):o.type===6&&typeof o.unit=="string"?`${String(o.value)} ${o.unit}`:String(o.value)}function n(o){switch(o.status){case "value":return l(o.value);case "pending":return "a pending async value";case "error":return `an error (${o.code}: ${o.message})`}}var d=class{constructor(t,e){this.expression=t;this.outcome=e;}get value(){if(this.outcome.status==="error")throw new i({code:"EXPECTED_VALUE",message:`Expected "${this.expression}" to evaluate, but it failed with ${n(this.outcome)}.`,expected:"a resolved value",actual:n(this.outcome)});return this.outcome.value}toEvaluate(){if(this.outcome.status!=="value")throw new i({code:"EXPECTED_EVALUATE",message:`Expected "${this.expression}" to evaluate to a value, but got ${n(this.outcome)}.`,expected:"a resolved value",actual:n(this.outcome)});return this}toEqual(t,e){if(this.outcome.status!=="value")throw new i({code:"EXPECTED_EQUAL",message:`Expected "${this.expression}" to equal ${c(t,e)}, but got ${n(this.outcome)}.`,expected:c(t,e),actual:n(this.outcome)});let r=this.outcome.value,s;if(typeof t=="number"?s=x(r.toNumber(),t):typeof t=="boolean"?s=r.type===10&&r.value===t:s=C(r)===t,!s)throw new i({code:"EXPECTED_EQUAL",message:`Expected "${this.expression}" to equal ${c(t,e)}, but it was ${l(r)}.`,expected:c(t,e),actual:l(r)});if(e!==void 0&&r.unit!==e)throw new i({code:"EXPECTED_UNIT",message:`Expected "${this.expression}" to carry the unit "${e}", but it was ${r.unit===void 0?"unitless":`"${r.unit}"`}.`,expected:`unit "${e}"`,actual:r.unit===void 0?"no unit":`unit "${r.unit}"`});return this}toBeError(){if(this.outcome.status!=="error")throw new i({code:"EXPECTED_ERROR",message:`Expected "${this.expression}" to fail, but it produced ${n(this.outcome)}.`,expected:"an error",actual:n(this.outcome)});return this}toFailWith(t){if(this.outcome.status!=="error")throw new i({code:"EXPECTED_FAIL_WITH",message:`Expected "${this.expression}" to fail with "${t}", but it produced ${n(this.outcome)}.`,expected:`error code "${t}"`,actual:n(this.outcome)});if(this.outcome.code!==t)throw new i({code:"EXPECTED_FAIL_WITH",message:`Expected "${this.expression}" to fail with "${t}", but it failed with "${this.outcome.code}" (${this.outcome.message}).`,expected:`error code "${t}"`,actual:`error code "${this.outcome.code}"`});return this}toBePending(){if(this.outcome.status!=="pending")throw new i({code:"EXPECTED_PENDING",message:`Expected "${this.expression}" to be pending, but got ${n(this.outcome)}.`,expected:"a pending async value",actual:n(this.outcome)});return this}};function c(o,t){let e=typeof o=="string"?JSON.stringify(o):String(o);return t===void 0?e:`${e} ${t}`}function C(o){return String(o.value)}function D(o,t){return new d(t,v(o,t))}var O=["a","an","and","or","but","if","then","the","this","that","these","those","in","on","at","to","of","for","from","with","by","as","per","into","over","is","are","was","were","be","been","being","do","does","did","have","has","had","will","would","can","could","should","may","might","must","price","cost","value","total","sum","count","rate","amount","number","time","date","day","week","month","year","hour","minute","second","add","buy","sell","hold","make","take","give","get","set","run","up","down","out","off","all","some","any","no","not","more","less","one","two","three","first","last","next","each","every","here","there"],$=["error","warning","info"];function k(o){let t=[],e=o.lexerVocabulary;if(e?.keywords)for(let[r,s]of Object.entries(e.keywords))t.push({word:r,via:"keyword",tokenType:s});if(e?.units)for(let r of e.units)t.push({word:r,via:"unit"});if(e?.operators)for(let[r,s]of Object.entries(e.operators))t.push({word:r,via:"operator",tokenType:s});if(o.phrases)for(let[r,s]of Object.entries(o.phrases))r.includes(" ")||t.push({word:r,via:"phrase",tokenType:s});return t}var p=class{constructor(t){this.pkg=t;}notToShadow(t=O){let e=new Set(t.map(s=>s.toLowerCase())),r=k(this.pkg).filter(s=>e.has(s.word.toLowerCase()));if(r.length>0){let s=r.map(a=>`"${a.word}" (${a.via})`).join(", ");throw new i({code:"PACKAGE_SHADOWS_PROSE",message:`Package "${this.pkg.name}" claims prose word(s) as syntax: ${s}. A word that is also ordinary English turns prose into arithmetic; prefer a multi-word phrase or a form that requires a parenthesis.`,expected:"no prose words claimed as syntax",actual:s})}return r}notToCollideWith(t,e="error"){let r=chunk4J7XZSZJ_cjs.a(this.pkg,t),s=$.indexOf(e),a=r.conflicts.filter(u=>$.indexOf(u.severity)<=s);if(a.length>0){let u=a.map(g=>`[${g.severity}] ${g.detail}`).join(`
2
+ `);throw new i({code:"PACKAGE_VOCABULARY_COLLISION",message:`Package "${this.pkg.name}" collides with another package:
3
+ ${u}`,expected:`no conflicts at or above "${e}" severity`,actual:`${a.length} conflict(s)`})}return r}toDeclareCompatibleEngineVersion(t=chunkUDQ57ZRX_cjs.a){let e=chunk4J7XZSZJ_cjs.b(this.pkg,t);if(!e.compatible){let r=e.reason==="invalid-range"?`its range "${e.declaredRange}" is not valid semver`:`its range "${e.declaredRange}" is not satisfied by engine version "${e.engineVersion}"`;throw new i({code:"PACKAGE_ENGINE_VERSION_INCOMPATIBLE",message:`Package "${this.pkg.name}" declares an engineVersion that will be rejected at registration: ${r}.`,expected:`an engineVersion satisfied by "${t}"`,actual:`"${e.declaredRange}"`})}return this}};function L(o){return new p(o)}exports.COMMON_PROSE_WORDS=O;exports.ExpectationError=i;exports.ExpressionAssertion=d;exports.PackageAssertion=p;exports.createTestEngine=V;exports.expectExpression=D;exports.expectPackage=L;//# sourceMappingURL=testing.cjs.map
478
4
  //# sourceMappingURL=testing.cjs.map