pnpm 12.9.0 → 12.10.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 (607) hide show
  1. package/CHANGELOG.md +130 -0
  2. package/bin/pnpm.mjs +2 -3
  3. package/dist/node_modules/.bin/get-pnpm +10 -6
  4. package/dist/node_modules/.bin/node-gyp +10 -6
  5. package/dist/node_modules/.bin/node-which +10 -6
  6. package/dist/node_modules/.bin/nopt +10 -6
  7. package/dist/node_modules/.bin/semver +10 -6
  8. package/dist/node_modules/.pnpm-workspace-state-v1.json +14 -13
  9. package/install.js +8 -11
  10. package/package.json +15 -15
  11. package/pn +76 -2
  12. package/pnpm +98 -2
  13. package/pnpx +76 -2
  14. package/pnx +76 -2
  15. package/dist/wasm/LICENSE +0 -22
  16. package/dist/wasm/README.md +0 -140
  17. package/dist/wasm/THIRD-PARTY-NOTICES.md +0 -42
  18. package/dist/wasm/host/atomic-waits.mjs +0 -43
  19. package/dist/wasm/host/cancellation.mjs +0 -6
  20. package/dist/wasm/host/executable-mode.mjs +0 -8
  21. package/dist/wasm/host/file-locks.mjs +0 -40
  22. package/dist/wasm/host/filesystem.mjs +0 -318
  23. package/dist/wasm/host/guest-imports.mjs +0 -45
  24. package/dist/wasm/host/guest-operations.mjs +0 -148
  25. package/dist/wasm/host/lock-registry.mjs +0 -167
  26. package/dist/wasm/host/network.mjs +0 -76
  27. package/dist/wasm/host/operations.mjs +0 -67
  28. package/dist/wasm/host/poll.mjs +0 -74
  29. package/dist/wasm/host/process-stdio.mjs +0 -41
  30. package/dist/wasm/host/process-tree.mjs +0 -54
  31. package/dist/wasm/host/process.mjs +0 -126
  32. package/dist/wasm/host/protocol.mjs +0 -1
  33. package/dist/wasm/host/resources.mjs +0 -76
  34. package/dist/wasm/host/shell-runner.mjs +0 -8
  35. package/dist/wasm/host/shell.mjs +0 -19
  36. package/dist/wasm/host/signals.mjs +0 -49
  37. package/dist/wasm/host/terminal-input.mjs +0 -7
  38. package/dist/wasm/host/terminal-password.mjs +0 -32
  39. package/dist/wasm/host/terminal-session.mjs +0 -114
  40. package/dist/wasm/host/terminal.mjs +0 -61
  41. package/dist/wasm/host/thread-spawn.mjs +0 -21
  42. package/dist/wasm/host/upload.mjs +0 -21
  43. package/dist/wasm/host/wait-for-reply.mjs +0 -7
  44. package/dist/wasm/host/wasi-errno.mjs +0 -81
  45. package/dist/wasm/host/wasi-imports.mjs +0 -58
  46. package/dist/wasm/node_modules/.bin/js-yaml +0 -91
  47. package/dist/wasm/node_modules/.bin/node-which +0 -91
  48. package/dist/wasm/node_modules/.bin/shell +0 -91
  49. package/dist/wasm/node_modules/.pnpm-workspace-state-v1.json +0 -355
  50. package/dist/wasm/node_modules/@emnapi/wasi-threads/LICENSE +0 -21
  51. package/dist/wasm/node_modules/@emnapi/wasi-threads/README.md +0 -203
  52. package/dist/wasm/node_modules/@emnapi/wasi-threads/dist/wasi-threads.cjs.js +0 -894
  53. package/dist/wasm/node_modules/@emnapi/wasi-threads/dist/wasi-threads.cjs.min.d.ts +0 -272
  54. package/dist/wasm/node_modules/@emnapi/wasi-threads/dist/wasi-threads.cjs.min.js +0 -1
  55. package/dist/wasm/node_modules/@emnapi/wasi-threads/dist/wasi-threads.d.mts +0 -272
  56. package/dist/wasm/node_modules/@emnapi/wasi-threads/dist/wasi-threads.d.ts +0 -274
  57. package/dist/wasm/node_modules/@emnapi/wasi-threads/dist/wasi-threads.esm-bundler.js +0 -942
  58. package/dist/wasm/node_modules/@emnapi/wasi-threads/dist/wasi-threads.js +0 -954
  59. package/dist/wasm/node_modules/@emnapi/wasi-threads/dist/wasi-threads.min.d.mts +0 -272
  60. package/dist/wasm/node_modules/@emnapi/wasi-threads/dist/wasi-threads.min.js +0 -1
  61. package/dist/wasm/node_modules/@emnapi/wasi-threads/dist/wasi-threads.min.mjs +0 -1
  62. package/dist/wasm/node_modules/@emnapi/wasi-threads/dist/wasi-threads.mjs +0 -889
  63. package/dist/wasm/node_modules/@emnapi/wasi-threads/index.js +0 -5
  64. package/dist/wasm/node_modules/@emnapi/wasi-threads/package.json +0 -50
  65. package/dist/wasm/node_modules/@nodelib/fs.scandir/LICENSE +0 -21
  66. package/dist/wasm/node_modules/@nodelib/fs.scandir/README.md +0 -171
  67. package/dist/wasm/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts +0 -20
  68. package/dist/wasm/node_modules/@nodelib/fs.scandir/out/adapters/fs.js +0 -19
  69. package/dist/wasm/node_modules/@nodelib/fs.scandir/out/constants.d.ts +0 -4
  70. package/dist/wasm/node_modules/@nodelib/fs.scandir/out/constants.js +0 -17
  71. package/dist/wasm/node_modules/@nodelib/fs.scandir/out/index.d.ts +0 -12
  72. package/dist/wasm/node_modules/@nodelib/fs.scandir/out/index.js +0 -26
  73. package/dist/wasm/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts +0 -7
  74. package/dist/wasm/node_modules/@nodelib/fs.scandir/out/providers/async.js +0 -104
  75. package/dist/wasm/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts +0 -1
  76. package/dist/wasm/node_modules/@nodelib/fs.scandir/out/providers/common.js +0 -13
  77. package/dist/wasm/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts +0 -5
  78. package/dist/wasm/node_modules/@nodelib/fs.scandir/out/providers/sync.js +0 -54
  79. package/dist/wasm/node_modules/@nodelib/fs.scandir/out/settings.d.ts +0 -20
  80. package/dist/wasm/node_modules/@nodelib/fs.scandir/out/settings.js +0 -24
  81. package/dist/wasm/node_modules/@nodelib/fs.scandir/out/types/index.d.ts +0 -20
  82. package/dist/wasm/node_modules/@nodelib/fs.scandir/out/types/index.js +0 -2
  83. package/dist/wasm/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts +0 -2
  84. package/dist/wasm/node_modules/@nodelib/fs.scandir/out/utils/fs.js +0 -19
  85. package/dist/wasm/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts +0 -2
  86. package/dist/wasm/node_modules/@nodelib/fs.scandir/out/utils/index.js +0 -5
  87. package/dist/wasm/node_modules/@nodelib/fs.scandir/package.json +0 -44
  88. package/dist/wasm/node_modules/@nodelib/fs.stat/LICENSE +0 -21
  89. package/dist/wasm/node_modules/@nodelib/fs.stat/README.md +0 -126
  90. package/dist/wasm/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts +0 -13
  91. package/dist/wasm/node_modules/@nodelib/fs.stat/out/adapters/fs.js +0 -17
  92. package/dist/wasm/node_modules/@nodelib/fs.stat/out/index.d.ts +0 -12
  93. package/dist/wasm/node_modules/@nodelib/fs.stat/out/index.js +0 -26
  94. package/dist/wasm/node_modules/@nodelib/fs.stat/out/providers/async.d.ts +0 -4
  95. package/dist/wasm/node_modules/@nodelib/fs.stat/out/providers/async.js +0 -36
  96. package/dist/wasm/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts +0 -3
  97. package/dist/wasm/node_modules/@nodelib/fs.stat/out/providers/sync.js +0 -23
  98. package/dist/wasm/node_modules/@nodelib/fs.stat/out/settings.d.ts +0 -16
  99. package/dist/wasm/node_modules/@nodelib/fs.stat/out/settings.js +0 -16
  100. package/dist/wasm/node_modules/@nodelib/fs.stat/out/types/index.d.ts +0 -4
  101. package/dist/wasm/node_modules/@nodelib/fs.stat/out/types/index.js +0 -2
  102. package/dist/wasm/node_modules/@nodelib/fs.stat/package.json +0 -37
  103. package/dist/wasm/node_modules/@nodelib/fs.walk/LICENSE +0 -21
  104. package/dist/wasm/node_modules/@nodelib/fs.walk/README.md +0 -215
  105. package/dist/wasm/node_modules/@nodelib/fs.walk/out/index.d.ts +0 -14
  106. package/dist/wasm/node_modules/@nodelib/fs.walk/out/index.js +0 -34
  107. package/dist/wasm/node_modules/@nodelib/fs.walk/out/providers/async.d.ts +0 -12
  108. package/dist/wasm/node_modules/@nodelib/fs.walk/out/providers/async.js +0 -30
  109. package/dist/wasm/node_modules/@nodelib/fs.walk/out/providers/index.d.ts +0 -4
  110. package/dist/wasm/node_modules/@nodelib/fs.walk/out/providers/index.js +0 -9
  111. package/dist/wasm/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts +0 -12
  112. package/dist/wasm/node_modules/@nodelib/fs.walk/out/providers/stream.js +0 -34
  113. package/dist/wasm/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts +0 -10
  114. package/dist/wasm/node_modules/@nodelib/fs.walk/out/providers/sync.js +0 -14
  115. package/dist/wasm/node_modules/@nodelib/fs.walk/out/readers/async.d.ts +0 -30
  116. package/dist/wasm/node_modules/@nodelib/fs.walk/out/readers/async.js +0 -97
  117. package/dist/wasm/node_modules/@nodelib/fs.walk/out/readers/common.d.ts +0 -7
  118. package/dist/wasm/node_modules/@nodelib/fs.walk/out/readers/common.js +0 -31
  119. package/dist/wasm/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts +0 -6
  120. package/dist/wasm/node_modules/@nodelib/fs.walk/out/readers/reader.js +0 -11
  121. package/dist/wasm/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts +0 -15
  122. package/dist/wasm/node_modules/@nodelib/fs.walk/out/readers/sync.js +0 -59
  123. package/dist/wasm/node_modules/@nodelib/fs.walk/out/settings.d.ts +0 -30
  124. package/dist/wasm/node_modules/@nodelib/fs.walk/out/settings.js +0 -26
  125. package/dist/wasm/node_modules/@nodelib/fs.walk/out/types/index.d.ts +0 -8
  126. package/dist/wasm/node_modules/@nodelib/fs.walk/out/types/index.js +0 -2
  127. package/dist/wasm/node_modules/@nodelib/fs.walk/package.json +0 -44
  128. package/dist/wasm/node_modules/@tybys/wasm-util/LICENSE +0 -21
  129. package/dist/wasm/node_modules/@tybys/wasm-util/README.md +0 -193
  130. package/dist/wasm/node_modules/@tybys/wasm-util/dist/tsdoc-metadata.json +0 -11
  131. package/dist/wasm/node_modules/@tybys/wasm-util/dist/wasm-util.d.ts +0 -423
  132. package/dist/wasm/node_modules/@tybys/wasm-util/dist/wasm-util.esm-bundler.js +0 -2932
  133. package/dist/wasm/node_modules/@tybys/wasm-util/dist/wasm-util.esm.js +0 -2932
  134. package/dist/wasm/node_modules/@tybys/wasm-util/dist/wasm-util.esm.min.js +0 -1
  135. package/dist/wasm/node_modules/@tybys/wasm-util/dist/wasm-util.js +0 -2954
  136. package/dist/wasm/node_modules/@tybys/wasm-util/dist/wasm-util.min.js +0 -1
  137. package/dist/wasm/node_modules/@tybys/wasm-util/lib/cjs/asyncify.js +0 -158
  138. package/dist/wasm/node_modules/@tybys/wasm-util/lib/cjs/index.js +0 -13
  139. package/dist/wasm/node_modules/@tybys/wasm-util/lib/cjs/jspi.js +0 -46
  140. package/dist/wasm/node_modules/@tybys/wasm-util/lib/cjs/load.js +0 -97
  141. package/dist/wasm/node_modules/@tybys/wasm-util/lib/cjs/memory.js +0 -35
  142. package/dist/wasm/node_modules/@tybys/wasm-util/lib/cjs/wasi/error.js +0 -103
  143. package/dist/wasm/node_modules/@tybys/wasm-util/lib/cjs/wasi/fd.js +0 -268
  144. package/dist/wasm/node_modules/@tybys/wasm-util/lib/cjs/wasi/fs.js +0 -3
  145. package/dist/wasm/node_modules/@tybys/wasm-util/lib/cjs/wasi/index.js +0 -192
  146. package/dist/wasm/node_modules/@tybys/wasm-util/lib/cjs/wasi/path.js +0 -316
  147. package/dist/wasm/node_modules/@tybys/wasm-util/lib/cjs/wasi/preview1.js +0 -1599
  148. package/dist/wasm/node_modules/@tybys/wasm-util/lib/cjs/wasi/rights.js +0 -141
  149. package/dist/wasm/node_modules/@tybys/wasm-util/lib/cjs/wasi/types.js +0 -220
  150. package/dist/wasm/node_modules/@tybys/wasm-util/lib/cjs/wasi/util.js +0 -128
  151. package/dist/wasm/node_modules/@tybys/wasm-util/lib/cjs/webassembly.js +0 -13
  152. package/dist/wasm/node_modules/@tybys/wasm-util/lib/mjs/asyncify.mjs +0 -153
  153. package/dist/wasm/node_modules/@tybys/wasm-util/lib/mjs/index.mjs +0 -9
  154. package/dist/wasm/node_modules/@tybys/wasm-util/lib/mjs/jspi.mjs +0 -39
  155. package/dist/wasm/node_modules/@tybys/wasm-util/lib/mjs/load.mjs +0 -89
  156. package/dist/wasm/node_modules/@tybys/wasm-util/lib/mjs/memory.mjs +0 -28
  157. package/dist/wasm/node_modules/@tybys/wasm-util/lib/mjs/wasi/error.mjs +0 -97
  158. package/dist/wasm/node_modules/@tybys/wasm-util/lib/mjs/wasi/fd.mjs +0 -256
  159. package/dist/wasm/node_modules/@tybys/wasm-util/lib/mjs/wasi/fs.mjs +0 -1
  160. package/dist/wasm/node_modules/@tybys/wasm-util/lib/mjs/wasi/index.mjs +0 -186
  161. package/dist/wasm/node_modules/@tybys/wasm-util/lib/mjs/wasi/path.mjs +0 -310
  162. package/dist/wasm/node_modules/@tybys/wasm-util/lib/mjs/wasi/preview1.mjs +0 -1593
  163. package/dist/wasm/node_modules/@tybys/wasm-util/lib/mjs/wasi/rights.mjs +0 -135
  164. package/dist/wasm/node_modules/@tybys/wasm-util/lib/mjs/wasi/types.mjs +0 -216
  165. package/dist/wasm/node_modules/@tybys/wasm-util/lib/mjs/wasi/util.mjs +0 -113
  166. package/dist/wasm/node_modules/@tybys/wasm-util/lib/mjs/webassembly.mjs +0 -9
  167. package/dist/wasm/node_modules/@tybys/wasm-util/package.json +0 -58
  168. package/dist/wasm/node_modules/@types/braces/LICENSE +0 -21
  169. package/dist/wasm/node_modules/@types/braces/README.md +0 -15
  170. package/dist/wasm/node_modules/@types/braces/index.d.ts +0 -100
  171. package/dist/wasm/node_modules/@types/braces/package.json +0 -36
  172. package/dist/wasm/node_modules/@types/micromatch/LICENSE +0 -21
  173. package/dist/wasm/node_modules/@types/micromatch/README.md +0 -15
  174. package/dist/wasm/node_modules/@types/micromatch/index.d.ts +0 -670
  175. package/dist/wasm/node_modules/@types/micromatch/package.json +0 -28
  176. package/dist/wasm/node_modules/@yarnpkg/fslib/README.md +0 -17
  177. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/AliasFS.d.ts +0 -16
  178. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/AliasFS.js +0 -24
  179. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/CwdFS.d.ts +0 -15
  180. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/CwdFS.js +0 -36
  181. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/FakeFS.d.ts +0 -398
  182. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/FakeFS.js +0 -451
  183. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/JailFS.d.ts +0 -16
  184. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/JailFS.js +0 -35
  185. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/LazyFS.d.ts +0 -13
  186. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/LazyFS.js +0 -26
  187. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/MountFS.d.ts +0 -278
  188. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/MountFS.js +0 -873
  189. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/NoFS.d.ts +0 -78
  190. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/NoFS.js +0 -229
  191. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/NodeFS.d.ts +0 -223
  192. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/NodeFS.js +0 -476
  193. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/NodePathFS.d.ts +0 -18
  194. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/NodePathFS.js +0 -47
  195. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/PosixFS.d.ts +0 -9
  196. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/PosixFS.js +0 -18
  197. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/ProxiedFS.d.ts +0 -229
  198. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/ProxiedFS.js +0 -255
  199. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/VirtualFS.d.ts +0 -19
  200. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/VirtualFS.js +0 -89
  201. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/algorithms/copyPromise.d.ts +0 -19
  202. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/algorithms/copyPromise.js +0 -271
  203. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/algorithms/opendir.d.ts +0 -22
  204. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/algorithms/opendir.js +0 -65
  205. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/algorithms/watchFile/CustomStatWatcher.d.ts +0 -59
  206. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/algorithms/watchFile/CustomStatWatcher.js +0 -139
  207. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/algorithms/watchFile.d.ts +0 -6
  208. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/algorithms/watchFile.js +0 -67
  209. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/constants.d.ts +0 -13
  210. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/constants.js +0 -16
  211. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/errors.d.ts +0 -36
  212. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/errors.js +0 -54
  213. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/index.d.ts +0 -48
  214. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/index.js +0 -55
  215. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/patchFs/FileHandle.d.ts +0 -81
  216. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/patchFs/FileHandle.js +0 -254
  217. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/patchFs/patchFs.d.ts +0 -5
  218. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/patchFs/patchFs.js +0 -265
  219. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/path.d.ts +0 -84
  220. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/path.js +0 -103
  221. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/statUtils.d.ts +0 -81
  222. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/statUtils.js +0 -238
  223. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/xfs.d.ts +0 -18
  224. package/dist/wasm/node_modules/@yarnpkg/fslib/lib/xfs.js +0 -123
  225. package/dist/wasm/node_modules/@yarnpkg/fslib/package.json +0 -42
  226. package/dist/wasm/node_modules/@yarnpkg/parsers/lib/grammars/resolution.d.ts +0 -1
  227. package/dist/wasm/node_modules/@yarnpkg/parsers/lib/grammars/resolution.js +0 -530
  228. package/dist/wasm/node_modules/@yarnpkg/parsers/lib/grammars/resolution.pegjs +0 -17
  229. package/dist/wasm/node_modules/@yarnpkg/parsers/lib/grammars/shell.d.ts +0 -92
  230. package/dist/wasm/node_modules/@yarnpkg/parsers/lib/grammars/shell.js +0 -3653
  231. package/dist/wasm/node_modules/@yarnpkg/parsers/lib/grammars/shell.pegjs +0 -189
  232. package/dist/wasm/node_modules/@yarnpkg/parsers/lib/grammars/syml.d.ts +0 -1
  233. package/dist/wasm/node_modules/@yarnpkg/parsers/lib/grammars/syml.js +0 -1911
  234. package/dist/wasm/node_modules/@yarnpkg/parsers/lib/grammars/syml.pegjs +0 -125
  235. package/dist/wasm/node_modules/@yarnpkg/parsers/lib/index.d.ts +0 -6
  236. package/dist/wasm/node_modules/@yarnpkg/parsers/lib/index.js +0 -24
  237. package/dist/wasm/node_modules/@yarnpkg/parsers/lib/resolution.d.ts +0 -12
  238. package/dist/wasm/node_modules/@yarnpkg/parsers/lib/resolution.js +0 -31
  239. package/dist/wasm/node_modules/@yarnpkg/parsers/lib/shell.d.ts +0 -19
  240. package/dist/wasm/node_modules/@yarnpkg/parsers/lib/shell.js +0 -170
  241. package/dist/wasm/node_modules/@yarnpkg/parsers/lib/syml.d.ts +0 -11
  242. package/dist/wasm/node_modules/@yarnpkg/parsers/lib/syml.js +0 -132
  243. package/dist/wasm/node_modules/@yarnpkg/parsers/package.json +0 -46
  244. package/dist/wasm/node_modules/@yarnpkg/shell/README.md +0 -38
  245. package/dist/wasm/node_modules/@yarnpkg/shell/lib/boot-cli-dev.js +0 -3
  246. package/dist/wasm/node_modules/@yarnpkg/shell/lib/cli.d.ts +0 -2
  247. package/dist/wasm/node_modules/@yarnpkg/shell/lib/cli.js +0 -19
  248. package/dist/wasm/node_modules/@yarnpkg/shell/lib/commands/entry.d.ts +0 -8
  249. package/dist/wasm/node_modules/@yarnpkg/shell/lib/commands/entry.js +0 -60
  250. package/dist/wasm/node_modules/@yarnpkg/shell/lib/errors.d.ts +0 -6
  251. package/dist/wasm/node_modules/@yarnpkg/shell/lib/errors.js +0 -13
  252. package/dist/wasm/node_modules/@yarnpkg/shell/lib/globUtils.d.ts +0 -23
  253. package/dist/wasm/node_modules/@yarnpkg/shell/lib/globUtils.js +0 -47
  254. package/dist/wasm/node_modules/@yarnpkg/shell/lib/index.d.ts +0 -56
  255. package/dist/wasm/node_modules/@yarnpkg/shell/lib/index.js +0 -926
  256. package/dist/wasm/node_modules/@yarnpkg/shell/lib/pipe.d.ts +0 -54
  257. package/dist/wasm/node_modules/@yarnpkg/shell/lib/pipe.js +0 -281
  258. package/dist/wasm/node_modules/@yarnpkg/shell/package.json +0 -54
  259. package/dist/wasm/node_modules/ansi-styles/index.d.ts +0 -345
  260. package/dist/wasm/node_modules/ansi-styles/index.js +0 -163
  261. package/dist/wasm/node_modules/ansi-styles/license +0 -9
  262. package/dist/wasm/node_modules/ansi-styles/package.json +0 -56
  263. package/dist/wasm/node_modules/ansi-styles/readme.md +0 -152
  264. package/dist/wasm/node_modules/argparse/CHANGELOG.md +0 -216
  265. package/dist/wasm/node_modules/argparse/LICENSE +0 -254
  266. package/dist/wasm/node_modules/argparse/README.md +0 -84
  267. package/dist/wasm/node_modules/argparse/argparse.js +0 -3707
  268. package/dist/wasm/node_modules/argparse/lib/sub.js +0 -67
  269. package/dist/wasm/node_modules/argparse/lib/textwrap.js +0 -440
  270. package/dist/wasm/node_modules/argparse/package.json +0 -31
  271. package/dist/wasm/node_modules/braces/LICENSE +0 -21
  272. package/dist/wasm/node_modules/braces/README.md +0 -586
  273. package/dist/wasm/node_modules/braces/index.js +0 -170
  274. package/dist/wasm/node_modules/braces/lib/compile.js +0 -60
  275. package/dist/wasm/node_modules/braces/lib/constants.js +0 -57
  276. package/dist/wasm/node_modules/braces/lib/expand.js +0 -113
  277. package/dist/wasm/node_modules/braces/lib/parse.js +0 -331
  278. package/dist/wasm/node_modules/braces/lib/stringify.js +0 -32
  279. package/dist/wasm/node_modules/braces/lib/utils.js +0 -122
  280. package/dist/wasm/node_modules/braces/package.json +0 -77
  281. package/dist/wasm/node_modules/chalk/index.d.ts +0 -415
  282. package/dist/wasm/node_modules/chalk/license +0 -9
  283. package/dist/wasm/node_modules/chalk/package.json +0 -68
  284. package/dist/wasm/node_modules/chalk/readme.md +0 -341
  285. package/dist/wasm/node_modules/chalk/source/index.js +0 -229
  286. package/dist/wasm/node_modules/chalk/source/templates.js +0 -134
  287. package/dist/wasm/node_modules/chalk/source/util.js +0 -39
  288. package/dist/wasm/node_modules/clipanion/README.md +0 -98
  289. package/dist/wasm/node_modules/clipanion/lib/advanced/Cli.d.ts +0 -225
  290. package/dist/wasm/node_modules/clipanion/lib/advanced/Cli.js +0 -406
  291. package/dist/wasm/node_modules/clipanion/lib/advanced/Cli.mjs +0 -398
  292. package/dist/wasm/node_modules/clipanion/lib/advanced/Command.d.ts +0 -144
  293. package/dist/wasm/node_modules/clipanion/lib/advanced/Command.js +0 -91
  294. package/dist/wasm/node_modules/clipanion/lib/advanced/Command.mjs +0 -67
  295. package/dist/wasm/node_modules/clipanion/lib/advanced/HelpCommand.d.ts +0 -11
  296. package/dist/wasm/node_modules/clipanion/lib/advanced/HelpCommand.js +0 -54
  297. package/dist/wasm/node_modules/clipanion/lib/advanced/HelpCommand.mjs +0 -50
  298. package/dist/wasm/node_modules/clipanion/lib/advanced/builtins/definitions.d.ts +0 -8
  299. package/dist/wasm/node_modules/clipanion/lib/advanced/builtins/definitions.js +0 -17
  300. package/dist/wasm/node_modules/clipanion/lib/advanced/builtins/definitions.mjs +0 -13
  301. package/dist/wasm/node_modules/clipanion/lib/advanced/builtins/help.d.ts +0 -10
  302. package/dist/wasm/node_modules/clipanion/lib/advanced/builtins/help.js +0 -19
  303. package/dist/wasm/node_modules/clipanion/lib/advanced/builtins/help.mjs +0 -15
  304. package/dist/wasm/node_modules/clipanion/lib/advanced/builtins/index.d.ts +0 -3
  305. package/dist/wasm/node_modules/clipanion/lib/advanced/builtins/index.js +0 -13
  306. package/dist/wasm/node_modules/clipanion/lib/advanced/builtins/index.mjs +0 -3
  307. package/dist/wasm/node_modules/clipanion/lib/advanced/builtins/version.d.ts +0 -10
  308. package/dist/wasm/node_modules/clipanion/lib/advanced/builtins/version.js +0 -20
  309. package/dist/wasm/node_modules/clipanion/lib/advanced/builtins/version.mjs +0 -16
  310. package/dist/wasm/node_modules/clipanion/lib/advanced/index.d.ts +0 -7
  311. package/dist/wasm/node_modules/clipanion/lib/advanced/index.js +0 -19
  312. package/dist/wasm/node_modules/clipanion/lib/advanced/index.mjs +0 -8
  313. package/dist/wasm/node_modules/clipanion/lib/advanced/options/Array.d.ts +0 -17
  314. package/dist/wasm/node_modules/clipanion/lib/advanced/options/Array.js +0 -37
  315. package/dist/wasm/node_modules/clipanion/lib/advanced/options/Array.mjs +0 -33
  316. package/dist/wasm/node_modules/clipanion/lib/advanced/options/Boolean.d.ts +0 -14
  317. package/dist/wasm/node_modules/clipanion/lib/advanced/options/Boolean.js +0 -34
  318. package/dist/wasm/node_modules/clipanion/lib/advanced/options/Boolean.mjs +0 -30
  319. package/dist/wasm/node_modules/clipanion/lib/advanced/options/Counter.d.ts +0 -15
  320. package/dist/wasm/node_modules/clipanion/lib/advanced/options/Counter.js +0 -41
  321. package/dist/wasm/node_modules/clipanion/lib/advanced/options/Counter.mjs +0 -37
  322. package/dist/wasm/node_modules/clipanion/lib/advanced/options/Proxy.d.ts +0 -18
  323. package/dist/wasm/node_modules/clipanion/lib/advanced/options/Proxy.js +0 -35
  324. package/dist/wasm/node_modules/clipanion/lib/advanced/options/Proxy.mjs +0 -31
  325. package/dist/wasm/node_modules/clipanion/lib/advanced/options/Rest.d.ts +0 -18
  326. package/dist/wasm/node_modules/clipanion/lib/advanced/options/Rest.js +0 -51
  327. package/dist/wasm/node_modules/clipanion/lib/advanced/options/Rest.mjs +0 -47
  328. package/dist/wasm/node_modules/clipanion/lib/advanced/options/String.d.ts +0 -49
  329. package/dist/wasm/node_modules/clipanion/lib/advanced/options/String.js +0 -84
  330. package/dist/wasm/node_modules/clipanion/lib/advanced/options/String.mjs +0 -80
  331. package/dist/wasm/node_modules/clipanion/lib/advanced/options/index.d.ts +0 -7
  332. package/dist/wasm/node_modules/clipanion/lib/advanced/options/index.js +0 -26
  333. package/dist/wasm/node_modules/clipanion/lib/advanced/options/index.mjs +0 -7
  334. package/dist/wasm/node_modules/clipanion/lib/advanced/options/utils.d.ts +0 -25
  335. package/dist/wasm/node_modules/clipanion/lib/advanced/options/utils.js +0 -59
  336. package/dist/wasm/node_modules/clipanion/lib/advanced/options/utils.mjs +0 -50
  337. package/dist/wasm/node_modules/clipanion/lib/constants.d.ts +0 -11
  338. package/dist/wasm/node_modules/clipanion/lib/constants.js +0 -27
  339. package/dist/wasm/node_modules/clipanion/lib/constants.mjs +0 -13
  340. package/dist/wasm/node_modules/clipanion/lib/core.d.ts +0 -462
  341. package/dist/wasm/node_modules/clipanion/lib/core.js +0 -827
  342. package/dist/wasm/node_modules/clipanion/lib/core.mjs +0 -800
  343. package/dist/wasm/node_modules/clipanion/lib/demos/advanced.d.ts +0 -22
  344. package/dist/wasm/node_modules/clipanion/lib/errors.d.ts +0 -52
  345. package/dist/wasm/node_modules/clipanion/lib/errors.js +0 -70
  346. package/dist/wasm/node_modules/clipanion/lib/errors.mjs +0 -64
  347. package/dist/wasm/node_modules/clipanion/lib/format.d.ts +0 -19
  348. package/dist/wasm/node_modules/clipanion/lib/format.js +0 -74
  349. package/dist/wasm/node_modules/clipanion/lib/format.mjs +0 -68
  350. package/dist/wasm/node_modules/clipanion/package.json +0 -68
  351. package/dist/wasm/node_modules/color-convert/CHANGELOG.md +0 -54
  352. package/dist/wasm/node_modules/color-convert/LICENSE +0 -21
  353. package/dist/wasm/node_modules/color-convert/README.md +0 -68
  354. package/dist/wasm/node_modules/color-convert/conversions.js +0 -839
  355. package/dist/wasm/node_modules/color-convert/index.js +0 -81
  356. package/dist/wasm/node_modules/color-convert/package.json +0 -48
  357. package/dist/wasm/node_modules/color-convert/route.js +0 -97
  358. package/dist/wasm/node_modules/color-name/LICENSE +0 -8
  359. package/dist/wasm/node_modules/color-name/README.md +0 -11
  360. package/dist/wasm/node_modules/color-name/index.js +0 -152
  361. package/dist/wasm/node_modules/color-name/package.json +0 -28
  362. package/dist/wasm/node_modules/cross-spawn/LICENSE +0 -21
  363. package/dist/wasm/node_modules/cross-spawn/README.md +0 -89
  364. package/dist/wasm/node_modules/cross-spawn/index.js +0 -39
  365. package/dist/wasm/node_modules/cross-spawn/lib/enoent.js +0 -59
  366. package/dist/wasm/node_modules/cross-spawn/lib/parse.js +0 -91
  367. package/dist/wasm/node_modules/cross-spawn/lib/util/escape.js +0 -47
  368. package/dist/wasm/node_modules/cross-spawn/lib/util/readShebang.js +0 -23
  369. package/dist/wasm/node_modules/cross-spawn/lib/util/resolveCommand.js +0 -52
  370. package/dist/wasm/node_modules/cross-spawn/package.json +0 -73
  371. package/dist/wasm/node_modules/fast-glob/LICENSE +0 -21
  372. package/dist/wasm/node_modules/fast-glob/README.md +0 -830
  373. package/dist/wasm/node_modules/fast-glob/out/index.d.ts +0 -40
  374. package/dist/wasm/node_modules/fast-glob/out/index.js +0 -102
  375. package/dist/wasm/node_modules/fast-glob/out/managers/tasks.d.ts +0 -22
  376. package/dist/wasm/node_modules/fast-glob/out/managers/tasks.js +0 -110
  377. package/dist/wasm/node_modules/fast-glob/out/providers/async.d.ts +0 -9
  378. package/dist/wasm/node_modules/fast-glob/out/providers/async.js +0 -23
  379. package/dist/wasm/node_modules/fast-glob/out/providers/filters/deep.d.ts +0 -16
  380. package/dist/wasm/node_modules/fast-glob/out/providers/filters/deep.js +0 -62
  381. package/dist/wasm/node_modules/fast-glob/out/providers/filters/entry.d.ts +0 -17
  382. package/dist/wasm/node_modules/fast-glob/out/providers/filters/entry.js +0 -85
  383. package/dist/wasm/node_modules/fast-glob/out/providers/filters/error.d.ts +0 -8
  384. package/dist/wasm/node_modules/fast-glob/out/providers/filters/error.js +0 -15
  385. package/dist/wasm/node_modules/fast-glob/out/providers/matchers/matcher.d.ts +0 -33
  386. package/dist/wasm/node_modules/fast-glob/out/providers/matchers/matcher.js +0 -45
  387. package/dist/wasm/node_modules/fast-glob/out/providers/matchers/partial.d.ts +0 -4
  388. package/dist/wasm/node_modules/fast-glob/out/providers/matchers/partial.js +0 -38
  389. package/dist/wasm/node_modules/fast-glob/out/providers/provider.d.ts +0 -19
  390. package/dist/wasm/node_modules/fast-glob/out/providers/provider.js +0 -48
  391. package/dist/wasm/node_modules/fast-glob/out/providers/stream.d.ts +0 -11
  392. package/dist/wasm/node_modules/fast-glob/out/providers/stream.js +0 -31
  393. package/dist/wasm/node_modules/fast-glob/out/providers/sync.d.ts +0 -9
  394. package/dist/wasm/node_modules/fast-glob/out/providers/sync.js +0 -23
  395. package/dist/wasm/node_modules/fast-glob/out/providers/transformers/entry.d.ts +0 -8
  396. package/dist/wasm/node_modules/fast-glob/out/providers/transformers/entry.js +0 -26
  397. package/dist/wasm/node_modules/fast-glob/out/readers/async.d.ts +0 -10
  398. package/dist/wasm/node_modules/fast-glob/out/readers/async.js +0 -35
  399. package/dist/wasm/node_modules/fast-glob/out/readers/reader.d.ts +0 -15
  400. package/dist/wasm/node_modules/fast-glob/out/readers/reader.js +0 -33
  401. package/dist/wasm/node_modules/fast-glob/out/readers/stream.d.ts +0 -14
  402. package/dist/wasm/node_modules/fast-glob/out/readers/stream.js +0 -55
  403. package/dist/wasm/node_modules/fast-glob/out/readers/sync.d.ts +0 -12
  404. package/dist/wasm/node_modules/fast-glob/out/readers/sync.js +0 -43
  405. package/dist/wasm/node_modules/fast-glob/out/settings.d.ts +0 -164
  406. package/dist/wasm/node_modules/fast-glob/out/settings.js +0 -59
  407. package/dist/wasm/node_modules/fast-glob/out/types/index.d.ts +0 -31
  408. package/dist/wasm/node_modules/fast-glob/out/types/index.js +0 -2
  409. package/dist/wasm/node_modules/fast-glob/out/utils/array.d.ts +0 -2
  410. package/dist/wasm/node_modules/fast-glob/out/utils/array.js +0 -22
  411. package/dist/wasm/node_modules/fast-glob/out/utils/errno.d.ts +0 -2
  412. package/dist/wasm/node_modules/fast-glob/out/utils/errno.js +0 -7
  413. package/dist/wasm/node_modules/fast-glob/out/utils/fs.d.ts +0 -4
  414. package/dist/wasm/node_modules/fast-glob/out/utils/fs.js +0 -19
  415. package/dist/wasm/node_modules/fast-glob/out/utils/index.d.ts +0 -8
  416. package/dist/wasm/node_modules/fast-glob/out/utils/index.js +0 -17
  417. package/dist/wasm/node_modules/fast-glob/out/utils/path.d.ts +0 -13
  418. package/dist/wasm/node_modules/fast-glob/out/utils/path.js +0 -68
  419. package/dist/wasm/node_modules/fast-glob/out/utils/pattern.d.ts +0 -49
  420. package/dist/wasm/node_modules/fast-glob/out/utils/pattern.js +0 -206
  421. package/dist/wasm/node_modules/fast-glob/out/utils/stream.d.ts +0 -4
  422. package/dist/wasm/node_modules/fast-glob/out/utils/stream.js +0 -17
  423. package/dist/wasm/node_modules/fast-glob/out/utils/string.d.ts +0 -2
  424. package/dist/wasm/node_modules/fast-glob/out/utils/string.js +0 -11
  425. package/dist/wasm/node_modules/fast-glob/package.json +0 -81
  426. package/dist/wasm/node_modules/fastq/LICENSE +0 -13
  427. package/dist/wasm/node_modules/fastq/README.md +0 -310
  428. package/dist/wasm/node_modules/fastq/SECURITY.md +0 -15
  429. package/dist/wasm/node_modules/fastq/bench.js +0 -66
  430. package/dist/wasm/node_modules/fastq/eslint.config.js +0 -11
  431. package/dist/wasm/node_modules/fastq/example.js +0 -14
  432. package/dist/wasm/node_modules/fastq/example.mjs +0 -9
  433. package/dist/wasm/node_modules/fastq/index.d.ts +0 -59
  434. package/dist/wasm/node_modules/fastq/package.json +0 -49
  435. package/dist/wasm/node_modules/fastq/queue.js +0 -348
  436. package/dist/wasm/node_modules/fastq/test/example.ts +0 -83
  437. package/dist/wasm/node_modules/fastq/test/promise.js +0 -356
  438. package/dist/wasm/node_modules/fastq/test/test.js +0 -808
  439. package/dist/wasm/node_modules/fastq/test/tsconfig.json +0 -11
  440. package/dist/wasm/node_modules/fill-range/LICENSE +0 -21
  441. package/dist/wasm/node_modules/fill-range/README.md +0 -237
  442. package/dist/wasm/node_modules/fill-range/index.js +0 -248
  443. package/dist/wasm/node_modules/fill-range/package.json +0 -74
  444. package/dist/wasm/node_modules/glob-parent/CHANGELOG.md +0 -110
  445. package/dist/wasm/node_modules/glob-parent/LICENSE +0 -15
  446. package/dist/wasm/node_modules/glob-parent/README.md +0 -137
  447. package/dist/wasm/node_modules/glob-parent/index.js +0 -42
  448. package/dist/wasm/node_modules/glob-parent/package.json +0 -48
  449. package/dist/wasm/node_modules/has-flag/index.d.ts +0 -39
  450. package/dist/wasm/node_modules/has-flag/index.js +0 -8
  451. package/dist/wasm/node_modules/has-flag/license +0 -9
  452. package/dist/wasm/node_modules/has-flag/package.json +0 -46
  453. package/dist/wasm/node_modules/has-flag/readme.md +0 -89
  454. package/dist/wasm/node_modules/is-extglob/LICENSE +0 -21
  455. package/dist/wasm/node_modules/is-extglob/README.md +0 -107
  456. package/dist/wasm/node_modules/is-extglob/index.js +0 -20
  457. package/dist/wasm/node_modules/is-extglob/package.json +0 -69
  458. package/dist/wasm/node_modules/is-glob/LICENSE +0 -21
  459. package/dist/wasm/node_modules/is-glob/README.md +0 -206
  460. package/dist/wasm/node_modules/is-glob/index.js +0 -150
  461. package/dist/wasm/node_modules/is-glob/package.json +0 -81
  462. package/dist/wasm/node_modules/is-number/LICENSE +0 -21
  463. package/dist/wasm/node_modules/is-number/README.md +0 -187
  464. package/dist/wasm/node_modules/is-number/index.js +0 -18
  465. package/dist/wasm/node_modules/is-number/package.json +0 -82
  466. package/dist/wasm/node_modules/isexe/.npmignore +0 -2
  467. package/dist/wasm/node_modules/isexe/LICENSE +0 -15
  468. package/dist/wasm/node_modules/isexe/README.md +0 -51
  469. package/dist/wasm/node_modules/isexe/index.js +0 -57
  470. package/dist/wasm/node_modules/isexe/mode.js +0 -41
  471. package/dist/wasm/node_modules/isexe/package.json +0 -31
  472. package/dist/wasm/node_modules/isexe/test/basic.js +0 -221
  473. package/dist/wasm/node_modules/isexe/windows.js +0 -42
  474. package/dist/wasm/node_modules/js-yaml/LICENSE +0 -21
  475. package/dist/wasm/node_modules/js-yaml/README.md +0 -246
  476. package/dist/wasm/node_modules/js-yaml/bin/js-yaml.js +0 -126
  477. package/dist/wasm/node_modules/js-yaml/dist/js-yaml.js +0 -3874
  478. package/dist/wasm/node_modules/js-yaml/dist/js-yaml.min.js +0 -2
  479. package/dist/wasm/node_modules/js-yaml/dist/js-yaml.mjs +0 -3851
  480. package/dist/wasm/node_modules/js-yaml/index.js +0 -30
  481. package/dist/wasm/node_modules/js-yaml/lib/common.js +0 -59
  482. package/dist/wasm/node_modules/js-yaml/lib/dumper.js +0 -979
  483. package/dist/wasm/node_modules/js-yaml/lib/exception.js +0 -55
  484. package/dist/wasm/node_modules/js-yaml/lib/loader.js +0 -1733
  485. package/dist/wasm/node_modules/js-yaml/lib/schema/core.js +0 -11
  486. package/dist/wasm/node_modules/js-yaml/lib/schema/default.js +0 -22
  487. package/dist/wasm/node_modules/js-yaml/lib/schema/failsafe.js +0 -17
  488. package/dist/wasm/node_modules/js-yaml/lib/schema/json.js +0 -19
  489. package/dist/wasm/node_modules/js-yaml/lib/schema.js +0 -121
  490. package/dist/wasm/node_modules/js-yaml/lib/snippet.js +0 -101
  491. package/dist/wasm/node_modules/js-yaml/lib/type/binary.js +0 -125
  492. package/dist/wasm/node_modules/js-yaml/lib/type/bool.js +0 -35
  493. package/dist/wasm/node_modules/js-yaml/lib/type/float.js +0 -97
  494. package/dist/wasm/node_modules/js-yaml/lib/type/int.js +0 -156
  495. package/dist/wasm/node_modules/js-yaml/lib/type/map.js +0 -8
  496. package/dist/wasm/node_modules/js-yaml/lib/type/merge.js +0 -12
  497. package/dist/wasm/node_modules/js-yaml/lib/type/null.js +0 -35
  498. package/dist/wasm/node_modules/js-yaml/lib/type/omap.js +0 -44
  499. package/dist/wasm/node_modules/js-yaml/lib/type/pairs.js +0 -53
  500. package/dist/wasm/node_modules/js-yaml/lib/type/seq.js +0 -8
  501. package/dist/wasm/node_modules/js-yaml/lib/type/set.js +0 -29
  502. package/dist/wasm/node_modules/js-yaml/lib/type/str.js +0 -8
  503. package/dist/wasm/node_modules/js-yaml/lib/type/timestamp.js +0 -88
  504. package/dist/wasm/node_modules/js-yaml/lib/type.js +0 -65
  505. package/dist/wasm/node_modules/js-yaml/package.json +0 -65
  506. package/dist/wasm/node_modules/merge2/LICENSE +0 -21
  507. package/dist/wasm/node_modules/merge2/README.md +0 -144
  508. package/dist/wasm/node_modules/merge2/index.js +0 -144
  509. package/dist/wasm/node_modules/merge2/package.json +0 -43
  510. package/dist/wasm/node_modules/micromatch/LICENSE +0 -21
  511. package/dist/wasm/node_modules/micromatch/README.md +0 -1024
  512. package/dist/wasm/node_modules/micromatch/index.js +0 -474
  513. package/dist/wasm/node_modules/micromatch/package.json +0 -119
  514. package/dist/wasm/node_modules/path-key/index.d.ts +0 -40
  515. package/dist/wasm/node_modules/path-key/index.js +0 -16
  516. package/dist/wasm/node_modules/path-key/license +0 -9
  517. package/dist/wasm/node_modules/path-key/package.json +0 -39
  518. package/dist/wasm/node_modules/path-key/readme.md +0 -61
  519. package/dist/wasm/node_modules/picomatch/LICENSE +0 -21
  520. package/dist/wasm/node_modules/picomatch/README.md +0 -716
  521. package/dist/wasm/node_modules/picomatch/index.js +0 -3
  522. package/dist/wasm/node_modules/picomatch/lib/constants.js +0 -184
  523. package/dist/wasm/node_modules/picomatch/lib/parse.js +0 -1392
  524. package/dist/wasm/node_modules/picomatch/lib/picomatch.js +0 -342
  525. package/dist/wasm/node_modules/picomatch/lib/scan.js +0 -391
  526. package/dist/wasm/node_modules/picomatch/lib/utils.js +0 -64
  527. package/dist/wasm/node_modules/picomatch/package.json +0 -81
  528. package/dist/wasm/node_modules/queue-microtask/LICENSE +0 -20
  529. package/dist/wasm/node_modules/queue-microtask/README.md +0 -90
  530. package/dist/wasm/node_modules/queue-microtask/index.d.ts +0 -2
  531. package/dist/wasm/node_modules/queue-microtask/index.js +0 -9
  532. package/dist/wasm/node_modules/queue-microtask/package.json +0 -55
  533. package/dist/wasm/node_modules/reusify/.github/dependabot.yml +0 -7
  534. package/dist/wasm/node_modules/reusify/.github/workflows/ci.yml +0 -96
  535. package/dist/wasm/node_modules/reusify/LICENSE +0 -22
  536. package/dist/wasm/node_modules/reusify/README.md +0 -139
  537. package/dist/wasm/node_modules/reusify/SECURITY.md +0 -15
  538. package/dist/wasm/node_modules/reusify/benchmarks/createNoCodeFunction.js +0 -30
  539. package/dist/wasm/node_modules/reusify/benchmarks/fib.js +0 -13
  540. package/dist/wasm/node_modules/reusify/benchmarks/reuseNoCodeFunction.js +0 -38
  541. package/dist/wasm/node_modules/reusify/eslint.config.js +0 -14
  542. package/dist/wasm/node_modules/reusify/package.json +0 -50
  543. package/dist/wasm/node_modules/reusify/reusify.d.ts +0 -14
  544. package/dist/wasm/node_modules/reusify/reusify.js +0 -33
  545. package/dist/wasm/node_modules/reusify/test.js +0 -66
  546. package/dist/wasm/node_modules/reusify/tsconfig.json +0 -11
  547. package/dist/wasm/node_modules/run-parallel/LICENSE +0 -20
  548. package/dist/wasm/node_modules/run-parallel/README.md +0 -85
  549. package/dist/wasm/node_modules/run-parallel/index.js +0 -51
  550. package/dist/wasm/node_modules/run-parallel/package.json +0 -58
  551. package/dist/wasm/node_modules/shebang-command/index.js +0 -19
  552. package/dist/wasm/node_modules/shebang-command/license +0 -9
  553. package/dist/wasm/node_modules/shebang-command/package.json +0 -34
  554. package/dist/wasm/node_modules/shebang-command/readme.md +0 -34
  555. package/dist/wasm/node_modules/shebang-regex/index.d.ts +0 -22
  556. package/dist/wasm/node_modules/shebang-regex/index.js +0 -2
  557. package/dist/wasm/node_modules/shebang-regex/license +0 -9
  558. package/dist/wasm/node_modules/shebang-regex/package.json +0 -35
  559. package/dist/wasm/node_modules/shebang-regex/readme.md +0 -33
  560. package/dist/wasm/node_modules/supports-color/browser.js +0 -5
  561. package/dist/wasm/node_modules/supports-color/index.js +0 -135
  562. package/dist/wasm/node_modules/supports-color/license +0 -9
  563. package/dist/wasm/node_modules/supports-color/package.json +0 -53
  564. package/dist/wasm/node_modules/supports-color/readme.md +0 -76
  565. package/dist/wasm/node_modules/to-regex-range/LICENSE +0 -21
  566. package/dist/wasm/node_modules/to-regex-range/README.md +0 -305
  567. package/dist/wasm/node_modules/to-regex-range/index.js +0 -288
  568. package/dist/wasm/node_modules/to-regex-range/package.json +0 -88
  569. package/dist/wasm/node_modules/tslib/CopyrightNotice.txt +0 -15
  570. package/dist/wasm/node_modules/tslib/LICENSE.txt +0 -12
  571. package/dist/wasm/node_modules/tslib/README.md +0 -164
  572. package/dist/wasm/node_modules/tslib/SECURITY.md +0 -41
  573. package/dist/wasm/node_modules/tslib/modules/index.d.ts +0 -38
  574. package/dist/wasm/node_modules/tslib/modules/index.js +0 -70
  575. package/dist/wasm/node_modules/tslib/modules/package.json +0 -3
  576. package/dist/wasm/node_modules/tslib/package.json +0 -47
  577. package/dist/wasm/node_modules/tslib/tslib.d.ts +0 -460
  578. package/dist/wasm/node_modules/tslib/tslib.es6.html +0 -1
  579. package/dist/wasm/node_modules/tslib/tslib.es6.js +0 -402
  580. package/dist/wasm/node_modules/tslib/tslib.es6.mjs +0 -401
  581. package/dist/wasm/node_modules/tslib/tslib.html +0 -1
  582. package/dist/wasm/node_modules/tslib/tslib.js +0 -484
  583. package/dist/wasm/node_modules/typanion/README.md +0 -117
  584. package/dist/wasm/node_modules/typanion/lib/index.d.ts +0 -5
  585. package/dist/wasm/node_modules/typanion/lib/index.js +0 -1305
  586. package/dist/wasm/node_modules/typanion/lib/index.mjs +0 -1249
  587. package/dist/wasm/node_modules/typanion/lib/internal/format.d.ts +0 -5
  588. package/dist/wasm/node_modules/typanion/lib/internal/regexps.d.ts +0 -5
  589. package/dist/wasm/node_modules/typanion/lib/internal/tools.d.ts +0 -5
  590. package/dist/wasm/node_modules/typanion/lib/predicates/cascadingPredicates.d.ts +0 -114
  591. package/dist/wasm/node_modules/typanion/lib/predicates/helperPredicates.d.ts +0 -80
  592. package/dist/wasm/node_modules/typanion/lib/predicates/typePredicates.d.ts +0 -205
  593. package/dist/wasm/node_modules/typanion/lib/tools.d.ts +0 -90
  594. package/dist/wasm/node_modules/typanion/lib/types.d.ts +0 -22
  595. package/dist/wasm/node_modules/typanion/package.json +0 -40
  596. package/dist/wasm/node_modules/which/CHANGELOG.md +0 -166
  597. package/dist/wasm/node_modules/which/LICENSE +0 -15
  598. package/dist/wasm/node_modules/which/README.md +0 -54
  599. package/dist/wasm/node_modules/which/bin/node-which +0 -52
  600. package/dist/wasm/node_modules/which/package.json +0 -43
  601. package/dist/wasm/node_modules/which/which.js +0 -125
  602. package/dist/wasm/package.json +0 -10
  603. package/dist/wasm/pnpm.mjs +0 -8
  604. package/dist/wasm/pnpm.wasm +0 -4
  605. package/dist/wasm/pnpx.mjs +0 -8
  606. package/dist/wasm/run.mjs +0 -147
  607. package/dist/wasm/worker.mjs +0 -56
@@ -1,1305 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const simpleKeyRegExp = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
6
- function getPrintable(value) {
7
- if (value === null)
8
- return `null`;
9
- if (value === undefined)
10
- return `undefined`;
11
- if (value === ``)
12
- return `an empty string`;
13
- if (typeof value === 'symbol')
14
- return `<${value.toString()}>`;
15
- if (Array.isArray(value))
16
- return `an array`;
17
- return JSON.stringify(value);
18
- }
19
- function getPrintableArray(value, conjunction) {
20
- if (value.length === 0)
21
- return `nothing`;
22
- if (value.length === 1)
23
- return getPrintable(value[0]);
24
- const rest = value.slice(0, -1);
25
- const trailing = value[value.length - 1];
26
- const separator = value.length > 2
27
- ? `, ${conjunction} `
28
- : ` ${conjunction} `;
29
- return `${rest.map(value => getPrintable(value)).join(`, `)}${separator}${getPrintable(trailing)}`;
30
- }
31
- function computeKey(state, key) {
32
- var _a, _b, _c;
33
- if (typeof key === `number`) {
34
- return `${(_a = state === null || state === void 0 ? void 0 : state.p) !== null && _a !== void 0 ? _a : `.`}[${key}]`;
35
- }
36
- else if (simpleKeyRegExp.test(key)) {
37
- return `${(_b = state === null || state === void 0 ? void 0 : state.p) !== null && _b !== void 0 ? _b : ``}.${key}`;
38
- }
39
- else {
40
- return `${(_c = state === null || state === void 0 ? void 0 : state.p) !== null && _c !== void 0 ? _c : `.`}[${JSON.stringify(key)}]`;
41
- }
42
- }
43
- function plural(n, singular, plural) {
44
- return n === 1 ? singular : plural;
45
- }
46
-
47
- const colorStringRegExp = /^#[0-9a-f]{6}$/i;
48
- const colorStringAlphaRegExp = /^#[0-9a-f]{6}([0-9a-f]{2})?$/i;
49
- // https://stackoverflow.com/a/475217/880703
50
- const base64RegExp = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;
51
- // https://stackoverflow.com/a/14166194/880703
52
- const uuid4RegExp = /^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}$/i;
53
- // https://stackoverflow.com/a/28022901/880703 + https://www.debuggex.com/r/bl8J35wMKk48a7u_
54
- const iso8601RegExp = /^(?:[1-9]\d{3}(-?)(?:(?:0[1-9]|1[0-2])\1(?:0[1-9]|1\d|2[0-8])|(?:0[13-9]|1[0-2])\1(?:29|30)|(?:0[13578]|1[02])(?:\1)31|00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[0-5]))|(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)(?:(-?)02(?:\2)29|-?366))T(?:[01]\d|2[0-3])(:?)[0-5]\d(?:\3[0-5]\d)?(?:Z|[+-][01]\d(?:\3[0-5]\d)?)$/;
55
-
56
- function pushError({ errors, p } = {}, message) {
57
- errors === null || errors === void 0 ? void 0 : errors.push(`${p !== null && p !== void 0 ? p : `.`}: ${message}`);
58
- return false;
59
- }
60
- function makeSetter(target, key) {
61
- return (v) => {
62
- target[key] = v;
63
- };
64
- }
65
- function makeCoercionFn(target, key) {
66
- return (v) => {
67
- const previous = target[key];
68
- target[key] = v;
69
- return makeCoercionFn(target, key).bind(null, previous);
70
- };
71
- }
72
- function makeLazyCoercionFn(fn, orig, generator) {
73
- const commit = () => {
74
- fn(generator());
75
- return revert;
76
- };
77
- const revert = () => {
78
- fn(orig);
79
- return commit;
80
- };
81
- return commit;
82
- }
83
-
84
- /**
85
- * Create a validator that always returns true and never refines the type.
86
- */
87
- function isUnknown() {
88
- return makeValidator({
89
- test: (value, state) => {
90
- return true;
91
- },
92
- });
93
- }
94
- function isLiteral(expected) {
95
- return makeValidator({
96
- test: (value, state) => {
97
- if (value !== expected)
98
- return pushError(state, `Expected ${getPrintable(expected)} (got ${getPrintable(value)})`);
99
- return true;
100
- },
101
- });
102
- }
103
- /**
104
- * Create a validator that only returns true when the tested value is a string.
105
- * Refines the type to `string`.
106
- */
107
- function isString() {
108
- return makeValidator({
109
- test: (value, state) => {
110
- if (typeof value !== `string`)
111
- return pushError(state, `Expected a string (got ${getPrintable(value)})`);
112
- return true;
113
- },
114
- });
115
- }
116
- function isEnum(enumSpec) {
117
- const valuesArray = Array.isArray(enumSpec) ? enumSpec : Object.values(enumSpec);
118
- const isAlphaNum = valuesArray.every(item => typeof item === 'string' || typeof item === 'number');
119
- const values = new Set(valuesArray);
120
- if (values.size === 1)
121
- return isLiteral([...values][0]);
122
- return makeValidator({
123
- test: (value, state) => {
124
- if (!values.has(value)) {
125
- if (isAlphaNum) {
126
- return pushError(state, `Expected one of ${getPrintableArray(valuesArray, `or`)} (got ${getPrintable(value)})`);
127
- }
128
- else {
129
- return pushError(state, `Expected a valid enumeration value (got ${getPrintable(value)})`);
130
- }
131
- }
132
- return true;
133
- },
134
- });
135
- }
136
- const BOOLEAN_COERCIONS = new Map([
137
- [`true`, true],
138
- [`True`, true],
139
- [`1`, true],
140
- [1, true],
141
- [`false`, false],
142
- [`False`, false],
143
- [`0`, false],
144
- [0, false],
145
- ]);
146
- /**
147
- * Create a validator that only returns true when the tested value is a
148
- * boolean. Refines the type to `boolean`.
149
- *
150
- * Supports coercion:
151
- * - 'true' / 'True' / '1' / 1 will turn to `true`
152
- * - 'false' / 'False' / '0' / 0 will turn to `false`
153
- */
154
- function isBoolean() {
155
- return makeValidator({
156
- test: (value, state) => {
157
- var _a;
158
- if (typeof value !== `boolean`) {
159
- if (typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined`) {
160
- if (typeof (state === null || state === void 0 ? void 0 : state.coercion) === `undefined`)
161
- return pushError(state, `Unbound coercion result`);
162
- const coercion = BOOLEAN_COERCIONS.get(value);
163
- if (typeof coercion !== `undefined`) {
164
- state.coercions.push([(_a = state.p) !== null && _a !== void 0 ? _a : `.`, state.coercion.bind(null, coercion)]);
165
- return true;
166
- }
167
- }
168
- return pushError(state, `Expected a boolean (got ${getPrintable(value)})`);
169
- }
170
- return true;
171
- },
172
- });
173
- }
174
- /**
175
- * Create a validator that only returns true when the tested value is a
176
- * number (including floating numbers; use `cascade` and `isInteger` to
177
- * restrict the range further). Refines the type to `number`.
178
- *
179
- * Supports coercion.
180
- */
181
- function isNumber() {
182
- return makeValidator({
183
- test: (value, state) => {
184
- var _a;
185
- if (typeof value !== `number`) {
186
- if (typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined`) {
187
- if (typeof (state === null || state === void 0 ? void 0 : state.coercion) === `undefined`)
188
- return pushError(state, `Unbound coercion result`);
189
- let coercion;
190
- if (typeof value === `string`) {
191
- let val;
192
- try {
193
- val = JSON.parse(value);
194
- }
195
- catch (_b) { }
196
- // We check against JSON.stringify that the output is the same to ensure that the number can be safely represented in JS
197
- if (typeof val === `number`) {
198
- if (JSON.stringify(val) === value) {
199
- coercion = val;
200
- }
201
- else {
202
- return pushError(state, `Received a number that can't be safely represented by the runtime (${value})`);
203
- }
204
- }
205
- }
206
- if (typeof coercion !== `undefined`) {
207
- state.coercions.push([(_a = state.p) !== null && _a !== void 0 ? _a : `.`, state.coercion.bind(null, coercion)]);
208
- return true;
209
- }
210
- }
211
- return pushError(state, `Expected a number (got ${getPrintable(value)})`);
212
- }
213
- return true;
214
- },
215
- });
216
- }
217
- /**
218
- * Important: This validator only makes sense when used in conjunction with
219
- * coercion! It will always error when used without.
220
- *
221
- * Create a validator that only returns true when the tested value is a
222
- * JSON representation of the expected type. Refines the type to the
223
- * expected type, and casts the value into its inner value.
224
- */
225
- function isPayload(spec) {
226
- return makeValidator({
227
- test: (value, state) => {
228
- var _a;
229
- if (typeof (state === null || state === void 0 ? void 0 : state.coercions) === `undefined`)
230
- return pushError(state, `The isPayload predicate can only be used with coercion enabled`);
231
- if (typeof state.coercion === `undefined`)
232
- return pushError(state, `Unbound coercion result`);
233
- if (typeof value !== `string`)
234
- return pushError(state, `Expected a string (got ${getPrintable(value)})`);
235
- let inner;
236
- try {
237
- inner = JSON.parse(value);
238
- }
239
- catch (_b) {
240
- return pushError(state, `Expected a JSON string (got ${getPrintable(value)})`);
241
- }
242
- const wrapper = { value: inner };
243
- if (!spec(inner, Object.assign(Object.assign({}, state), { coercion: makeCoercionFn(wrapper, `value`) })))
244
- return false;
245
- state.coercions.push([(_a = state.p) !== null && _a !== void 0 ? _a : `.`, state.coercion.bind(null, wrapper.value)]);
246
- return true;
247
- },
248
- });
249
- }
250
- /**
251
- * Create a validator that only returns true when the tested value is a
252
- * valid date. Refines the type to `Date`.
253
- *
254
- * Supports coercion via one of the following formats:
255
- * - ISO86001 strings
256
- * - Unix timestamps
257
- */
258
- function isDate() {
259
- return makeValidator({
260
- test: (value, state) => {
261
- var _a;
262
- if (!(value instanceof Date)) {
263
- if (typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined`) {
264
- if (typeof (state === null || state === void 0 ? void 0 : state.coercion) === `undefined`)
265
- return pushError(state, `Unbound coercion result`);
266
- let coercion;
267
- if (typeof value === `string` && iso8601RegExp.test(value)) {
268
- coercion = new Date(value);
269
- }
270
- else {
271
- let timestamp;
272
- if (typeof value === `string`) {
273
- let val;
274
- try {
275
- val = JSON.parse(value);
276
- }
277
- catch (_b) { }
278
- if (typeof val === `number`) {
279
- timestamp = val;
280
- }
281
- }
282
- else if (typeof value === `number`) {
283
- timestamp = value;
284
- }
285
- if (typeof timestamp !== `undefined`) {
286
- if (Number.isSafeInteger(timestamp) || !Number.isSafeInteger(timestamp * 1000)) {
287
- coercion = new Date(timestamp * 1000);
288
- }
289
- else {
290
- return pushError(state, `Received a timestamp that can't be safely represented by the runtime (${value})`);
291
- }
292
- }
293
- }
294
- if (typeof coercion !== `undefined`) {
295
- state.coercions.push([(_a = state.p) !== null && _a !== void 0 ? _a : `.`, state.coercion.bind(null, coercion)]);
296
- return true;
297
- }
298
- }
299
- return pushError(state, `Expected a date (got ${getPrintable(value)})`);
300
- }
301
- return true;
302
- },
303
- });
304
- }
305
- /**
306
- * Create a validator that only returns true when the tested value is an
307
- * array whose all values match the provided subspec. Refines the type to
308
- * `Array<T>`, with `T` being the subspec inferred type.
309
- *
310
- * Supports coercion if the `delimiter` option is set, in which case strings
311
- * will be split accordingly.
312
- */
313
- function isArray(spec, { delimiter } = {}) {
314
- return makeValidator({
315
- test: (value, state) => {
316
- var _a;
317
- const originalValue = value;
318
- if (typeof value === `string` && typeof delimiter !== `undefined`) {
319
- if (typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined`) {
320
- if (typeof (state === null || state === void 0 ? void 0 : state.coercion) === `undefined`)
321
- return pushError(state, `Unbound coercion result`);
322
- value = value.split(delimiter);
323
- }
324
- }
325
- if (!Array.isArray(value))
326
- return pushError(state, `Expected an array (got ${getPrintable(value)})`);
327
- let valid = true;
328
- for (let t = 0, T = value.length; t < T; ++t) {
329
- valid = spec(value[t], Object.assign(Object.assign({}, state), { p: computeKey(state, t), coercion: makeCoercionFn(value, t) })) && valid;
330
- if (!valid && (state === null || state === void 0 ? void 0 : state.errors) == null) {
331
- break;
332
- }
333
- }
334
- if (value !== originalValue)
335
- state.coercions.push([(_a = state.p) !== null && _a !== void 0 ? _a : `.`, state.coercion.bind(null, value)]);
336
- return valid;
337
- },
338
- });
339
- }
340
- /**
341
- * Create a validator that only returns true when the tested value is an
342
- * set whose all values match the provided subspec. Refines the type to
343
- * `Set<T>`, with `T` being the subspec inferred type.
344
- *
345
- * Supports coercion from arrays (or anything that can be coerced into an
346
- * array).
347
- */
348
- function isSet(spec, { delimiter } = {}) {
349
- const isArrayValidator = isArray(spec, { delimiter });
350
- return makeValidator({
351
- test: (value, state) => {
352
- var _a, _b;
353
- if (Object.getPrototypeOf(value).toString() === `[object Set]`) {
354
- if (typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined`) {
355
- if (typeof (state === null || state === void 0 ? void 0 : state.coercion) === `undefined`)
356
- return pushError(state, `Unbound coercion result`);
357
- const originalValues = [...value];
358
- const coercedValues = [...value];
359
- if (!isArrayValidator(coercedValues, Object.assign(Object.assign({}, state), { coercion: undefined })))
360
- return false;
361
- const updateValue = () => coercedValues.some((val, t) => val !== originalValues[t])
362
- ? new Set(coercedValues)
363
- : value;
364
- state.coercions.push([(_a = state.p) !== null && _a !== void 0 ? _a : `.`, makeLazyCoercionFn(state.coercion, value, updateValue)]);
365
- return true;
366
- }
367
- else {
368
- let valid = true;
369
- for (const subValue of value) {
370
- valid = spec(subValue, Object.assign({}, state)) && valid;
371
- if (!valid && (state === null || state === void 0 ? void 0 : state.errors) == null) {
372
- break;
373
- }
374
- }
375
- return valid;
376
- }
377
- }
378
- if (typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined`) {
379
- if (typeof (state === null || state === void 0 ? void 0 : state.coercion) === `undefined`)
380
- return pushError(state, `Unbound coercion result`);
381
- const store = { value };
382
- if (!isArrayValidator(value, Object.assign(Object.assign({}, state), { coercion: makeCoercionFn(store, `value`) })))
383
- return false;
384
- state.coercions.push([(_b = state.p) !== null && _b !== void 0 ? _b : `.`, makeLazyCoercionFn(state.coercion, value, () => new Set(store.value))]);
385
- return true;
386
- }
387
- return pushError(state, `Expected a set (got ${getPrintable(value)})`);
388
- }
389
- });
390
- }
391
- /**
392
- * Create a validator that only returns true when the tested value is an
393
- * map whose all values match the provided subspecs. Refines the type to
394
- * `Map<U, V>`, with `U` being the key subspec inferred type and `V` being
395
- * the value subspec inferred type.
396
- *
397
- * Supports coercion from array of tuples (or anything that can be coerced into
398
- * an array of tuples).
399
- */
400
- function isMap(keySpec, valueSpec) {
401
- const isArrayValidator = isArray(isTuple([keySpec, valueSpec]));
402
- const isRecordValidator = isRecord(valueSpec, { keys: keySpec });
403
- return makeValidator({
404
- test: (value, state) => {
405
- var _a, _b, _c;
406
- if (Object.getPrototypeOf(value).toString() === `[object Map]`) {
407
- if (typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined`) {
408
- if (typeof (state === null || state === void 0 ? void 0 : state.coercion) === `undefined`)
409
- return pushError(state, `Unbound coercion result`);
410
- const originalValues = [...value];
411
- const coercedValues = [...value];
412
- if (!isArrayValidator(coercedValues, Object.assign(Object.assign({}, state), { coercion: undefined })))
413
- return false;
414
- const updateValue = () => coercedValues.some((val, t) => val[0] !== originalValues[t][0] || val[1] !== originalValues[t][1])
415
- ? new Map(coercedValues)
416
- : value;
417
- state.coercions.push([(_a = state.p) !== null && _a !== void 0 ? _a : `.`, makeLazyCoercionFn(state.coercion, value, updateValue)]);
418
- return true;
419
- }
420
- else {
421
- let valid = true;
422
- for (const [key, subValue] of value) {
423
- valid = keySpec(key, Object.assign({}, state)) && valid;
424
- if (!valid && (state === null || state === void 0 ? void 0 : state.errors) == null) {
425
- break;
426
- }
427
- valid = valueSpec(subValue, Object.assign(Object.assign({}, state), { p: computeKey(state, key) })) && valid;
428
- if (!valid && (state === null || state === void 0 ? void 0 : state.errors) == null) {
429
- break;
430
- }
431
- }
432
- return valid;
433
- }
434
- }
435
- if (typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined`) {
436
- if (typeof (state === null || state === void 0 ? void 0 : state.coercion) === `undefined`)
437
- return pushError(state, `Unbound coercion result`);
438
- const store = { value };
439
- if (Array.isArray(value)) {
440
- if (!isArrayValidator(value, Object.assign(Object.assign({}, state), { coercion: undefined })))
441
- return false;
442
- state.coercions.push([(_b = state.p) !== null && _b !== void 0 ? _b : `.`, makeLazyCoercionFn(state.coercion, value, () => new Map(store.value))]);
443
- return true;
444
- }
445
- else {
446
- if (!isRecordValidator(value, Object.assign(Object.assign({}, state), { coercion: makeCoercionFn(store, `value`) })))
447
- return false;
448
- state.coercions.push([(_c = state.p) !== null && _c !== void 0 ? _c : `.`, makeLazyCoercionFn(state.coercion, value, () => new Map(Object.entries(store.value)))]);
449
- return true;
450
- }
451
- }
452
- return pushError(state, `Expected a map (got ${getPrintable(value)})`);
453
- }
454
- });
455
- }
456
- /**
457
- * Create a validator that only returns true when the tested value is a
458
- * tuple whose each value matches the corresponding subspec. Refines the type
459
- * into a tuple whose each item has the type inferred by the corresponding
460
- * tuple.
461
- *
462
- * Supports coercion if the `delimiter` option is set, in which case strings
463
- * will be split accordingly.
464
- */
465
- function isTuple(spec, { delimiter } = {}) {
466
- const lengthValidator = hasExactLength(spec.length);
467
- return makeValidator({
468
- test: (value, state) => {
469
- var _a;
470
- if (typeof value === `string` && typeof delimiter !== `undefined`) {
471
- if (typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined`) {
472
- if (typeof (state === null || state === void 0 ? void 0 : state.coercion) === `undefined`)
473
- return pushError(state, `Unbound coercion result`);
474
- value = value.split(delimiter);
475
- state.coercions.push([(_a = state.p) !== null && _a !== void 0 ? _a : `.`, state.coercion.bind(null, value)]);
476
- }
477
- }
478
- if (!Array.isArray(value))
479
- return pushError(state, `Expected a tuple (got ${getPrintable(value)})`);
480
- let valid = lengthValidator(value, Object.assign({}, state));
481
- for (let t = 0, T = value.length; t < T && t < spec.length; ++t) {
482
- valid = spec[t](value[t], Object.assign(Object.assign({}, state), { p: computeKey(state, t), coercion: makeCoercionFn(value, t) })) && valid;
483
- if (!valid && (state === null || state === void 0 ? void 0 : state.errors) == null) {
484
- break;
485
- }
486
- }
487
- return valid;
488
- },
489
- });
490
- }
491
- /**
492
- * Create a validator that only returns true when the tested value is an
493
- * object with any amount of properties that must all match the provided
494
- * subspec. Refines the type to `Record<string, T>`, with `T` being the
495
- * subspec inferred type.
496
- *
497
- * Keys can be optionally validated as well by using the `keys` optional
498
- * subspec parameter.
499
- */
500
- function isRecord(spec, { keys: keySpec = null, } = {}) {
501
- const isArrayValidator = isArray(isTuple([keySpec !== null && keySpec !== void 0 ? keySpec : isString(), spec]));
502
- return makeValidator({
503
- test: (value, state) => {
504
- var _a;
505
- if (Array.isArray(value)) {
506
- if (typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined`) {
507
- if (typeof (state === null || state === void 0 ? void 0 : state.coercion) === `undefined`)
508
- return pushError(state, `Unbound coercion result`);
509
- if (!isArrayValidator(value, Object.assign(Object.assign({}, state), { coercion: undefined })))
510
- return false;
511
- value = Object.fromEntries(value);
512
- state.coercions.push([(_a = state.p) !== null && _a !== void 0 ? _a : `.`, state.coercion.bind(null, value)]);
513
- return true;
514
- }
515
- }
516
- if (typeof value !== `object` || value === null)
517
- return pushError(state, `Expected an object (got ${getPrintable(value)})`);
518
- const keys = Object.keys(value);
519
- let valid = true;
520
- for (let t = 0, T = keys.length; t < T && (valid || (state === null || state === void 0 ? void 0 : state.errors) != null); ++t) {
521
- const key = keys[t];
522
- const sub = value[key];
523
- if (key === `__proto__` || key === `constructor`) {
524
- valid = pushError(Object.assign(Object.assign({}, state), { p: computeKey(state, key) }), `Unsafe property name`);
525
- continue;
526
- }
527
- if (keySpec !== null && !keySpec(key, state)) {
528
- valid = false;
529
- continue;
530
- }
531
- if (!spec(sub, Object.assign(Object.assign({}, state), { p: computeKey(state, key), coercion: makeCoercionFn(value, key) }))) {
532
- valid = false;
533
- continue;
534
- }
535
- }
536
- return valid;
537
- },
538
- });
539
- }
540
- /**
541
- * @deprecated Replace `isDict` by `isRecord`
542
- */
543
- function isDict(spec, opts = {}) {
544
- return isRecord(spec, opts);
545
- }
546
- /**
547
- * Create a validator that only returns true when the tested value is an
548
- * object whose all properties match their corresponding subspec. Refines
549
- * the type into an object whose each property has the type inferred by the
550
- * corresponding subspec.
551
- *
552
- * Unlike `t.isPartial`, `t.isObject` doesn't allow extraneous properties by
553
- * default. This behaviour can be altered by using the `extra` optional
554
- * subspec parameter, which will be called to validate an object only
555
- * containing the extraneous properties.
556
- *
557
- * Calling `t.isObject(..., {extra: t.isRecord(t.isUnknown())})` is
558
- * essentially the same as calling `t.isPartial(...)`.
559
- */
560
- function isObject(props, { extra: extraSpec = null, } = {}) {
561
- const specKeys = Object.keys(props);
562
- const validator = makeValidator({
563
- test: (value, state) => {
564
- if (typeof value !== `object` || value === null)
565
- return pushError(state, `Expected an object (got ${getPrintable(value)})`);
566
- const keys = new Set([...specKeys, ...Object.keys(value)]);
567
- const extra = {};
568
- let valid = true;
569
- for (const key of keys) {
570
- if (key === `constructor` || key === `__proto__`) {
571
- valid = pushError(Object.assign(Object.assign({}, state), { p: computeKey(state, key) }), `Unsafe property name`);
572
- }
573
- else {
574
- const spec = Object.prototype.hasOwnProperty.call(props, key)
575
- ? props[key]
576
- : undefined;
577
- const sub = Object.prototype.hasOwnProperty.call(value, key)
578
- ? value[key]
579
- : undefined;
580
- if (typeof spec !== `undefined`) {
581
- valid = spec(sub, Object.assign(Object.assign({}, state), { p: computeKey(state, key), coercion: makeCoercionFn(value, key) })) && valid;
582
- }
583
- else if (extraSpec === null) {
584
- valid = pushError(Object.assign(Object.assign({}, state), { p: computeKey(state, key) }), `Extraneous property (got ${getPrintable(sub)})`);
585
- }
586
- else {
587
- Object.defineProperty(extra, key, {
588
- enumerable: true,
589
- get: () => sub,
590
- set: makeSetter(value, key)
591
- });
592
- }
593
- }
594
- if (!valid && (state === null || state === void 0 ? void 0 : state.errors) == null) {
595
- break;
596
- }
597
- }
598
- if (extraSpec !== null && (valid || (state === null || state === void 0 ? void 0 : state.errors) != null))
599
- valid = extraSpec(extra, state) && valid;
600
- return valid;
601
- },
602
- });
603
- return Object.assign(validator, {
604
- properties: props,
605
- });
606
- }
607
- /**
608
- * Create a validator that only returns true when the tested value is an
609
- * object whose all properties match their corresponding subspec. Refines
610
- * the type into an object whose each property has the type inferred by the
611
- * corresponding subspec.
612
- *
613
- * Unlike `t.isObject`, `t.isPartial` allows extraneous properties. The
614
- * resulting type will reflect this behaviour by including an index
615
- * signature (each extraneous property being typed `unknown`).
616
- *
617
- * Calling `t.isPartial(...)` is essentially the same as calling
618
- * `t.isObject(..., {extra: t.isRecord(t.isUnknown())})`.
619
- */
620
- function isPartial(props) {
621
- return isObject(props, { extra: isRecord(isUnknown()) });
622
- }
623
- /**
624
- * Create a validator that only returns true when the tested value is an
625
- * object whose prototype is derived from the given class. Refines the type
626
- * into a class instance.
627
- */
628
- const isInstanceOf = (constructor) => makeValidator({
629
- test: (value, state) => {
630
- if (!(value instanceof constructor))
631
- return pushError(state, `Expected an instance of ${constructor.name} (got ${getPrintable(value)})`);
632
- return true;
633
- },
634
- });
635
- /**
636
- * Create a validator that only returns true when the tested value is an
637
- * object matching any of the provided subspecs. If the optional `exclusive`
638
- * parameter is set to `true`, the behaviour changes so that the validator
639
- * only returns true when exactly one subspec matches.
640
- */
641
- const isOneOf = (specs, { exclusive = false, } = {}) => makeValidator({
642
- test: (value, state) => {
643
- var _a, _b, _c;
644
- const matches = [];
645
- const errorBuffer = typeof (state === null || state === void 0 ? void 0 : state.errors) !== `undefined`
646
- ? [] : undefined;
647
- for (let t = 0, T = specs.length; t < T; ++t) {
648
- const subErrors = typeof (state === null || state === void 0 ? void 0 : state.errors) !== `undefined`
649
- ? [] : undefined;
650
- const subCoercions = typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined`
651
- ? [] : undefined;
652
- if (specs[t](value, Object.assign(Object.assign({}, state), { errors: subErrors, coercions: subCoercions, p: `${(_a = state === null || state === void 0 ? void 0 : state.p) !== null && _a !== void 0 ? _a : `.`}#${t + 1}` }))) {
653
- matches.push([`#${t + 1}`, subCoercions]);
654
- if (!exclusive) {
655
- break;
656
- }
657
- }
658
- else {
659
- errorBuffer === null || errorBuffer === void 0 ? void 0 : errorBuffer.push(subErrors[0]);
660
- }
661
- }
662
- if (matches.length === 1) {
663
- const [, subCoercions] = matches[0];
664
- if (typeof subCoercions !== `undefined`)
665
- (_b = state === null || state === void 0 ? void 0 : state.coercions) === null || _b === void 0 ? void 0 : _b.push(...subCoercions);
666
- return true;
667
- }
668
- if (matches.length > 1)
669
- pushError(state, `Expected to match exactly a single predicate (matched ${matches.join(`, `)})`);
670
- else
671
- (_c = state === null || state === void 0 ? void 0 : state.errors) === null || _c === void 0 ? void 0 : _c.push(...errorBuffer);
672
- return false;
673
- },
674
- });
675
-
676
- function makeTrait(value) {
677
- return () => {
678
- return value;
679
- };
680
- }
681
- function makeValidator({ test }) {
682
- return makeTrait(test)();
683
- }
684
- class TypeAssertionError extends Error {
685
- constructor({ errors } = {}) {
686
- let errorMessage = `Type mismatch`;
687
- if (errors && errors.length > 0) {
688
- errorMessage += `\n`;
689
- for (const error of errors) {
690
- errorMessage += `\n- ${error}`;
691
- }
692
- }
693
- super(errorMessage);
694
- }
695
- }
696
- /**
697
- * Check that the specified value matches the given validator, and throws an
698
- * exception if it doesn't. Refine the type if it passes.
699
- */
700
- function assert(val, validator) {
701
- if (!validator(val)) {
702
- throw new TypeAssertionError();
703
- }
704
- }
705
- /**
706
- * Check that the specified value matches the given validator, and throws an
707
- * exception if it doesn't. Refine the type if it passes.
708
- *
709
- * Thrown exceptions include details about what exactly looks invalid in the
710
- * tested value.
711
- */
712
- function assertWithErrors(val, validator) {
713
- const errors = [];
714
- if (!validator(val, { errors })) {
715
- throw new TypeAssertionError({ errors });
716
- }
717
- }
718
- /**
719
- * Compile-time only. Refine the type as if the validator was matching the
720
- * tested value, but doesn't actually run it. Similar to the classic `as`
721
- * operator in TypeScript.
722
- */
723
- function softAssert(val, validator) {
724
- // It's a soft assert; we tell TypeScript about the type, but we don't need to check it
725
- }
726
- function as(value, validator, { coerce = false, errors: storeErrors, throw: throws } = {}) {
727
- const errors = storeErrors ? [] : undefined;
728
- if (!coerce) {
729
- if (validator(value, { errors })) {
730
- return throws ? value : { value, errors: undefined };
731
- }
732
- else if (!throws) {
733
- return { value: undefined, errors: errors !== null && errors !== void 0 ? errors : true };
734
- }
735
- else {
736
- throw new TypeAssertionError({ errors });
737
- }
738
- }
739
- const state = { value };
740
- const coercion = makeCoercionFn(state, `value`);
741
- const coercions = [];
742
- if (!validator(value, { errors, coercion, coercions })) {
743
- if (!throws) {
744
- return { value: undefined, errors: errors !== null && errors !== void 0 ? errors : true };
745
- }
746
- else {
747
- throw new TypeAssertionError({ errors });
748
- }
749
- }
750
- for (const [, apply] of coercions)
751
- apply();
752
- if (throws) {
753
- return state.value;
754
- }
755
- else {
756
- return { value: state.value, errors: undefined };
757
- }
758
- }
759
- /**
760
- * Create and return a new function that apply the given validators to each
761
- * corresponding argument passed to the function and throws an exception in
762
- * case of a mismatch.
763
- */
764
- function fn(validators, fn) {
765
- const isValidArgList = isTuple(validators);
766
- return ((...args) => {
767
- const check = isValidArgList(args);
768
- if (!check)
769
- throw new TypeAssertionError();
770
- return fn(...args);
771
- });
772
- }
773
-
774
- /**
775
- * Create a validator that checks that the tested array or string has at least
776
- * the specified length.
777
- */
778
- function hasMinLength(length) {
779
- return makeValidator({
780
- test: (value, state) => {
781
- if (!(value.length >= length))
782
- return pushError(state, `Expected to have a length of at least ${length} elements (got ${value.length})`);
783
- return true;
784
- },
785
- });
786
- }
787
- /**
788
- * Create a validator that checks that the tested array or string has at most
789
- * the specified length.
790
- */
791
- function hasMaxLength(length) {
792
- return makeValidator({
793
- test: (value, state) => {
794
- if (!(value.length <= length))
795
- return pushError(state, `Expected to have a length of at most ${length} elements (got ${value.length})`);
796
- return true;
797
- },
798
- });
799
- }
800
- /**
801
- * Create a validator that checks that the tested array or string has exactly
802
- * the specified length.
803
- */
804
- function hasExactLength(length) {
805
- return makeValidator({
806
- test: (value, state) => {
807
- if (!(value.length === length))
808
- return pushError(state, `Expected to have a length of exactly ${length} elements (got ${value.length})`);
809
- return true;
810
- },
811
- });
812
- }
813
- /**
814
- * Create a validator that checks that the tested array only contains unique
815
- * elements. The optional `map` parameter lets you define a transform to
816
- * apply before making the check (the result of this transform will be
817
- * discarded afterwards).
818
- */
819
- function hasUniqueItems({ map, } = {}) {
820
- return makeValidator({
821
- test: (value, state) => {
822
- const set = new Set();
823
- const dup = new Set();
824
- for (let t = 0, T = value.length; t < T; ++t) {
825
- const sub = value[t];
826
- const key = typeof map !== `undefined`
827
- ? map(sub)
828
- : sub;
829
- if (set.has(key)) {
830
- if (dup.has(key))
831
- continue;
832
- pushError(state, `Expected to contain unique elements; got a duplicate with ${getPrintable(value)}`);
833
- dup.add(key);
834
- }
835
- else {
836
- set.add(key);
837
- }
838
- }
839
- return dup.size === 0;
840
- },
841
- });
842
- }
843
- /**
844
- * Create a validator that checks that the tested number is strictly less than 0.
845
- */
846
- function isNegative() {
847
- return makeValidator({
848
- test: (value, state) => {
849
- if (!(value <= 0))
850
- return pushError(state, `Expected to be negative (got ${value})`);
851
- return true;
852
- },
853
- });
854
- }
855
- /**
856
- * Create a validator that checks that the tested number is equal or greater
857
- * than 0.
858
- */
859
- function isPositive() {
860
- return makeValidator({
861
- test: (value, state) => {
862
- if (!(value >= 0))
863
- return pushError(state, `Expected to be positive (got ${value})`);
864
- return true;
865
- },
866
- });
867
- }
868
- /**
869
- * Create a validator that checks that the tested number is equal or greater
870
- * than the specified reference.
871
- */
872
- function isAtLeast(n) {
873
- return makeValidator({
874
- test: (value, state) => {
875
- if (!(value >= n))
876
- return pushError(state, `Expected to be at least ${n} (got ${value})`);
877
- return true;
878
- },
879
- });
880
- }
881
- /**
882
- * Create a validator that checks that the tested number is equal or smaller
883
- * than the specified reference.
884
- */
885
- function isAtMost(n) {
886
- return makeValidator({
887
- test: (value, state) => {
888
- if (!(value <= n))
889
- return pushError(state, `Expected to be at most ${n} (got ${value})`);
890
- return true;
891
- },
892
- });
893
- }
894
- /**
895
- * Create a validator that checks that the tested number is between the
896
- * specified references (including the upper boundary).
897
- */
898
- function isInInclusiveRange(a, b) {
899
- return makeValidator({
900
- test: (value, state) => {
901
- if (!(value >= a && value <= b))
902
- return pushError(state, `Expected to be in the [${a}; ${b}] range (got ${value})`);
903
- return true;
904
- },
905
- });
906
- }
907
- /**
908
- * Create a validator that checks that the tested number is between the
909
- * specified references (excluding the upper boundary).
910
- */
911
- function isInExclusiveRange(a, b) {
912
- return makeValidator({
913
- test: (value, state) => {
914
- if (!(value >= a && value < b))
915
- return pushError(state, `Expected to be in the [${a}; ${b}[ range (got ${value})`);
916
- return true;
917
- },
918
- });
919
- }
920
- /**
921
- * Create a validator that checks that the tested number is an integer.
922
- *
923
- * By default Typanion will also check that it's a *safe* integer. For example,
924
- * 2^53 wouldn't be a safe integer because 2^53+1 would be rounded to 2^53,
925
- * which could put your applications at risk when used in loops.
926
- */
927
- function isInteger({ unsafe = false, } = {}) {
928
- return makeValidator({
929
- test: (value, state) => {
930
- if (value !== Math.round(value))
931
- return pushError(state, `Expected to be an integer (got ${value})`);
932
- if (!unsafe && !Number.isSafeInteger(value))
933
- return pushError(state, `Expected to be a safe integer (got ${value})`);
934
- return true;
935
- },
936
- });
937
- }
938
- /**
939
- * Create a validator that checks that the tested string matches the given
940
- * regular expression.
941
- */
942
- function matchesRegExp(regExp) {
943
- return makeValidator({
944
- test: (value, state) => {
945
- if (!regExp.test(value))
946
- return pushError(state, `Expected to match the pattern ${regExp.toString()} (got ${getPrintable(value)})`);
947
- return true;
948
- },
949
- });
950
- }
951
- /**
952
- * Create a validator that checks that the tested string only contain lowercase
953
- * characters.
954
- */
955
- function isLowerCase() {
956
- return makeValidator({
957
- test: (value, state) => {
958
- if (value !== value.toLowerCase())
959
- return pushError(state, `Expected to be all-lowercase (got ${value})`);
960
- return true;
961
- },
962
- });
963
- }
964
- /**
965
- * Create a validator that checks that the tested string only contain uppercase
966
- * characters.
967
- */
968
- function isUpperCase() {
969
- return makeValidator({
970
- test: (value, state) => {
971
- if (value !== value.toUpperCase())
972
- return pushError(state, `Expected to be all-uppercase (got ${value})`);
973
- return true;
974
- },
975
- });
976
- }
977
- /**
978
- * Create a validator that checks that the tested string is a valid UUID v4.
979
- */
980
- function isUUID4() {
981
- return makeValidator({
982
- test: (value, state) => {
983
- if (!uuid4RegExp.test(value))
984
- return pushError(state, `Expected to be a valid UUID v4 (got ${getPrintable(value)})`);
985
- return true;
986
- },
987
- });
988
- }
989
- /**
990
- * Create a validator that checks that the tested string is a valid ISO8601
991
- * date.
992
- */
993
- function isISO8601() {
994
- return makeValidator({
995
- test: (value, state) => {
996
- if (!iso8601RegExp.test(value))
997
- return pushError(state, `Expected to be a valid ISO 8601 date string (got ${getPrintable(value)})`);
998
- return true;
999
- },
1000
- });
1001
- }
1002
- /**
1003
- * Create a validator that checks that the tested string is a valid hexadecimal
1004
- * color. Setting the optional `alpha` parameter to `true` allows an additional
1005
- * transparency channel to be included.
1006
- */
1007
- function isHexColor({ alpha = false, }) {
1008
- return makeValidator({
1009
- test: (value, state) => {
1010
- const res = alpha
1011
- ? colorStringRegExp.test(value)
1012
- : colorStringAlphaRegExp.test(value);
1013
- if (!res)
1014
- return pushError(state, `Expected to be a valid hexadecimal color string (got ${getPrintable(value)})`);
1015
- return true;
1016
- },
1017
- });
1018
- }
1019
- /**
1020
- * Create a validator that checks that the tested string is valid base64.
1021
- */
1022
- function isBase64() {
1023
- return makeValidator({
1024
- test: (value, state) => {
1025
- if (!base64RegExp.test(value))
1026
- return pushError(state, `Expected to be a valid base 64 string (got ${getPrintable(value)})`);
1027
- return true;
1028
- },
1029
- });
1030
- }
1031
- /**
1032
- * Create a validator that checks that the tested string is valid JSON. A
1033
- * optional spec can be passed as parameter, in which case the data will be
1034
- * deserialized and validated against the spec (coercion will be disabled
1035
- * for this check, and even if successful the returned value will still be
1036
- * the original string).
1037
- */
1038
- function isJSON(spec = isUnknown()) {
1039
- return makeValidator({
1040
- test: (value, state) => {
1041
- let data;
1042
- try {
1043
- data = JSON.parse(value);
1044
- }
1045
- catch (_a) {
1046
- return pushError(state, `Expected to be a valid JSON string (got ${getPrintable(value)})`);
1047
- }
1048
- return spec(data, state);
1049
- },
1050
- });
1051
- }
1052
-
1053
- function cascade(spec, ...followups) {
1054
- const resolvedFollowups = Array.isArray(followups[0])
1055
- ? followups[0]
1056
- : followups;
1057
- return makeValidator({
1058
- test: (value, state) => {
1059
- var _a, _b;
1060
- const context = { value: value };
1061
- const subCoercion = typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined`
1062
- ? makeCoercionFn(context, `value`) : undefined;
1063
- const subCoercions = typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined`
1064
- ? [] : undefined;
1065
- if (!spec(value, Object.assign(Object.assign({}, state), { coercion: subCoercion, coercions: subCoercions })))
1066
- return false;
1067
- const reverts = [];
1068
- if (typeof subCoercions !== `undefined`)
1069
- for (const [, coercion] of subCoercions)
1070
- reverts.push(coercion());
1071
- try {
1072
- if (typeof (state === null || state === void 0 ? void 0 : state.coercions) !== `undefined`) {
1073
- if (context.value !== value) {
1074
- if (typeof (state === null || state === void 0 ? void 0 : state.coercion) === `undefined`)
1075
- return pushError(state, `Unbound coercion result`);
1076
- state.coercions.push([(_a = state.p) !== null && _a !== void 0 ? _a : `.`, state.coercion.bind(null, context.value)]);
1077
- }
1078
- (_b = state === null || state === void 0 ? void 0 : state.coercions) === null || _b === void 0 ? void 0 : _b.push(...subCoercions);
1079
- }
1080
- return resolvedFollowups.every(spec => {
1081
- return spec(context.value, state);
1082
- });
1083
- }
1084
- finally {
1085
- for (const revert of reverts) {
1086
- revert();
1087
- }
1088
- }
1089
- },
1090
- });
1091
- }
1092
- function applyCascade(spec, ...followups) {
1093
- const resolvedFollowups = Array.isArray(followups[0])
1094
- ? followups[0]
1095
- : followups;
1096
- return cascade(spec, resolvedFollowups);
1097
- }
1098
- /**
1099
- * Wraps the given spec to also allow `undefined`.
1100
- */
1101
- function isOptional(spec) {
1102
- return makeValidator({
1103
- test: (value, state) => {
1104
- if (typeof value === `undefined`)
1105
- return true;
1106
- return spec(value, state);
1107
- },
1108
- });
1109
- }
1110
- /**
1111
- * Wraps the given spec to also allow `null`.
1112
- */
1113
- function isNullable(spec) {
1114
- return makeValidator({
1115
- test: (value, state) => {
1116
- if (value === null)
1117
- return true;
1118
- return spec(value, state);
1119
- },
1120
- });
1121
- }
1122
- const checks = {
1123
- missing: (keys, key) => keys.has(key),
1124
- undefined: (keys, key, value) => keys.has(key) && typeof value[key] !== `undefined`,
1125
- nil: (keys, key, value) => keys.has(key) && value[key] != null,
1126
- falsy: (keys, key, value) => keys.has(key) && !!value[key],
1127
- };
1128
- /**
1129
- * Create a validator that checks that the tested object contains the specified
1130
- * keys.
1131
- */
1132
- function hasRequiredKeys(requiredKeys, options) {
1133
- var _a;
1134
- const requiredSet = new Set(requiredKeys);
1135
- const check = checks[(_a = options === null || options === void 0 ? void 0 : options.missingIf) !== null && _a !== void 0 ? _a : 'missing'];
1136
- return makeValidator({
1137
- test: (value, state) => {
1138
- const keys = new Set(Object.keys(value));
1139
- const problems = [];
1140
- for (const key of requiredSet)
1141
- if (!check(keys, key, value))
1142
- problems.push(key);
1143
- if (problems.length > 0)
1144
- return pushError(state, `Missing required ${plural(problems.length, `property`, `properties`)} ${getPrintableArray(problems, `and`)}`);
1145
- return true;
1146
- },
1147
- });
1148
- }
1149
- /**
1150
- * Create a validator that checks that the tested object contains at least one
1151
- * of the specified keys.
1152
- */
1153
- function hasAtLeastOneKey(requiredKeys, options) {
1154
- var _a;
1155
- const requiredSet = new Set(requiredKeys);
1156
- const check = checks[(_a = options === null || options === void 0 ? void 0 : options.missingIf) !== null && _a !== void 0 ? _a : 'missing'];
1157
- return makeValidator({
1158
- test: (value, state) => {
1159
- const keys = Object.keys(value);
1160
- const valid = keys.some(key => check(requiredSet, key, value));
1161
- if (!valid)
1162
- return pushError(state, `Missing at least one property from ${getPrintableArray(Array.from(requiredSet), `or`)}`);
1163
- return true;
1164
- },
1165
- });
1166
- }
1167
- /**
1168
- * Create a validator that checks that the tested object contains none of the
1169
- * specified keys.
1170
- */
1171
- function hasForbiddenKeys(forbiddenKeys, options) {
1172
- var _a;
1173
- const forbiddenSet = new Set(forbiddenKeys);
1174
- const check = checks[(_a = options === null || options === void 0 ? void 0 : options.missingIf) !== null && _a !== void 0 ? _a : 'missing'];
1175
- return makeValidator({
1176
- test: (value, state) => {
1177
- const keys = new Set(Object.keys(value));
1178
- const problems = [];
1179
- for (const key of forbiddenSet)
1180
- if (check(keys, key, value))
1181
- problems.push(key);
1182
- if (problems.length > 0)
1183
- return pushError(state, `Forbidden ${plural(problems.length, `property`, `properties`)} ${getPrintableArray(problems, `and`)}`);
1184
- return true;
1185
- },
1186
- });
1187
- }
1188
- /**
1189
- * Create a validator that checks that the tested object contains at most one
1190
- * of the specified keys.
1191
- */
1192
- function hasMutuallyExclusiveKeys(exclusiveKeys, options) {
1193
- var _a;
1194
- const exclusiveSet = new Set(exclusiveKeys);
1195
- const check = checks[(_a = options === null || options === void 0 ? void 0 : options.missingIf) !== null && _a !== void 0 ? _a : 'missing'];
1196
- return makeValidator({
1197
- test: (value, state) => {
1198
- const keys = new Set(Object.keys(value));
1199
- const used = [];
1200
- for (const key of exclusiveSet)
1201
- if (check(keys, key, value))
1202
- used.push(key);
1203
- if (used.length > 1)
1204
- return pushError(state, `Mutually exclusive properties ${getPrintableArray(used, `and`)}`);
1205
- return true;
1206
- },
1207
- });
1208
- }
1209
- (function (KeyRelationship) {
1210
- KeyRelationship["Forbids"] = "Forbids";
1211
- KeyRelationship["Requires"] = "Requires";
1212
- })(exports.KeyRelationship || (exports.KeyRelationship = {}));
1213
- const keyRelationships = {
1214
- [exports.KeyRelationship.Forbids]: {
1215
- expect: false,
1216
- message: `forbids using`,
1217
- },
1218
- [exports.KeyRelationship.Requires]: {
1219
- expect: true,
1220
- message: `requires using`,
1221
- },
1222
- };
1223
- /**
1224
- * Create a validator that checks that, when the specified subject property is
1225
- * set, the relationship is satisfied.
1226
- */
1227
- function hasKeyRelationship(subject, relationship, others, options) {
1228
- var _a, _b;
1229
- const skipped = new Set((_a = options === null || options === void 0 ? void 0 : options.ignore) !== null && _a !== void 0 ? _a : []);
1230
- const check = checks[(_b = options === null || options === void 0 ? void 0 : options.missingIf) !== null && _b !== void 0 ? _b : 'missing'];
1231
- const otherSet = new Set(others);
1232
- const spec = keyRelationships[relationship];
1233
- const conjunction = relationship === exports.KeyRelationship.Forbids
1234
- ? `or`
1235
- : `and`;
1236
- return makeValidator({
1237
- test: (value, state) => {
1238
- const keys = new Set(Object.keys(value));
1239
- if (!check(keys, subject, value) || skipped.has(value[subject]))
1240
- return true;
1241
- const problems = [];
1242
- for (const key of otherSet)
1243
- if ((check(keys, key, value) && !skipped.has(value[key])) !== spec.expect)
1244
- problems.push(key);
1245
- if (problems.length >= 1)
1246
- return pushError(state, `Property "${subject}" ${spec.message} ${plural(problems.length, `property`, `properties`)} ${getPrintableArray(problems, conjunction)}`);
1247
- return true;
1248
- },
1249
- });
1250
- }
1251
-
1252
- exports.TypeAssertionError = TypeAssertionError;
1253
- exports.applyCascade = applyCascade;
1254
- exports.as = as;
1255
- exports.assert = assert;
1256
- exports.assertWithErrors = assertWithErrors;
1257
- exports.cascade = cascade;
1258
- exports.fn = fn;
1259
- exports.hasAtLeastOneKey = hasAtLeastOneKey;
1260
- exports.hasExactLength = hasExactLength;
1261
- exports.hasForbiddenKeys = hasForbiddenKeys;
1262
- exports.hasKeyRelationship = hasKeyRelationship;
1263
- exports.hasMaxLength = hasMaxLength;
1264
- exports.hasMinLength = hasMinLength;
1265
- exports.hasMutuallyExclusiveKeys = hasMutuallyExclusiveKeys;
1266
- exports.hasRequiredKeys = hasRequiredKeys;
1267
- exports.hasUniqueItems = hasUniqueItems;
1268
- exports.isArray = isArray;
1269
- exports.isAtLeast = isAtLeast;
1270
- exports.isAtMost = isAtMost;
1271
- exports.isBase64 = isBase64;
1272
- exports.isBoolean = isBoolean;
1273
- exports.isDate = isDate;
1274
- exports.isDict = isDict;
1275
- exports.isEnum = isEnum;
1276
- exports.isHexColor = isHexColor;
1277
- exports.isISO8601 = isISO8601;
1278
- exports.isInExclusiveRange = isInExclusiveRange;
1279
- exports.isInInclusiveRange = isInInclusiveRange;
1280
- exports.isInstanceOf = isInstanceOf;
1281
- exports.isInteger = isInteger;
1282
- exports.isJSON = isJSON;
1283
- exports.isLiteral = isLiteral;
1284
- exports.isLowerCase = isLowerCase;
1285
- exports.isMap = isMap;
1286
- exports.isNegative = isNegative;
1287
- exports.isNullable = isNullable;
1288
- exports.isNumber = isNumber;
1289
- exports.isObject = isObject;
1290
- exports.isOneOf = isOneOf;
1291
- exports.isOptional = isOptional;
1292
- exports.isPartial = isPartial;
1293
- exports.isPayload = isPayload;
1294
- exports.isPositive = isPositive;
1295
- exports.isRecord = isRecord;
1296
- exports.isSet = isSet;
1297
- exports.isString = isString;
1298
- exports.isTuple = isTuple;
1299
- exports.isUUID4 = isUUID4;
1300
- exports.isUnknown = isUnknown;
1301
- exports.isUpperCase = isUpperCase;
1302
- exports.makeTrait = makeTrait;
1303
- exports.makeValidator = makeValidator;
1304
- exports.matchesRegExp = matchesRegExp;
1305
- exports.softAssert = softAssert;