@blazetrails/ruby-compat 0.0.0-stage → 0.1.0-alpha0.1

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 (622) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +6 -0
  3. package/README.md +440 -2
  4. package/dist/argument-error.d.ts +15 -0
  5. package/dist/argument-error.js +15 -0
  6. package/dist/argument-error.js.map +1 -0
  7. package/dist/array.d.ts +415 -0
  8. package/dist/array.js +1330 -0
  9. package/dist/array.js.map +1 -0
  10. package/dist/async-context-adapter.d.ts +19 -0
  11. package/dist/async-context-adapter.js +139 -0
  12. package/dist/async-context-adapter.js.map +1 -0
  13. package/dist/backtrace-location.d.ts +77 -0
  14. package/dist/backtrace-location.js +155 -0
  15. package/dist/backtrace-location.js.map +1 -0
  16. package/dist/base64.d.ts +73 -0
  17. package/dist/base64.js +164 -0
  18. package/dist/base64.js.map +1 -0
  19. package/dist/benchmark.d.ts +19 -0
  20. package/dist/benchmark.js +16 -0
  21. package/dist/benchmark.js.map +1 -0
  22. package/dist/big-decimal.d.ts +110 -0
  23. package/dist/big-decimal.js +582 -0
  24. package/dist/big-decimal.js.map +1 -0
  25. package/dist/bundler.d.ts +44 -0
  26. package/dist/bundler.js +101 -0
  27. package/dist/bundler.js.map +1 -0
  28. package/dist/cgi.d.ts +89 -0
  29. package/dist/cgi.js +168 -0
  30. package/dist/cgi.js.map +1 -0
  31. package/dist/child-process-adapter.d.ts +110 -0
  32. package/dist/child-process-adapter.js +272 -0
  33. package/dist/child-process-adapter.js.map +1 -0
  34. package/dist/class-module.d.ts +10 -0
  35. package/dist/class-module.js +10 -0
  36. package/dist/class-module.js.map +1 -0
  37. package/dist/classpath.d.ts +90 -0
  38. package/dist/classpath.js +207 -0
  39. package/dist/classpath.js.map +1 -0
  40. package/dist/closed-queue-error.d.ts +10 -0
  41. package/dist/closed-queue-error.js +10 -0
  42. package/dist/closed-queue-error.js.map +1 -0
  43. package/dist/comparable.d.ts +127 -0
  44. package/dist/comparable.js +376 -0
  45. package/dist/comparable.js.map +1 -0
  46. package/dist/complex.d.ts +48 -0
  47. package/dist/complex.js +162 -0
  48. package/dist/complex.js.map +1 -0
  49. package/dist/concurrent/atomic-boolean.d.ts +24 -0
  50. package/dist/concurrent/atomic-boolean.js +43 -0
  51. package/dist/concurrent/atomic-boolean.js.map +1 -0
  52. package/dist/concurrent/atomic-fixnum.d.ts +21 -0
  53. package/dist/concurrent/atomic-fixnum.js +35 -0
  54. package/dist/concurrent/atomic-fixnum.js.map +1 -0
  55. package/dist/concurrent/count-down-latch.d.ts +20 -0
  56. package/dist/concurrent/count-down-latch.js +50 -0
  57. package/dist/concurrent/count-down-latch.js.map +1 -0
  58. package/dist/concurrent/cyclic-barrier.d.ts +18 -0
  59. package/dist/concurrent/cyclic-barrier.js +50 -0
  60. package/dist/concurrent/cyclic-barrier.js.map +1 -0
  61. package/dist/concurrent/event.d.ts +19 -0
  62. package/dist/concurrent/event.js +31 -0
  63. package/dist/concurrent/event.js.map +1 -0
  64. package/dist/concurrent/map.d.ts +149 -0
  65. package/dist/concurrent/map.js +202 -0
  66. package/dist/concurrent/map.js.map +1 -0
  67. package/dist/concurrent/read-write-lock.d.ts +25 -0
  68. package/dist/concurrent/read-write-lock.js +70 -0
  69. package/dist/concurrent/read-write-lock.js.map +1 -0
  70. package/dist/concurrent/semaphore.d.ts +24 -0
  71. package/dist/concurrent/semaphore.js +74 -0
  72. package/dist/concurrent/semaphore.js.map +1 -0
  73. package/dist/concurrent/timer-task.d.ts +52 -0
  74. package/dist/concurrent/timer-task.js +112 -0
  75. package/dist/concurrent/timer-task.js.map +1 -0
  76. package/dist/constants.generated.d.ts +2 -0
  77. package/dist/constants.generated.js +64 -0
  78. package/dist/constants.generated.js.map +1 -0
  79. package/dist/converter-not-found-error.d.ts +14 -0
  80. package/dist/converter-not-found-error.js +14 -0
  81. package/dist/converter-not-found-error.js.map +1 -0
  82. package/dist/crypto-adapter.d.ts +64 -0
  83. package/dist/crypto-adapter.js +365 -0
  84. package/dist/crypto-adapter.js.map +1 -0
  85. package/dist/delegate.d.ts +156 -0
  86. package/dist/delegate.js +306 -0
  87. package/dist/delegate.js.map +1 -0
  88. package/dist/digest.d.ts +99 -0
  89. package/dist/digest.js +131 -0
  90. package/dist/digest.js.map +1 -0
  91. package/dist/dir.d.ts +218 -0
  92. package/dist/dir.js +599 -0
  93. package/dist/dir.js.map +1 -0
  94. package/dist/encoding-error.d.ts +14 -0
  95. package/dist/encoding-error.js +17 -0
  96. package/dist/encoding-error.js.map +1 -0
  97. package/dist/encoding.d.ts +121 -0
  98. package/dist/encoding.js +306 -0
  99. package/dist/encoding.js.map +1 -0
  100. package/dist/ensure.d.ts +15 -0
  101. package/dist/ensure.js +35 -0
  102. package/dist/ensure.js.map +1 -0
  103. package/dist/enumerable.d.ts +375 -0
  104. package/dist/enumerable.js +1100 -0
  105. package/dist/enumerable.js.map +1 -0
  106. package/dist/enumerator.d.ts +321 -0
  107. package/dist/enumerator.js +642 -0
  108. package/dist/enumerator.js.map +1 -0
  109. package/dist/eof-error.d.ts +14 -0
  110. package/dist/eof-error.js +14 -0
  111. package/dist/eof-error.js.map +1 -0
  112. package/dist/errno.d.ts +327 -0
  113. package/dist/errno.js +452 -0
  114. package/dist/errno.js.map +1 -0
  115. package/dist/exc-detailed-message.d.ts +15 -0
  116. package/dist/exc-detailed-message.js +106 -0
  117. package/dist/exc-detailed-message.js.map +1 -0
  118. package/dist/exc-to-s.d.ts +10 -0
  119. package/dist/exc-to-s.js +21 -0
  120. package/dist/exc-to-s.js.map +1 -0
  121. package/dist/exception.d.ts +34 -0
  122. package/dist/exception.js +99 -0
  123. package/dist/exception.js.map +1 -0
  124. package/dist/fiber-error.d.ts +12 -0
  125. package/dist/fiber-error.js +12 -0
  126. package/dist/fiber-error.js.map +1 -0
  127. package/dist/fiber.d.ts +51 -0
  128. package/dist/fiber.js +178 -0
  129. package/dist/fiber.js.map +1 -0
  130. package/dist/file-utils.d.ts +480 -0
  131. package/dist/file-utils.js +1823 -0
  132. package/dist/file-utils.js.map +1 -0
  133. package/dist/file.d.ts +635 -0
  134. package/dist/file.js +1312 -0
  135. package/dist/file.js.map +1 -0
  136. package/dist/float-domain-error.d.ts +17 -0
  137. package/dist/float-domain-error.js +17 -0
  138. package/dist/float-domain-error.js.map +1 -0
  139. package/dist/fork-children.d.ts +23 -0
  140. package/dist/fork-children.js +32 -0
  141. package/dist/fork-children.js.map +1 -0
  142. package/dist/frozen-error.d.ts +33 -0
  143. package/dist/frozen-error.js +42 -0
  144. package/dist/frozen-error.js.map +1 -0
  145. package/dist/fs-adapter.d.ts +158 -0
  146. package/dist/fs-adapter.js +253 -0
  147. package/dist/fs-adapter.js.map +1 -0
  148. package/dist/gem/deprecate.d.ts +10 -0
  149. package/dist/gem/deprecate.js +8 -0
  150. package/dist/gem/deprecate.js.map +1 -0
  151. package/dist/gem/requirement.d.ts +64 -0
  152. package/dist/gem/requirement.js +91 -0
  153. package/dist/gem/requirement.js.map +1 -0
  154. package/dist/gem/version.d.ts +50 -0
  155. package/dist/gem/version.js +148 -0
  156. package/dist/gem/version.js.map +1 -0
  157. package/dist/gem.d.ts +59 -0
  158. package/dist/gem.js +82 -0
  159. package/dist/gem.js.map +1 -0
  160. package/dist/hash.d.ts +967 -0
  161. package/dist/hash.js +1572 -0
  162. package/dist/hash.js.map +1 -0
  163. package/dist/http-adapter.d.ts +123 -0
  164. package/dist/http-adapter.js +220 -0
  165. package/dist/http-adapter.js.map +1 -0
  166. package/dist/immediate-executor.d.ts +20 -0
  167. package/dist/immediate-executor.js +39 -0
  168. package/dist/immediate-executor.js.map +1 -0
  169. package/dist/include.d.ts +778 -0
  170. package/dist/include.js +2195 -0
  171. package/dist/include.js.map +1 -0
  172. package/dist/index-error.d.ts +13 -0
  173. package/dist/index-error.js +13 -0
  174. package/dist/index-error.js.map +1 -0
  175. package/dist/index.d.ts +174 -0
  176. package/dist/index.js +166 -0
  177. package/dist/index.js.map +1 -0
  178. package/dist/invalid-byte-sequence-error.d.ts +62 -0
  179. package/dist/invalid-byte-sequence-error.js +75 -0
  180. package/dist/invalid-byte-sequence-error.js.map +1 -0
  181. package/dist/io-error.d.ts +14 -0
  182. package/dist/io-error.js +17 -0
  183. package/dist/io-error.js.map +1 -0
  184. package/dist/io.d.ts +867 -0
  185. package/dist/io.js +1960 -0
  186. package/dist/io.js.map +1 -0
  187. package/dist/ipaddr.d.ts +79 -0
  188. package/dist/ipaddr.js +405 -0
  189. package/dist/ipaddr.js.map +1 -0
  190. package/dist/json.d.ts +67 -0
  191. package/dist/json.js +185 -0
  192. package/dist/json.js.map +1 -0
  193. package/dist/kernel-catch.d.ts +59 -0
  194. package/dist/kernel-catch.js +184 -0
  195. package/dist/kernel-catch.js.map +1 -0
  196. package/dist/kernel-float.d.ts +19 -0
  197. package/dist/kernel-float.js +54 -0
  198. package/dist/kernel-float.js.map +1 -0
  199. package/dist/kernel-fork.d.ts +30 -0
  200. package/dist/kernel-fork.js +72 -0
  201. package/dist/kernel-fork.js.map +1 -0
  202. package/dist/kernel-format.d.ts +27 -0
  203. package/dist/kernel-format.js +901 -0
  204. package/dist/kernel-format.js.map +1 -0
  205. package/dist/kernel-hash.d.ts +7 -0
  206. package/dist/kernel-hash.js +33 -0
  207. package/dist/kernel-hash.js.map +1 -0
  208. package/dist/kernel-integer.d.ts +49 -0
  209. package/dist/kernel-integer.js +170 -0
  210. package/dist/kernel-integer.js.map +1 -0
  211. package/dist/kernel-rand.d.ts +16 -0
  212. package/dist/kernel-rand.js +237 -0
  213. package/dist/kernel-rand.js.map +1 -0
  214. package/dist/kernel-system.d.ts +40 -0
  215. package/dist/kernel-system.js +97 -0
  216. package/dist/kernel-system.js.map +1 -0
  217. package/dist/kernel-warn.d.ts +35 -0
  218. package/dist/kernel-warn.js +73 -0
  219. package/dist/kernel-warn.js.map +1 -0
  220. package/dist/key-error.d.ts +44 -0
  221. package/dist/key-error.js +59 -0
  222. package/dist/key-error.js.map +1 -0
  223. package/dist/keyword-splat.d.ts +41 -0
  224. package/dist/keyword-splat.js +65 -0
  225. package/dist/keyword-splat.js.map +1 -0
  226. package/dist/load-error.d.ts +19 -0
  227. package/dist/load-error.js +19 -0
  228. package/dist/load-error.js.map +1 -0
  229. package/dist/load.d.ts +121 -0
  230. package/dist/load.js +263 -0
  231. package/dist/load.js.map +1 -0
  232. package/dist/loaded-features.d.ts +13 -0
  233. package/dist/loaded-features.js +15 -0
  234. package/dist/loaded-features.js.map +1 -0
  235. package/dist/local-jump-error.d.ts +12 -0
  236. package/dist/local-jump-error.js +12 -0
  237. package/dist/local-jump-error.js.map +1 -0
  238. package/dist/logger/formatter.d.ts +21 -0
  239. package/dist/logger/formatter.js +43 -0
  240. package/dist/logger/formatter.js.map +1 -0
  241. package/dist/logger/log-device.d.ts +52 -0
  242. package/dist/logger/log-device.js +104 -0
  243. package/dist/logger/log-device.js.map +1 -0
  244. package/dist/logger/severity.d.ts +23 -0
  245. package/dist/logger/severity.js +42 -0
  246. package/dist/logger/severity.js.map +1 -0
  247. package/dist/logger.d.ts +127 -0
  248. package/dist/logger.js +215 -0
  249. package/dist/logger.js.map +1 -0
  250. package/dist/marshal.d.ts +83 -0
  251. package/dist/marshal.js +1487 -0
  252. package/dist/marshal.js.map +1 -0
  253. package/dist/match-data.d.ts +161 -0
  254. package/dist/match-data.js +284 -0
  255. package/dist/match-data.js.map +1 -0
  256. package/dist/method-cache.d.ts +17 -0
  257. package/dist/method-cache.js +19 -0
  258. package/dist/method-cache.js.map +1 -0
  259. package/dist/method-missing-proxy.d.ts +53 -0
  260. package/dist/method-missing-proxy.js +154 -0
  261. package/dist/method-missing-proxy.js.map +1 -0
  262. package/dist/method.d.ts +132 -0
  263. package/dist/method.js +320 -0
  264. package/dist/method.js.map +1 -0
  265. package/dist/monitor.d.ts +114 -0
  266. package/dist/monitor.js +270 -0
  267. package/dist/monitor.js.map +1 -0
  268. package/dist/mutex.d.ts +51 -0
  269. package/dist/mutex.js +150 -0
  270. package/dist/mutex.js.map +1 -0
  271. package/dist/name-error.d.ts +45 -0
  272. package/dist/name-error.js +54 -0
  273. package/dist/name-error.js.map +1 -0
  274. package/dist/net/http/exceptions.d.ts +31 -0
  275. package/dist/net/http/exceptions.js +46 -0
  276. package/dist/net/http/exceptions.js.map +1 -0
  277. package/dist/net/http/request.d.ts +137 -0
  278. package/dist/net/http/request.js +559 -0
  279. package/dist/net/http/request.js.map +1 -0
  280. package/dist/net/http/requests.d.ts +197 -0
  281. package/dist/net/http/requests.js +197 -0
  282. package/dist/net/http/requests.js.map +1 -0
  283. package/dist/net/http/response.d.ts +141 -0
  284. package/dist/net/http/response.js +416 -0
  285. package/dist/net/http/response.js.map +1 -0
  286. package/dist/net/http/responses.d.ts +345 -0
  287. package/dist/net/http/responses.js +486 -0
  288. package/dist/net/http/responses.js.map +1 -0
  289. package/dist/net/http.d.ts +278 -0
  290. package/dist/net/http.js +760 -0
  291. package/dist/net/http.js.map +1 -0
  292. package/dist/net/protocol.d.ts +227 -0
  293. package/dist/net/protocol.js +392 -0
  294. package/dist/net/protocol.js.map +1 -0
  295. package/dist/nil-class.d.ts +10 -0
  296. package/dist/nil-class.js +27 -0
  297. package/dist/nil-class.js.map +1 -0
  298. package/dist/no-method-error.d.ts +38 -0
  299. package/dist/no-method-error.js +45 -0
  300. package/dist/no-method-error.js.map +1 -0
  301. package/dist/not-implemented-error.d.ts +13 -0
  302. package/dist/not-implemented-error.js +14 -0
  303. package/dist/not-implemented-error.js.map +1 -0
  304. package/dist/numeric.d.ts +211 -0
  305. package/dist/numeric.js +802 -0
  306. package/dist/numeric.js.map +1 -0
  307. package/dist/object-space.d.ts +34 -0
  308. package/dist/object-space.js +152 -0
  309. package/dist/object-space.js.map +1 -0
  310. package/dist/object.d.ts +908 -0
  311. package/dist/object.js +2238 -0
  312. package/dist/object.js.map +1 -0
  313. package/dist/open-uri.d.ts +180 -0
  314. package/dist/open-uri.js +402 -0
  315. package/dist/open-uri.js.map +1 -0
  316. package/dist/open3.d.ts +69 -0
  317. package/dist/open3.js +134 -0
  318. package/dist/open3.js.map +1 -0
  319. package/dist/openssl.d.ts +479 -0
  320. package/dist/openssl.js +1052 -0
  321. package/dist/openssl.js.map +1 -0
  322. package/dist/optparse.d.ts +130 -0
  323. package/dist/optparse.js +457 -0
  324. package/dist/optparse.js.map +1 -0
  325. package/dist/os-adapter.d.ts +20 -0
  326. package/dist/os-adapter.js +95 -0
  327. package/dist/os-adapter.js.map +1 -0
  328. package/dist/pathname.d.ts +71 -0
  329. package/dist/pathname.js +394 -0
  330. package/dist/pathname.js.map +1 -0
  331. package/dist/pp.d.ts +60 -0
  332. package/dist/pp.js +195 -0
  333. package/dist/pp.js.map +1 -0
  334. package/dist/pretty-print.d.ts +89 -0
  335. package/dist/pretty-print.js +232 -0
  336. package/dist/pretty-print.js.map +1 -0
  337. package/dist/process-adapter.d.ts +224 -0
  338. package/dist/process-adapter.js +878 -0
  339. package/dist/process-adapter.js.map +1 -0
  340. package/dist/process.d.ts +192 -0
  341. package/dist/process.js +403 -0
  342. package/dist/process.js.map +1 -0
  343. package/dist/psych/class-loader.d.ts +92 -0
  344. package/dist/psych/class-loader.js +139 -0
  345. package/dist/psych/class-loader.js.map +1 -0
  346. package/dist/psych/coder.d.ts +144 -0
  347. package/dist/psych/coder.js +176 -0
  348. package/dist/psych/coder.js.map +1 -0
  349. package/dist/psych/core-ext.d.ts +8 -0
  350. package/dist/psych/core-ext.js +10 -0
  351. package/dist/psych/core-ext.js.map +1 -0
  352. package/dist/psych/emitter.d.ts +116 -0
  353. package/dist/psych/emitter.js +1130 -0
  354. package/dist/psych/emitter.js.map +1 -0
  355. package/dist/psych/exception.d.ts +43 -0
  356. package/dist/psych/exception.js +54 -0
  357. package/dist/psych/exception.js.map +1 -0
  358. package/dist/psych/handler.d.ts +59 -0
  359. package/dist/psych/handler.js +95 -0
  360. package/dist/psych/handler.js.map +1 -0
  361. package/dist/psych/handlers/document-stream.d.ts +17 -0
  362. package/dist/psych/handlers/document-stream.js +26 -0
  363. package/dist/psych/handlers/document-stream.js.map +1 -0
  364. package/dist/psych/nodes/alias.d.ts +15 -0
  365. package/dist/psych/nodes/alias.js +22 -0
  366. package/dist/psych/nodes/alias.js.map +1 -0
  367. package/dist/psych/nodes/document.d.ts +23 -0
  368. package/dist/psych/nodes/document.js +35 -0
  369. package/dist/psych/nodes/document.js.map +1 -0
  370. package/dist/psych/nodes/mapping.d.ts +25 -0
  371. package/dist/psych/nodes/mapping.js +35 -0
  372. package/dist/psych/nodes/mapping.js.map +1 -0
  373. package/dist/psych/nodes/node.d.ts +59 -0
  374. package/dist/psych/nodes/node.js +79 -0
  375. package/dist/psych/nodes/node.js.map +1 -0
  376. package/dist/psych/nodes/scalar.d.ts +35 -0
  377. package/dist/psych/nodes/scalar.js +47 -0
  378. package/dist/psych/nodes/scalar.js.map +1 -0
  379. package/dist/psych/nodes/sequence.d.ts +25 -0
  380. package/dist/psych/nodes/sequence.js +35 -0
  381. package/dist/psych/nodes/sequence.js.map +1 -0
  382. package/dist/psych/nodes/stream.d.ts +23 -0
  383. package/dist/psych/nodes/stream.js +31 -0
  384. package/dist/psych/nodes/stream.js.map +1 -0
  385. package/dist/psych/omap.d.ts +9 -0
  386. package/dist/psych/omap.js +9 -0
  387. package/dist/psych/omap.js.map +1 -0
  388. package/dist/psych/parser.d.ts +41 -0
  389. package/dist/psych/parser.js +139 -0
  390. package/dist/psych/parser.js.map +1 -0
  391. package/dist/psych/scalar-scanner.d.ts +35 -0
  392. package/dist/psych/scalar-scanner.js +173 -0
  393. package/dist/psych/scalar-scanner.js.map +1 -0
  394. package/dist/psych/syntax-error.d.ts +23 -0
  395. package/dist/psych/syntax-error.js +35 -0
  396. package/dist/psych/syntax-error.js.map +1 -0
  397. package/dist/psych/tree-builder.d.ts +51 -0
  398. package/dist/psych/tree-builder.js +118 -0
  399. package/dist/psych/tree-builder.js.map +1 -0
  400. package/dist/psych/visitors/depth-first.d.ts +27 -0
  401. package/dist/psych/visitors/depth-first.js +37 -0
  402. package/dist/psych/visitors/depth-first.js.map +1 -0
  403. package/dist/psych/visitors/emitter.d.ts +32 -0
  404. package/dist/psych/visitors/emitter.js +63 -0
  405. package/dist/psych/visitors/emitter.js.map +1 -0
  406. package/dist/psych/visitors/to-ruby.d.ts +110 -0
  407. package/dist/psych/visitors/to-ruby.js +396 -0
  408. package/dist/psych/visitors/to-ruby.js.map +1 -0
  409. package/dist/psych/visitors/visitor.d.ts +11 -0
  410. package/dist/psych/visitors/visitor.js +17 -0
  411. package/dist/psych/visitors/visitor.js.map +1 -0
  412. package/dist/psych/visitors/yaml-tree.d.ts +182 -0
  413. package/dist/psych/visitors/yaml-tree.js +593 -0
  414. package/dist/psych/visitors/yaml-tree.js.map +1 -0
  415. package/dist/psych-adapter.d.ts +65 -0
  416. package/dist/psych-adapter.js +121 -0
  417. package/dist/psych-adapter.js.map +1 -0
  418. package/dist/psych-yaml.d.ts +2 -0
  419. package/dist/psych-yaml.js +5 -0
  420. package/dist/psych-yaml.js.map +1 -0
  421. package/dist/psych.d.ts +257 -0
  422. package/dist/psych.js +332 -0
  423. package/dist/psych.js.map +1 -0
  424. package/dist/queue.d.ts +129 -0
  425. package/dist/queue.js +215 -0
  426. package/dist/queue.js.map +1 -0
  427. package/dist/racc/parser.d.ts +70 -0
  428. package/dist/racc/parser.js +206 -0
  429. package/dist/racc/parser.js.map +1 -0
  430. package/dist/range-error.d.ts +15 -0
  431. package/dist/range-error.js +15 -0
  432. package/dist/range-error.js.map +1 -0
  433. package/dist/range.d.ts +166 -0
  434. package/dist/range.js +421 -0
  435. package/dist/range.js.map +1 -0
  436. package/dist/rational.d.ts +167 -0
  437. package/dist/rational.js +379 -0
  438. package/dist/rational.js.map +1 -0
  439. package/dist/rb-config.d.ts +33 -0
  440. package/dist/rb-config.js +53 -0
  441. package/dist/rb-config.js.map +1 -0
  442. package/dist/rb-equal.d.ts +66 -0
  443. package/dist/rb-equal.js +261 -0
  444. package/dist/rb-equal.js.map +1 -0
  445. package/dist/rb-hash.d.ts +26 -0
  446. package/dist/rb-hash.js +108 -0
  447. package/dist/rb-hash.js.map +1 -0
  448. package/dist/regexp.d.ts +82 -0
  449. package/dist/regexp.js +191 -0
  450. package/dist/regexp.js.map +1 -0
  451. package/dist/repl-adapter.d.ts +188 -0
  452. package/dist/repl-adapter.js +388 -0
  453. package/dist/repl-adapter.js.map +1 -0
  454. package/dist/resolv.d.ts +30 -0
  455. package/dist/resolv.js +48 -0
  456. package/dist/resolv.js.map +1 -0
  457. package/dist/ruby-empty.d.ts +28 -0
  458. package/dist/ruby-empty.js +40 -0
  459. package/dist/ruby-empty.js.map +1 -0
  460. package/dist/ruby-platform.d.ts +39 -0
  461. package/dist/ruby-platform.js +49 -0
  462. package/dist/ruby-platform.js.map +1 -0
  463. package/dist/runtime-error.d.ts +15 -0
  464. package/dist/runtime-error.js +16 -0
  465. package/dist/runtime-error.js.map +1 -0
  466. package/dist/scheduled-task.d.ts +73 -0
  467. package/dist/scheduled-task.js +150 -0
  468. package/dist/scheduled-task.js.map +1 -0
  469. package/dist/secure-random.d.ts +33 -0
  470. package/dist/secure-random.js +78 -0
  471. package/dist/secure-random.js.map +1 -0
  472. package/dist/set.d.ts +158 -0
  473. package/dist/set.js +352 -0
  474. package/dist/set.js.map +1 -0
  475. package/dist/shellwords.d.ts +27 -0
  476. package/dist/shellwords.js +53 -0
  477. package/dist/shellwords.js.map +1 -0
  478. package/dist/signal-exception.d.ts +21 -0
  479. package/dist/signal-exception.js +21 -0
  480. package/dist/signal-exception.js.map +1 -0
  481. package/dist/socket.d.ts +230 -0
  482. package/dist/socket.js +484 -0
  483. package/dist/socket.js.map +1 -0
  484. package/dist/standard-error.d.ts +18 -0
  485. package/dist/standard-error.js +23 -0
  486. package/dist/standard-error.js.map +1 -0
  487. package/dist/stop-iteration.d.ts +10 -0
  488. package/dist/stop-iteration.js +10 -0
  489. package/dist/stop-iteration.js.map +1 -0
  490. package/dist/string/b.d.ts +19 -0
  491. package/dist/string/b.js +28 -0
  492. package/dist/string/b.js.map +1 -0
  493. package/dist/string/byte-methods.d.ts +57 -0
  494. package/dist/string/byte-methods.js +266 -0
  495. package/dist/string/byte-methods.js.map +1 -0
  496. package/dist/string/bytes.d.ts +35 -0
  497. package/dist/string/bytes.js +123 -0
  498. package/dist/string/bytes.js.map +1 -0
  499. package/dist/string/case-mapping.d.ts +57 -0
  500. package/dist/string/case-mapping.js +192 -0
  501. package/dist/string/case-mapping.js.map +1 -0
  502. package/dist/string/chomp.d.ts +15 -0
  503. package/dist/string/chomp.js +32 -0
  504. package/dist/string/chomp.js.map +1 -0
  505. package/dist/string/convert.d.ts +55 -0
  506. package/dist/string/convert.js +316 -0
  507. package/dist/string/convert.js.map +1 -0
  508. package/dist/string/delete.d.ts +14 -0
  509. package/dist/string/delete.js +17 -0
  510. package/dist/string/delete.js.map +1 -0
  511. package/dist/string/each.d.ts +108 -0
  512. package/dist/string/each.js +305 -0
  513. package/dist/string/each.js.map +1 -0
  514. package/dist/string/encode.d.ts +37 -0
  515. package/dist/string/encode.js +268 -0
  516. package/dist/string/encode.js.map +1 -0
  517. package/dist/string/force-encoding.d.ts +72 -0
  518. package/dist/string/force-encoding.js +147 -0
  519. package/dist/string/force-encoding.js.map +1 -0
  520. package/dist/string/inspect.d.ts +17 -0
  521. package/dist/string/inspect.js +81 -0
  522. package/dist/string/inspect.js.map +1 -0
  523. package/dist/string/method-table.d.ts +174 -0
  524. package/dist/string/method-table.js +805 -0
  525. package/dist/string/method-table.js.map +1 -0
  526. package/dist/string/scrub.d.ts +12 -0
  527. package/dist/string/scrub.js +33 -0
  528. package/dist/string/scrub.js.map +1 -0
  529. package/dist/string/slice.d.ts +26 -0
  530. package/dist/string/slice.js +73 -0
  531. package/dist/string/slice.js.map +1 -0
  532. package/dist/string/split.d.ts +11 -0
  533. package/dist/string/split.js +44 -0
  534. package/dist/string/split.js.map +1 -0
  535. package/dist/string/sub.d.ts +114 -0
  536. package/dist/string/sub.js +371 -0
  537. package/dist/string/sub.js.map +1 -0
  538. package/dist/string/succ.d.ts +14 -0
  539. package/dist/string/succ.js +118 -0
  540. package/dist/string/succ.js.map +1 -0
  541. package/dist/string/support.d.ts +135 -0
  542. package/dist/string/support.js +283 -0
  543. package/dist/string/support.js.map +1 -0
  544. package/dist/string/tr.d.ts +46 -0
  545. package/dist/string/tr.js +156 -0
  546. package/dist/string/tr.js.map +1 -0
  547. package/dist/string-io.d.ts +166 -0
  548. package/dist/string-io.js +248 -0
  549. package/dist/string-io.js.map +1 -0
  550. package/dist/string-scanner.d.ts +133 -0
  551. package/dist/string-scanner.js +248 -0
  552. package/dist/string-scanner.js.map +1 -0
  553. package/dist/struct.d.ts +54 -0
  554. package/dist/struct.js +222 -0
  555. package/dist/struct.js.map +1 -0
  556. package/dist/symbol.d.ts +48 -0
  557. package/dist/symbol.js +107 -0
  558. package/dist/symbol.js.map +1 -0
  559. package/dist/tempfile.d.ts +173 -0
  560. package/dist/tempfile.js +290 -0
  561. package/dist/tempfile.js.map +1 -0
  562. package/dist/temporal-tag.d.ts +23 -0
  563. package/dist/temporal-tag.js +29 -0
  564. package/dist/temporal-tag.js.map +1 -0
  565. package/dist/thread-error.d.ts +13 -0
  566. package/dist/thread-error.js +13 -0
  567. package/dist/thread-error.js.map +1 -0
  568. package/dist/thread-pool-executor.d.ts +119 -0
  569. package/dist/thread-pool-executor.js +250 -0
  570. package/dist/thread-pool-executor.js.map +1 -0
  571. package/dist/thread.d.ts +211 -0
  572. package/dist/thread.js +495 -0
  573. package/dist/thread.js.map +1 -0
  574. package/dist/timeout.d.ts +29 -0
  575. package/dist/timeout.js +41 -0
  576. package/dist/timeout.js.map +1 -0
  577. package/dist/tse.d.ts +40 -0
  578. package/dist/tse.js +62 -0
  579. package/dist/tse.js.map +1 -0
  580. package/dist/type-error.d.ts +14 -0
  581. package/dist/type-error.js +15 -0
  582. package/dist/type-error.js.map +1 -0
  583. package/dist/undefined-conversion-error.d.ts +10 -0
  584. package/dist/undefined-conversion-error.js +10 -0
  585. package/dist/undefined-conversion-error.js.map +1 -0
  586. package/dist/uri/common.d.ts +209 -0
  587. package/dist/uri/common.js +369 -0
  588. package/dist/uri/common.js.map +1 -0
  589. package/dist/uri/generic.d.ts +283 -0
  590. package/dist/uri/generic.js +810 -0
  591. package/dist/uri/generic.js.map +1 -0
  592. package/dist/uri/http.d.ts +23 -0
  593. package/dist/uri/http.js +30 -0
  594. package/dist/uri/http.js.map +1 -0
  595. package/dist/uri/https.d.ts +13 -0
  596. package/dist/uri/https.js +15 -0
  597. package/dist/uri/https.js.map +1 -0
  598. package/dist/uri/rfc2396-parser.d.ts +70 -0
  599. package/dist/uri/rfc2396-parser.js +264 -0
  600. package/dist/uri/rfc2396-parser.js.map +1 -0
  601. package/dist/uri/rfc3986-parser.d.ts +46 -0
  602. package/dist/uri/rfc3986-parser.js +171 -0
  603. package/dist/uri/rfc3986-parser.js.map +1 -0
  604. package/dist/uri.d.ts +13 -0
  605. package/dist/uri.js +13 -0
  606. package/dist/uri.js.map +1 -0
  607. package/dist/variable.d.ts +183 -0
  608. package/dist/variable.js +463 -0
  609. package/dist/variable.js.map +1 -0
  610. package/dist/verbose.d.ts +21 -0
  611. package/dist/verbose.js +26 -0
  612. package/dist/verbose.js.map +1 -0
  613. package/dist/yaml.d.ts +9 -0
  614. package/dist/yaml.js +9 -0
  615. package/dist/yaml.js.map +1 -0
  616. package/dist/zlib-adapter.d.ts +117 -0
  617. package/dist/zlib-adapter.js +250 -0
  618. package/dist/zlib-adapter.js.map +1 -0
  619. package/dist/zlib.d.ts +248 -0
  620. package/dist/zlib.js +362 -0
  621. package/dist/zlib.js.map +1 -0
  622. package/package.json +82 -3
@@ -0,0 +1,127 @@
1
+ /**
2
+ * Ruby's core `Comparable` module (`vendor/ruby/v3.3.11/compar.c:313`
3
+ * `Init_Comparable`) and the `<=>` send its members derive from. JS has no
4
+ * `<=>` and no module to include, so both halves live here: {@link cmp} is the
5
+ * send, and the derived operators are `this`-typed functions a class assigns to
6
+ * itself (CLAUDE.md "Module mixins"), which is the settled idiom for a module
7
+ * whose members need a Ruby-shaped receiver rather than a bulk splice.
8
+ *
9
+ * The nullable return is the point: Ruby's `<=>` answers **nil** for an operand
10
+ * it cannot place, and a `cmp` typed `number` silently loses that arm. Every
11
+ * derived operator goes through {@link cmpint}, which turns that nil into
12
+ * `rb_cmperr`'s `ArgumentError`; `equals` is the one that does not raise.
13
+ *
14
+ * @boundary-file: a JS `Date` is compared as epoch millis, since Ruby's
15
+ * `Time#<=>` (`vendor/ruby/v3.3.11/time.c:3951` `time_cmp`) orders by the instant and
16
+ * JS `Date` carries no relational operators of its own.
17
+ */
18
+ /**
19
+ * The receiver of the mixin: a class that defines `<=>`, spelled `compareTo`
20
+ * here since `Comparable#==` already claims `equals`.
21
+ * @noRailsEquivalent PERMANENT — Ruby core `Comparable` (`vendor/ruby/v3.3.11/compar.c:315`).
22
+ */
23
+ export interface Comparable {
24
+ compareTo(other: unknown): number | null;
25
+ }
26
+ /**
27
+ * Ruby's `a <=> b` over the values trails carries: the receiver's own `<=>`
28
+ * when it has one, and otherwise the relational reading `Integer#<=>`,
29
+ * `Float#<=>` and `String#<=>` each define, falling back to the inherited
30
+ * `Object#<=>` (`vendor/ruby/v3.3.11/object.c:1665` `rb_obj_cmp`) for everything else.
31
+ * `nil` for an operand it cannot place, which includes `Float::NAN`, a
32
+ * cross-type operand, and `rb_obj_cmp`'s unequal arm.
33
+ *
34
+ * @boundary: a Temporal value carrying an instant is trails' seat for a Ruby
35
+ * `Time`, whose `<=>` (`vendor/ruby/v3.3.11/time.c:3951` `time_cmp`) orders by that
36
+ * instant, so it is ordered on `epochNanoseconds` — reached through
37
+ * {@link rbObjClassname}'s `Time` arm, which seats that reading, rather than
38
+ * through `@blazetrails/date`, which this package does not depend on. The receiver's
39
+ * own `<=>` still wins, as it does in Ruby. A Temporal value carrying no
40
+ * instant still reaches `rb_obj_cmp`;
41
+ * `calculations.ts`'s `compare` — the one caller that orders those — hands
42
+ * over each side's epoch reading instead, and a pair of plain Temporal values
43
+ * of the same shape is ordered by that shape's own `compare`, after a
44
+ * `PlainDate` is widened to its `PlainDateTime`: Ruby's `cmp_dd`
45
+ * (`date_core.c:6707-6761`) places a day against an instant on the same axis,
46
+ * which is what makes `Date.new(2002,3,19) == DateTime.new(2002,3,19, 0,0,0)`
47
+ * true.
48
+ *
49
+ * @noRailsEquivalent PERMANENT — Ruby core `Comparable` — the `<=>` send it is defined over
50
+ * (`vendor/ruby/v3.3.11/compar.c:315`), which Rails inherits rather than defines.
51
+ */
52
+ export declare function cmp(a: unknown, b: unknown): number | null;
53
+ /**
54
+ * Ruby's `rb_cmpint` (`vendor/ruby/v3.3.11/bignum.c:2959`), which turns a `<=>` result
55
+ * into a C int and sends a `nil` one to `rb_cmperr` — the free-function form
56
+ * `Array#max` reaches through `OPTIMIZED_CMP`, where {@link cmpint} is the
57
+ * `Comparable` method form.
58
+ * @noRailsEquivalent PERMANENT — Ruby core `rb_cmpint` (`vendor/ruby/v3.3.11/bignum.c:2959`).
59
+ */
60
+ export declare function rbCmpint(val: number | null | undefined, a: unknown, b: unknown): number;
61
+ /**
62
+ * Ruby's `cmpint` (`vendor/ruby/v3.3.11/compar.c:91`), the one body every operator
63
+ * below is derived from: a `nil` `<=>` is an `ArgumentError`, not a `false`.
64
+ * @noRailsEquivalent PERMANENT — Ruby core `Comparable` `cmpint` (`vendor/ruby/v3.3.11/compar.c:91`).
65
+ */
66
+ export declare function cmpint(this: Comparable, other: unknown): number;
67
+ /**
68
+ * Ruby `Comparable#<` (`vendor/ruby/v3.3.11/compar.c:133` `cmp_lt`).
69
+ * @noRailsEquivalent PERMANENT — Ruby core `Comparable` `cmp_lt` (`vendor/ruby/v3.3.11/compar.c:133`).
70
+ */
71
+ export declare function lessThan(this: Comparable, other: unknown): boolean;
72
+ /**
73
+ * Ruby `Comparable#<=` (`vendor/ruby/v3.3.11/compar.c:147` `cmp_le`).
74
+ * @noRailsEquivalent PERMANENT — Ruby core `Comparable` `cmp_le` (`vendor/ruby/v3.3.11/compar.c:147`).
75
+ */
76
+ export declare function lessThanOrEqual(this: Comparable, other: unknown): boolean;
77
+ /**
78
+ * Ruby `Comparable#>` (`vendor/ruby/v3.3.11/compar.c:105` `cmp_gt`).
79
+ * @noRailsEquivalent PERMANENT — Ruby core `Comparable` `cmp_gt` (`vendor/ruby/v3.3.11/compar.c:105`).
80
+ */
81
+ export declare function greaterThan(this: Comparable, other: unknown): boolean;
82
+ /**
83
+ * Ruby `Comparable#>=` (`vendor/ruby/v3.3.11/compar.c:119` `cmp_ge`).
84
+ * @noRailsEquivalent PERMANENT — Ruby core `Comparable` `cmp_ge` (`vendor/ruby/v3.3.11/compar.c:119`).
85
+ */
86
+ export declare function greaterThanOrEqual(this: Comparable, other: unknown): boolean;
87
+ /**
88
+ * Ruby `Comparable#==` (`vendor/ruby/v3.3.11/compar.c:79` `cmp_equal`), the one derived
89
+ * operator that does NOT raise: a `nil` `<=>` is `false`, and an identical
90
+ * object is `true` before `<=>` is sent at all.
91
+ * @noRailsEquivalent PERMANENT — Ruby core `Comparable` `cmp_equal` (`vendor/ruby/v3.3.11/compar.c:79`).
92
+ */
93
+ export declare function equals(this: Comparable, other: unknown): boolean;
94
+ /**
95
+ * Ruby `Comparable#between?` (`vendor/ruby/v3.3.11/compar.c:168` `cmp_between`), which
96
+ * is `cmpint` on both ends and so raises for an operand `<=>` cannot place.
97
+ * @noRailsEquivalent PERMANENT — Ruby core `Comparable` `cmp_between` (`vendor/ruby/v3.3.11/compar.c:168`).
98
+ */
99
+ export declare function isBetween(this: Comparable, min: unknown, max: unknown): boolean;
100
+ /**
101
+ * Ruby `Array#max` (`vendor/ruby/v3.3.11/array.c:5848` `rb_ary_max`), the
102
+ * no-argument arms. Without a block: `nil` for an empty array, and otherwise
103
+ * the first element carried through `ary_max_generic`
104
+ * (`vendor/ruby/v3.3.11/array.c:5719`). MRI's `CMP_OPTIMIZABLE` fast paths for a
105
+ * Fixnum / String / Float first element are omitted — each one falls back to
106
+ * `ary_max_generic` the moment an element is not of that type, so they change
107
+ * speed, not the answer. With a block: the element the block's `<=>` answer
108
+ * ranks highest, the first of any tie (`vendor/ruby/v3.3.11/array.c:5859-5866`).
109
+ *
110
+ * It lives beside {@link rbCmpint} rather than in an `array.ts` because that is
111
+ * the whole of it: `ary_max_generic` is `rb_cmpint(rb_cmp(vmax, v), vmax, v)`,
112
+ * so a `nil` reaching the comparison is an `ArgumentError`, not a skipped
113
+ * element.
114
+ *
115
+ * @noRailsEquivalent PERMANENT — Ruby core `Array#max` (`vendor/ruby/v3.3.11/array.c:5848`).
116
+ */
117
+ export declare function max<T>(ary: readonly T[], block?: (a: T, b: T) => number | null): T | null;
118
+ /**
119
+ * Ruby `Array#min` (`vendor/ruby/v3.3.11/array.c:6016` `rb_ary_min`), the no-argument,
120
+ * no-block arm — {@link max}'s mirror, carried through `ary_min_generic`
121
+ * (`vendor/ruby/v3.3.11/array.c:5888`), with the same `CMP_OPTIMIZABLE` fast paths
122
+ * omitted.
123
+ *
124
+ * @noRailsEquivalent PERMANENT — Ruby core `Array#min` (`vendor/ruby/v3.3.11/array.c:6016`).
125
+ */
126
+ export declare function min<T>(ary: readonly T[]): T | null;
127
+ //# sourceMappingURL=comparable.d.ts.map
@@ -0,0 +1,376 @@
1
+ /**
2
+ * Ruby's core `Comparable` module (`vendor/ruby/v3.3.11/compar.c:313`
3
+ * `Init_Comparable`) and the `<=>` send its members derive from. JS has no
4
+ * `<=>` and no module to include, so both halves live here: {@link cmp} is the
5
+ * send, and the derived operators are `this`-typed functions a class assigns to
6
+ * itself (CLAUDE.md "Module mixins"), which is the settled idiom for a module
7
+ * whose members need a Ruby-shaped receiver rather than a bulk splice.
8
+ *
9
+ * The nullable return is the point: Ruby's `<=>` answers **nil** for an operand
10
+ * it cannot place, and a `cmp` typed `number` silently loses that arm. Every
11
+ * derived operator goes through {@link cmpint}, which turns that nil into
12
+ * `rb_cmperr`'s `ArgumentError`; `equals` is the one that does not raise.
13
+ *
14
+ * @boundary-file: a JS `Date` is compared as epoch millis, since Ruby's
15
+ * `Time#<=>` (`vendor/ruby/v3.3.11/time.c:3951` `time_cmp`) orders by the instant and
16
+ * JS `Date` carries no relational operators of its own.
17
+ */
18
+ import { ArgumentError } from "./argument-error.js";
19
+ import { rbCTime, rbInspect, rbObjClass, rbObjClassname, rbObjRespondTo, reopened, } from "./object.js";
20
+ import { kDateP, rbEqual } from "./rb-equal.js";
21
+ import { temporalTag, widenPlainDate } from "./temporal-tag.js";
22
+ import { rbStrCmp } from "./string/support.js";
23
+ /**
24
+ * Ruby's `a <=> b` over the values trails carries: the receiver's own `<=>`
25
+ * when it has one, and otherwise the relational reading `Integer#<=>`,
26
+ * `Float#<=>` and `String#<=>` each define, falling back to the inherited
27
+ * `Object#<=>` (`vendor/ruby/v3.3.11/object.c:1665` `rb_obj_cmp`) for everything else.
28
+ * `nil` for an operand it cannot place, which includes `Float::NAN`, a
29
+ * cross-type operand, and `rb_obj_cmp`'s unequal arm.
30
+ *
31
+ * @boundary: a Temporal value carrying an instant is trails' seat for a Ruby
32
+ * `Time`, whose `<=>` (`vendor/ruby/v3.3.11/time.c:3951` `time_cmp`) orders by that
33
+ * instant, so it is ordered on `epochNanoseconds` — reached through
34
+ * {@link rbObjClassname}'s `Time` arm, which seats that reading, rather than
35
+ * through `@blazetrails/date`, which this package does not depend on. The receiver's
36
+ * own `<=>` still wins, as it does in Ruby. A Temporal value carrying no
37
+ * instant still reaches `rb_obj_cmp`;
38
+ * `calculations.ts`'s `compare` — the one caller that orders those — hands
39
+ * over each side's epoch reading instead, and a pair of plain Temporal values
40
+ * of the same shape is ordered by that shape's own `compare`, after a
41
+ * `PlainDate` is widened to its `PlainDateTime`: Ruby's `cmp_dd`
42
+ * (`date_core.c:6707-6761`) places a day against an instant on the same axis,
43
+ * which is what makes `Date.new(2002,3,19) == DateTime.new(2002,3,19, 0,0,0)`
44
+ * true.
45
+ *
46
+ * @noRailsEquivalent PERMANENT — Ruby core `Comparable` — the `<=>` send it is defined over
47
+ * (`vendor/ruby/v3.3.11/compar.c:315`), which Rails inherits rather than defines.
48
+ */
49
+ export function cmp(a, b) {
50
+ if (a === null || a === undefined || b === null || b === undefined) {
51
+ return a === b ? 0 : null;
52
+ }
53
+ // `time_cmp`'s `rb_invcmp` arm (vendor/ruby/v3.3.11/time.c:3951): `-(other <=> time)`.
54
+ if (a instanceof Date && !(b instanceof Date) && isComparable(b)) {
55
+ const c = b.compareTo(a);
56
+ return c == null ? null : -c;
57
+ }
58
+ // boundary: Date endpoints are compared as epoch millis.
59
+ if (a instanceof Date)
60
+ a = a.getTime();
61
+ if (b instanceof Date)
62
+ b = b.getTime();
63
+ if (a instanceof Number)
64
+ a = a.valueOf();
65
+ if (b instanceof Number)
66
+ b = b.valueOf();
67
+ if (isComparable(a))
68
+ return a.compareTo(b) ?? null;
69
+ if (isCmpSpelling(a))
70
+ return a.cmp(b) ?? null;
71
+ if (rbObjClass(a) === reopened(rbCTime) && rbObjClass(b) === reopened(rbCTime)) {
72
+ if (typeof a.compare === "function") {
73
+ return a.compare(b) ?? null;
74
+ }
75
+ const x = a.epochNanoseconds;
76
+ const y = b.epochNanoseconds;
77
+ if (x !== undefined && y !== undefined)
78
+ return x < y ? -1 : x > y ? 1 : 0;
79
+ }
80
+ // `time_cmp`'s `rb_invcmp` arm (vendor/ruby/v3.3.11/time.c:3951) for a non-Time `other`.
81
+ if (rbObjClass(a) === reopened(rbCTime) &&
82
+ rbObjClass(b) !== reopened(rbCTime) &&
83
+ (isComparable(b) || isCmpSpelling(b))) {
84
+ const c = isComparable(b) ? b.compareTo(a) : b.cmp(a);
85
+ return c == null ? null : -c;
86
+ }
87
+ if (kTemporalDateP(a) && (typeof b === "number" || typeof b === "bigint")) {
88
+ const ajd = mAjd(a);
89
+ const n = Number(b);
90
+ if (Number.isNaN(n))
91
+ return null;
92
+ return ajd < n ? -1 : ajd > n ? 1 : 0;
93
+ }
94
+ if (temporalTag(a) !== null && temporalTag(b) === null) {
95
+ if (kDateP(a) && kDateP(b) && isCmpSpelling(b)) {
96
+ const c = b.cmp(a);
97
+ return c == null ? null : c === 0 ? 0 : -c;
98
+ }
99
+ }
100
+ if (temporalTag(a) !== null && temporalTag(b) !== null) {
101
+ const x = widenPlainDate(a);
102
+ const y = widenPlainDate(b);
103
+ if (temporalTag(x) === temporalTag(y)) {
104
+ return x.constructor.compare(x, y);
105
+ }
106
+ }
107
+ if (typeof a === "number" || typeof a === "bigint") {
108
+ /* `rb_int_cmp` (`vendor/ruby/v3.3.11/numeric.c:4696`) and `flo_cmp`
109
+ (`vendor/ruby/v3.3.11/numeric.c:1700`) answer nil for a non-Numeric, and for NaN. */
110
+ if (Number.isNaN(a))
111
+ return null;
112
+ if (typeof b !== "number" && typeof b !== "bigint") {
113
+ if (typeof a === "number" && !Number.isFinite(a)) {
114
+ const i = kTemporalDateP(b)
115
+ ? false
116
+ : rbObjRespondTo(b, "isInfinite")
117
+ ? b.isInfinite()
118
+ : undefined;
119
+ if (i !== undefined) {
120
+ if (i != null && i !== false) {
121
+ const j = rbCmpint(i, a, b);
122
+ return a > 0 ? (j > 0 ? 0 : 1) : j < 0 ? 0 : -1;
123
+ }
124
+ return a > 0 ? 1 : -1;
125
+ }
126
+ }
127
+ /* `rb_num_coerce_cmp` (`vendor/ruby/v3.3.11/numeric.c:484`) over
128
+ `do_coerce` (`:455`): an operand answering `coerce` is sent it, and
129
+ the pair it returns is compared. */
130
+ if (rbObjRespondTo(b, "coerce")) {
131
+ const ary = b.coerce(a);
132
+ if (ary === null || ary === undefined)
133
+ return null;
134
+ if (!Array.isArray(ary) || ary.length !== 2) {
135
+ throw new TypeError("coerce must return [x, y]");
136
+ }
137
+ return cmp(ary[0], ary[1]);
138
+ }
139
+ return null;
140
+ }
141
+ if (Number.isNaN(b))
142
+ return null;
143
+ return a < b ? -1 : a > b ? 1 : 0;
144
+ }
145
+ if (typeof a === "string") {
146
+ /* `rb_str_cmp_m` (`vendor/ruby/v3.3.11/string.c:3803`): `rb_check_string_type`
147
+ converts an operand answering `to_str`, and anything else goes to
148
+ `rb_invcmp` (`compar.c:43`), the negated reverse `<=>`. */
149
+ const s = typeof b === "string"
150
+ ? b
151
+ : rbObjRespondTo(b, "toStr")
152
+ ? b.toStr()
153
+ : null;
154
+ if (s === null) {
155
+ const inv = cmp(b, a);
156
+ return inv === null ? null : -inv;
157
+ }
158
+ return rbStrCmp(a, s);
159
+ }
160
+ if (Array.isArray(a)) {
161
+ /* `rb_ary_cmp` (`vendor/ruby/v3.3.11/array.c:5303`) and its `recursive_cmp`
162
+ (`:5252`): the first element pair whose `<=>` is not `0` decides, a nil
163
+ one included, and a common prefix is ordered by length. */
164
+ if (!Array.isArray(b))
165
+ return null;
166
+ if (a === b)
167
+ return 0;
168
+ const len = Math.min(a.length, b.length);
169
+ for (let i = 0; i < len; i++) {
170
+ const v = cmp(a[i], b[i]);
171
+ if (v !== 0)
172
+ return v;
173
+ }
174
+ const d = a.length - b.length;
175
+ if (d === 0)
176
+ return 0;
177
+ if (d > 0)
178
+ return 1;
179
+ return -1;
180
+ }
181
+ /* `vendor/ruby/v3.3.11/object.c:1665` `rb_obj_cmp` — the inherited `<=>`: `0` for an
182
+ `==` operand and nil otherwise, rather than JS relational coercion, which
183
+ orders `false` before `true` where Ruby answers nil. */
184
+ return rbEqual(a, b) ? 0 : null;
185
+ }
186
+ function kTemporalDateP(value) {
187
+ const tag = temporalTag(value);
188
+ return tag === "Temporal.PlainDate" || tag === "Temporal.PlainDateTime";
189
+ }
190
+ function mAjd(value) {
191
+ const v = value;
192
+ const y = v.month <= 2 ? v.year - 1 : v.year;
193
+ const era = Math.floor(y / 400);
194
+ const yoe = y - era * 400;
195
+ const doy = Math.floor((153 * (v.month + (v.month > 2 ? -3 : 9)) + 2) / 5) + v.day - 1;
196
+ const doe = yoe * 365 + Math.floor(yoe / 4) - Math.floor(yoe / 100) + doy;
197
+ const epochDays = era * 146097 + doe - 719468;
198
+ const seconds = (v.hour ?? 0) * 3600 +
199
+ (v.minute ?? 0) * 60 +
200
+ (v.second ?? 0) +
201
+ (v.millisecond ?? 0) / 1e3 +
202
+ (v.microsecond ?? 0) / 1e6 +
203
+ (v.nanosecond ?? 0) / 1e9;
204
+ return epochDays + 2440587.5 + seconds / 86400;
205
+ }
206
+ function isComparable(value) {
207
+ return typeof value.compareTo === "function";
208
+ }
209
+ function isCmpSpelling(value) {
210
+ return typeof value.cmp === "function";
211
+ }
212
+ /**
213
+ * Ruby's `rb_cmperr` (`vendor/ruby/v3.3.11/compar.c:28`), which names the operand by
214
+ * `inspect` for a special constant or a Float and by `rb_obj_class` otherwise. */
215
+ function rbCmperr(x, y) {
216
+ const classname = specialConstP(y) ? rbInspect(y) : rbObjClassname(y);
217
+ throw new ArgumentError(`comparison of ${rbObjClassname(x)} with ${classname} failed`);
218
+ }
219
+ /**
220
+ * `SPECIAL_CONST_P` (`vendor/ruby/v3.3.11/include/ruby/internal/special_consts.h`) plus
221
+ * `rb_cmperr`'s `BUILTIN_TYPE(y) == T_FLOAT` arm: nil, true, false, a Symbol, a
222
+ * Float, and a Fixnum — an Integer up to `RUBY_FIXNUM_MAX`
223
+ * (`vendor/ruby/v3.3.11/include/ruby/internal/arithmetic/fixnum.h:55`, `LONG_MAX / 2`).
224
+ * A Bignum is a heap object, so `rb_cmperr` names it by class.
225
+ */
226
+ function specialConstP(y) {
227
+ if (typeof y === "bigint")
228
+ return y <= 4611686018427387903n && y >= -4611686018427387904n;
229
+ return y === null || y === undefined || typeof y === "boolean" || typeof y === "number";
230
+ }
231
+ /**
232
+ * Ruby's `rb_cmpint` (`vendor/ruby/v3.3.11/bignum.c:2959`), which turns a `<=>` result
233
+ * into a C int and sends a `nil` one to `rb_cmperr` — the free-function form
234
+ * `Array#max` reaches through `OPTIMIZED_CMP`, where {@link cmpint} is the
235
+ * `Comparable` method form.
236
+ * @noRailsEquivalent PERMANENT — Ruby core `rb_cmpint` (`vendor/ruby/v3.3.11/bignum.c:2959`).
237
+ */
238
+ export function rbCmpint(val, a, b) {
239
+ if (val === null || val === undefined)
240
+ rbCmperr(a, b);
241
+ if (val > 0)
242
+ return 1;
243
+ if (val < 0)
244
+ return -1;
245
+ return 0;
246
+ }
247
+ /**
248
+ * Ruby's `cmpint` (`vendor/ruby/v3.3.11/compar.c:91`), the one body every operator
249
+ * below is derived from: a `nil` `<=>` is an `ArgumentError`, not a `false`.
250
+ * @noRailsEquivalent PERMANENT — Ruby core `Comparable` `cmpint` (`vendor/ruby/v3.3.11/compar.c:91`).
251
+ */
252
+ export function cmpint(other) {
253
+ return rbCmpint(cmp(this, other), this, other);
254
+ }
255
+ /**
256
+ * Ruby `Comparable#<` (`vendor/ruby/v3.3.11/compar.c:133` `cmp_lt`).
257
+ * @noRailsEquivalent PERMANENT — Ruby core `Comparable` `cmp_lt` (`vendor/ruby/v3.3.11/compar.c:133`).
258
+ */
259
+ export function lessThan(other) {
260
+ return cmpint.call(this, other) < 0;
261
+ }
262
+ /**
263
+ * Ruby `Comparable#<=` (`vendor/ruby/v3.3.11/compar.c:147` `cmp_le`).
264
+ * @noRailsEquivalent PERMANENT — Ruby core `Comparable` `cmp_le` (`vendor/ruby/v3.3.11/compar.c:147`).
265
+ */
266
+ export function lessThanOrEqual(other) {
267
+ return cmpint.call(this, other) <= 0;
268
+ }
269
+ /**
270
+ * Ruby `Comparable#>` (`vendor/ruby/v3.3.11/compar.c:105` `cmp_gt`).
271
+ * @noRailsEquivalent PERMANENT — Ruby core `Comparable` `cmp_gt` (`vendor/ruby/v3.3.11/compar.c:105`).
272
+ */
273
+ export function greaterThan(other) {
274
+ return cmpint.call(this, other) > 0;
275
+ }
276
+ /**
277
+ * Ruby `Comparable#>=` (`vendor/ruby/v3.3.11/compar.c:119` `cmp_ge`).
278
+ * @noRailsEquivalent PERMANENT — Ruby core `Comparable` `cmp_ge` (`vendor/ruby/v3.3.11/compar.c:119`).
279
+ */
280
+ export function greaterThanOrEqual(other) {
281
+ return cmpint.call(this, other) >= 0;
282
+ }
283
+ /**
284
+ * Ruby `Comparable#==` (`vendor/ruby/v3.3.11/compar.c:79` `cmp_equal`), the one derived
285
+ * operator that does NOT raise: a `nil` `<=>` is `false`, and an identical
286
+ * object is `true` before `<=>` is sent at all.
287
+ * @noRailsEquivalent PERMANENT — Ruby core `Comparable` `cmp_equal` (`vendor/ruby/v3.3.11/compar.c:79`).
288
+ */
289
+ export function equals(other) {
290
+ if (this === other)
291
+ return true;
292
+ const c = this.compareTo(other);
293
+ if (c === null || c === undefined)
294
+ return false;
295
+ return c === 0;
296
+ }
297
+ /**
298
+ * Ruby `Comparable#between?` (`vendor/ruby/v3.3.11/compar.c:168` `cmp_between`), which
299
+ * is `cmpint` on both ends and so raises for an operand `<=>` cannot place.
300
+ * @noRailsEquivalent PERMANENT — Ruby core `Comparable` `cmp_between` (`vendor/ruby/v3.3.11/compar.c:168`).
301
+ */
302
+ export function isBetween(min, max) {
303
+ return cmpint.call(this, min) >= 0 && cmpint.call(this, max) <= 0;
304
+ }
305
+ /**
306
+ * Ruby `Array#max` (`vendor/ruby/v3.3.11/array.c:5848` `rb_ary_max`), the
307
+ * no-argument arms. Without a block: `nil` for an empty array, and otherwise
308
+ * the first element carried through `ary_max_generic`
309
+ * (`vendor/ruby/v3.3.11/array.c:5719`). MRI's `CMP_OPTIMIZABLE` fast paths for a
310
+ * Fixnum / String / Float first element are omitted — each one falls back to
311
+ * `ary_max_generic` the moment an element is not of that type, so they change
312
+ * speed, not the answer. With a block: the element the block's `<=>` answer
313
+ * ranks highest, the first of any tie (`vendor/ruby/v3.3.11/array.c:5859-5866`).
314
+ *
315
+ * It lives beside {@link rbCmpint} rather than in an `array.ts` because that is
316
+ * the whole of it: `ary_max_generic` is `rb_cmpint(rb_cmp(vmax, v), vmax, v)`,
317
+ * so a `nil` reaching the comparison is an `ArgumentError`, not a skipped
318
+ * element.
319
+ *
320
+ * @noRailsEquivalent PERMANENT — Ruby core `Array#max` (`vendor/ruby/v3.3.11/array.c:5848`).
321
+ */
322
+ export function max(ary, block) {
323
+ const n = ary.length;
324
+ if (block) {
325
+ let result = null;
326
+ for (let i = 0; i < ary.length; i++) {
327
+ const v = ary[i];
328
+ if (i === 0 || rbCmpint(block(v, result), v, result) > 0) {
329
+ result = v;
330
+ }
331
+ }
332
+ return result;
333
+ }
334
+ if (n === 0)
335
+ return null;
336
+ const result = ary[0];
337
+ if (n > 1)
338
+ return aryMaxGeneric(ary, 1, result);
339
+ return result;
340
+ }
341
+ /**
342
+ * Ruby `Array#min` (`vendor/ruby/v3.3.11/array.c:6016` `rb_ary_min`), the no-argument,
343
+ * no-block arm — {@link max}'s mirror, carried through `ary_min_generic`
344
+ * (`vendor/ruby/v3.3.11/array.c:5888`), with the same `CMP_OPTIMIZABLE` fast paths
345
+ * omitted.
346
+ *
347
+ * @noRailsEquivalent PERMANENT — Ruby core `Array#min` (`vendor/ruby/v3.3.11/array.c:6016`).
348
+ */
349
+ export function min(ary) {
350
+ const n = ary.length;
351
+ if (n === 0)
352
+ return null;
353
+ const result = ary[0];
354
+ if (n > 1)
355
+ return aryMinGeneric(ary, 1, result);
356
+ return result;
357
+ }
358
+ function aryMinGeneric(ary, i, vmin) {
359
+ for (; i < ary.length; ++i) {
360
+ const v = ary[i];
361
+ if (rbCmpint(cmp(vmin, v), vmin, v) > 0) {
362
+ vmin = v;
363
+ }
364
+ }
365
+ return vmin;
366
+ }
367
+ function aryMaxGeneric(ary, i, vmax) {
368
+ for (; i < ary.length; ++i) {
369
+ const v = ary[i];
370
+ if (rbCmpint(cmp(vmax, v), vmax, v) < 0) {
371
+ vmax = v;
372
+ }
373
+ }
374
+ return vmax;
375
+ }
376
+ //# sourceMappingURL=comparable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comparable.js","sourceRoot":"","sources":["../lib/comparable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qB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C,CAAC,CAAC,CAAC;QACjB,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;YACxC,IAAI,GAAG,CAAC,CAAC;QACX,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,aAAa,CAAI,GAAiB,EAAE,CAAS,EAAE,IAAO;IAC7D,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;QAC3B,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACjB,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;YACxC,IAAI,GAAG,CAAC,CAAC;QACX,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * `rb_cComplex` (`vendor/ruby/v3.3.11/complex.c:2529`).
3
+ *
4
+ * @noRailsEquivalent PERMANENT — Ruby core. Rails defines no Complex; its
5
+ * `Enumerable#sum` tests (`core_ext/enumerable_test.rb:112-115`) sum one.
6
+ */
7
+ export declare class Complex {
8
+ /** `Complex#real` (`vendor/ruby/v3.3.11/complex.c:771` `rb_complex_real`).
9
+ * @noRailsEquivalent PERMANENT — Ruby core, part of the Complex above. */
10
+ readonly real: unknown;
11
+ /** `Complex#imaginary` (`vendor/ruby/v3.3.11/complex.c:794` `rb_complex_imag`).
12
+ * @noRailsEquivalent PERMANENT — Ruby core, part of the Complex above. */
13
+ readonly imaginary: unknown;
14
+ /** `Complex::I` (`vendor/ruby/v3.3.11/complex.c:2638`).
15
+ * @noRailsEquivalent PERMANENT — Ruby core, part of the Complex above. */
16
+ static readonly I: Complex;
17
+ /** `nucomp_s_new_internal` (`vendor/ruby/v3.3.11/complex.c:393`).
18
+ * @noRailsEquivalent PERMANENT — Ruby core, part of the Complex above. */
19
+ constructor(
20
+ /** `Complex#real` (`vendor/ruby/v3.3.11/complex.c:771` `rb_complex_real`).
21
+ * @noRailsEquivalent PERMANENT — Ruby core, part of the Complex above. */
22
+ real: unknown,
23
+ /** `Complex#imaginary` (`vendor/ruby/v3.3.11/complex.c:794` `rb_complex_imag`).
24
+ * @noRailsEquivalent PERMANENT — Ruby core, part of the Complex above. */
25
+ imaginary: unknown);
26
+ /** `Complex#imag` (`vendor/ruby/v3.3.11/complex.c:2557`).
27
+ * @noRailsEquivalent PERMANENT — Ruby core, part of the Complex above. */
28
+ get imag(): unknown;
29
+ /** `rb_complex_plus` (`vendor/ruby/v3.3.11/complex.c:832`, `Complex#+`).
30
+ * @noRailsEquivalent PERMANENT — Ruby core, part of the Complex above. */
31
+ plus(other: unknown): unknown;
32
+ /** `rb_complex_mul` (`vendor/ruby/v3.3.11/complex.c:928`, `Complex#*`), for the real
33
+ * multiplier this port needs.
34
+ * @noRailsEquivalent PERMANENT — Ruby core, part of the Complex above. */
35
+ multiply(other: unknown): Complex;
36
+ /** `nucomp_eqeq_p` (`vendor/ruby/v3.3.11/complex.c:1225`, `Complex#==`).
37
+ * @noRailsEquivalent PERMANENT — Ruby core, part of the Complex above. */
38
+ equals(other: unknown): boolean;
39
+ /** `nucomp_coerce` (`vendor/ruby/v3.3.11/complex.c:1300`, `Complex#coerce`).
40
+ * @noRailsEquivalent PERMANENT — Ruby core, part of the Complex above. */
41
+ coerce(other: unknown): [unknown, unknown];
42
+ }
43
+ /**
44
+ * `Kernel#Complex()` (`vendor/ruby/v3.3.11/complex.c:2359` `nucomp_s_convert`).
45
+ * @noRailsEquivalent PERMANENT
46
+ */
47
+ export declare function complex(a1: unknown, a2?: unknown): Complex;
48
+ //# sourceMappingURL=complex.d.ts.map