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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (625) 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 +78 -0
  14. package/dist/backtrace-location.js +158 -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 +111 -0
  23. package/dist/big-decimal.js +584 -0
  24. package/dist/big-decimal.js.map +1 -0
  25. package/dist/bundler.d.ts +44 -0
  26. package/dist/bundler.js +97 -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 +93 -0
  38. package/dist/classpath.js +210 -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 +49 -0
  47. package/dist/complex.js +164 -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 +225 -0
  92. package/dist/dir.js +608 -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 +1102 -0
  105. package/dist/enumerable.js.map +1 -0
  106. package/dist/enumerator.d.ts +324 -0
  107. package/dist/enumerator.js +625 -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 +447 -0
  113. package/dist/errno.js +616 -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 +44 -0
  122. package/dist/exception.js +115 -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 +1824 -0
  132. package/dist/file-utils.js.map +1 -0
  133. package/dist/file.d.ts +643 -0
  134. package/dist/file.js +1334 -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 +41 -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 +55 -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 +124 -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 +2208 -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 +70 -0
  191. package/dist/json.js +181 -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 +39 -0
  215. package/dist/kernel-system.js +103 -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 +128 -0
  230. package/dist/load.js +278 -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 +218 -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 +81 -0
  257. package/dist/method-cache.js +109 -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 +13 -0
  303. package/dist/not-implemented-error.js.map +1 -0
  304. package/dist/numeric-class.d.ts +29 -0
  305. package/dist/numeric-class.js +41 -0
  306. package/dist/numeric-class.js.map +1 -0
  307. package/dist/numeric.d.ts +226 -0
  308. package/dist/numeric.js +848 -0
  309. package/dist/numeric.js.map +1 -0
  310. package/dist/object-space.d.ts +34 -0
  311. package/dist/object-space.js +152 -0
  312. package/dist/object-space.js.map +1 -0
  313. package/dist/object.d.ts +833 -0
  314. package/dist/object.js +2131 -0
  315. package/dist/object.js.map +1 -0
  316. package/dist/open-uri.d.ts +180 -0
  317. package/dist/open-uri.js +402 -0
  318. package/dist/open-uri.js.map +1 -0
  319. package/dist/open3.d.ts +69 -0
  320. package/dist/open3.js +134 -0
  321. package/dist/open3.js.map +1 -0
  322. package/dist/openssl.d.ts +479 -0
  323. package/dist/openssl.js +1052 -0
  324. package/dist/openssl.js.map +1 -0
  325. package/dist/optparse.d.ts +130 -0
  326. package/dist/optparse.js +457 -0
  327. package/dist/optparse.js.map +1 -0
  328. package/dist/os-adapter.d.ts +20 -0
  329. package/dist/os-adapter.js +95 -0
  330. package/dist/os-adapter.js.map +1 -0
  331. package/dist/pathname.d.ts +73 -0
  332. package/dist/pathname.js +412 -0
  333. package/dist/pathname.js.map +1 -0
  334. package/dist/pp.d.ts +60 -0
  335. package/dist/pp.js +195 -0
  336. package/dist/pp.js.map +1 -0
  337. package/dist/pretty-print.d.ts +89 -0
  338. package/dist/pretty-print.js +232 -0
  339. package/dist/pretty-print.js.map +1 -0
  340. package/dist/process-adapter.d.ts +229 -0
  341. package/dist/process-adapter.js +889 -0
  342. package/dist/process-adapter.js.map +1 -0
  343. package/dist/process.d.ts +202 -0
  344. package/dist/process.js +433 -0
  345. package/dist/process.js.map +1 -0
  346. package/dist/psych/class-loader.d.ts +92 -0
  347. package/dist/psych/class-loader.js +139 -0
  348. package/dist/psych/class-loader.js.map +1 -0
  349. package/dist/psych/coder.d.ts +144 -0
  350. package/dist/psych/coder.js +176 -0
  351. package/dist/psych/coder.js.map +1 -0
  352. package/dist/psych/core-ext.d.ts +8 -0
  353. package/dist/psych/core-ext.js +10 -0
  354. package/dist/psych/core-ext.js.map +1 -0
  355. package/dist/psych/emitter.d.ts +116 -0
  356. package/dist/psych/emitter.js +1130 -0
  357. package/dist/psych/emitter.js.map +1 -0
  358. package/dist/psych/exception.d.ts +43 -0
  359. package/dist/psych/exception.js +54 -0
  360. package/dist/psych/exception.js.map +1 -0
  361. package/dist/psych/handler.d.ts +59 -0
  362. package/dist/psych/handler.js +95 -0
  363. package/dist/psych/handler.js.map +1 -0
  364. package/dist/psych/handlers/document-stream.d.ts +17 -0
  365. package/dist/psych/handlers/document-stream.js +26 -0
  366. package/dist/psych/handlers/document-stream.js.map +1 -0
  367. package/dist/psych/nodes/alias.d.ts +15 -0
  368. package/dist/psych/nodes/alias.js +22 -0
  369. package/dist/psych/nodes/alias.js.map +1 -0
  370. package/dist/psych/nodes/document.d.ts +23 -0
  371. package/dist/psych/nodes/document.js +35 -0
  372. package/dist/psych/nodes/document.js.map +1 -0
  373. package/dist/psych/nodes/mapping.d.ts +25 -0
  374. package/dist/psych/nodes/mapping.js +35 -0
  375. package/dist/psych/nodes/mapping.js.map +1 -0
  376. package/dist/psych/nodes/node.d.ts +59 -0
  377. package/dist/psych/nodes/node.js +79 -0
  378. package/dist/psych/nodes/node.js.map +1 -0
  379. package/dist/psych/nodes/scalar.d.ts +35 -0
  380. package/dist/psych/nodes/scalar.js +47 -0
  381. package/dist/psych/nodes/scalar.js.map +1 -0
  382. package/dist/psych/nodes/sequence.d.ts +25 -0
  383. package/dist/psych/nodes/sequence.js +35 -0
  384. package/dist/psych/nodes/sequence.js.map +1 -0
  385. package/dist/psych/nodes/stream.d.ts +23 -0
  386. package/dist/psych/nodes/stream.js +31 -0
  387. package/dist/psych/nodes/stream.js.map +1 -0
  388. package/dist/psych/omap.d.ts +9 -0
  389. package/dist/psych/omap.js +9 -0
  390. package/dist/psych/omap.js.map +1 -0
  391. package/dist/psych/parser.d.ts +41 -0
  392. package/dist/psych/parser.js +139 -0
  393. package/dist/psych/parser.js.map +1 -0
  394. package/dist/psych/scalar-scanner.d.ts +31 -0
  395. package/dist/psych/scalar-scanner.js +169 -0
  396. package/dist/psych/scalar-scanner.js.map +1 -0
  397. package/dist/psych/syntax-error.d.ts +23 -0
  398. package/dist/psych/syntax-error.js +35 -0
  399. package/dist/psych/syntax-error.js.map +1 -0
  400. package/dist/psych/tree-builder.d.ts +51 -0
  401. package/dist/psych/tree-builder.js +118 -0
  402. package/dist/psych/tree-builder.js.map +1 -0
  403. package/dist/psych/visitors/depth-first.d.ts +27 -0
  404. package/dist/psych/visitors/depth-first.js +37 -0
  405. package/dist/psych/visitors/depth-first.js.map +1 -0
  406. package/dist/psych/visitors/emitter.d.ts +32 -0
  407. package/dist/psych/visitors/emitter.js +63 -0
  408. package/dist/psych/visitors/emitter.js.map +1 -0
  409. package/dist/psych/visitors/to-ruby.d.ts +110 -0
  410. package/dist/psych/visitors/to-ruby.js +396 -0
  411. package/dist/psych/visitors/to-ruby.js.map +1 -0
  412. package/dist/psych/visitors/visitor.d.ts +11 -0
  413. package/dist/psych/visitors/visitor.js +17 -0
  414. package/dist/psych/visitors/visitor.js.map +1 -0
  415. package/dist/psych/visitors/yaml-tree.d.ts +182 -0
  416. package/dist/psych/visitors/yaml-tree.js +593 -0
  417. package/dist/psych/visitors/yaml-tree.js.map +1 -0
  418. package/dist/psych-adapter.d.ts +65 -0
  419. package/dist/psych-adapter.js +121 -0
  420. package/dist/psych-adapter.js.map +1 -0
  421. package/dist/psych-yaml.d.ts +2 -0
  422. package/dist/psych-yaml.js +5 -0
  423. package/dist/psych-yaml.js.map +1 -0
  424. package/dist/psych.d.ts +257 -0
  425. package/dist/psych.js +332 -0
  426. package/dist/psych.js.map +1 -0
  427. package/dist/queue.d.ts +137 -0
  428. package/dist/queue.js +236 -0
  429. package/dist/queue.js.map +1 -0
  430. package/dist/racc/parser.d.ts +70 -0
  431. package/dist/racc/parser.js +206 -0
  432. package/dist/racc/parser.js.map +1 -0
  433. package/dist/range-error.d.ts +15 -0
  434. package/dist/range-error.js +15 -0
  435. package/dist/range-error.js.map +1 -0
  436. package/dist/range.d.ts +166 -0
  437. package/dist/range.js +421 -0
  438. package/dist/range.js.map +1 -0
  439. package/dist/rational.d.ts +168 -0
  440. package/dist/rational.js +587 -0
  441. package/dist/rational.js.map +1 -0
  442. package/dist/rb-config.d.ts +33 -0
  443. package/dist/rb-config.js +53 -0
  444. package/dist/rb-config.js.map +1 -0
  445. package/dist/rb-equal.d.ts +66 -0
  446. package/dist/rb-equal.js +262 -0
  447. package/dist/rb-equal.js.map +1 -0
  448. package/dist/rb-hash.d.ts +26 -0
  449. package/dist/rb-hash.js +108 -0
  450. package/dist/rb-hash.js.map +1 -0
  451. package/dist/regexp.d.ts +82 -0
  452. package/dist/regexp.js +191 -0
  453. package/dist/regexp.js.map +1 -0
  454. package/dist/repl-adapter.d.ts +270 -0
  455. package/dist/repl-adapter.js +562 -0
  456. package/dist/repl-adapter.js.map +1 -0
  457. package/dist/resolv.d.ts +30 -0
  458. package/dist/resolv.js +48 -0
  459. package/dist/resolv.js.map +1 -0
  460. package/dist/ruby-empty.d.ts +28 -0
  461. package/dist/ruby-empty.js +40 -0
  462. package/dist/ruby-empty.js.map +1 -0
  463. package/dist/ruby-platform.d.ts +39 -0
  464. package/dist/ruby-platform.js +49 -0
  465. package/dist/ruby-platform.js.map +1 -0
  466. package/dist/runtime-error.d.ts +15 -0
  467. package/dist/runtime-error.js +15 -0
  468. package/dist/runtime-error.js.map +1 -0
  469. package/dist/scheduled-task.d.ts +73 -0
  470. package/dist/scheduled-task.js +150 -0
  471. package/dist/scheduled-task.js.map +1 -0
  472. package/dist/secure-random.d.ts +50 -0
  473. package/dist/secure-random.js +141 -0
  474. package/dist/secure-random.js.map +1 -0
  475. package/dist/set.d.ts +158 -0
  476. package/dist/set.js +352 -0
  477. package/dist/set.js.map +1 -0
  478. package/dist/shellwords.d.ts +27 -0
  479. package/dist/shellwords.js +53 -0
  480. package/dist/shellwords.js.map +1 -0
  481. package/dist/signal-exception.d.ts +43 -0
  482. package/dist/signal-exception.js +88 -0
  483. package/dist/signal-exception.js.map +1 -0
  484. package/dist/socket.d.ts +230 -0
  485. package/dist/socket.js +484 -0
  486. package/dist/socket.js.map +1 -0
  487. package/dist/standard-error.d.ts +27 -0
  488. package/dist/standard-error.js +49 -0
  489. package/dist/standard-error.js.map +1 -0
  490. package/dist/stop-iteration.d.ts +10 -0
  491. package/dist/stop-iteration.js +10 -0
  492. package/dist/stop-iteration.js.map +1 -0
  493. package/dist/string/b.d.ts +19 -0
  494. package/dist/string/b.js +28 -0
  495. package/dist/string/b.js.map +1 -0
  496. package/dist/string/byte-methods.d.ts +57 -0
  497. package/dist/string/byte-methods.js +266 -0
  498. package/dist/string/byte-methods.js.map +1 -0
  499. package/dist/string/bytes.d.ts +35 -0
  500. package/dist/string/bytes.js +123 -0
  501. package/dist/string/bytes.js.map +1 -0
  502. package/dist/string/case-mapping.d.ts +57 -0
  503. package/dist/string/case-mapping.js +192 -0
  504. package/dist/string/case-mapping.js.map +1 -0
  505. package/dist/string/chomp.d.ts +15 -0
  506. package/dist/string/chomp.js +32 -0
  507. package/dist/string/chomp.js.map +1 -0
  508. package/dist/string/convert.d.ts +55 -0
  509. package/dist/string/convert.js +316 -0
  510. package/dist/string/convert.js.map +1 -0
  511. package/dist/string/delete.d.ts +14 -0
  512. package/dist/string/delete.js +17 -0
  513. package/dist/string/delete.js.map +1 -0
  514. package/dist/string/each.d.ts +108 -0
  515. package/dist/string/each.js +305 -0
  516. package/dist/string/each.js.map +1 -0
  517. package/dist/string/encode.d.ts +37 -0
  518. package/dist/string/encode.js +268 -0
  519. package/dist/string/encode.js.map +1 -0
  520. package/dist/string/force-encoding.d.ts +72 -0
  521. package/dist/string/force-encoding.js +147 -0
  522. package/dist/string/force-encoding.js.map +1 -0
  523. package/dist/string/inspect.d.ts +17 -0
  524. package/dist/string/inspect.js +81 -0
  525. package/dist/string/inspect.js.map +1 -0
  526. package/dist/string/method-table.d.ts +174 -0
  527. package/dist/string/method-table.js +805 -0
  528. package/dist/string/method-table.js.map +1 -0
  529. package/dist/string/scrub.d.ts +12 -0
  530. package/dist/string/scrub.js +33 -0
  531. package/dist/string/scrub.js.map +1 -0
  532. package/dist/string/slice.d.ts +26 -0
  533. package/dist/string/slice.js +73 -0
  534. package/dist/string/slice.js.map +1 -0
  535. package/dist/string/split.d.ts +11 -0
  536. package/dist/string/split.js +44 -0
  537. package/dist/string/split.js.map +1 -0
  538. package/dist/string/sub.d.ts +114 -0
  539. package/dist/string/sub.js +371 -0
  540. package/dist/string/sub.js.map +1 -0
  541. package/dist/string/succ.d.ts +14 -0
  542. package/dist/string/succ.js +118 -0
  543. package/dist/string/succ.js.map +1 -0
  544. package/dist/string/support.d.ts +142 -0
  545. package/dist/string/support.js +296 -0
  546. package/dist/string/support.js.map +1 -0
  547. package/dist/string/tr.d.ts +46 -0
  548. package/dist/string/tr.js +156 -0
  549. package/dist/string/tr.js.map +1 -0
  550. package/dist/string-io.d.ts +166 -0
  551. package/dist/string-io.js +248 -0
  552. package/dist/string-io.js.map +1 -0
  553. package/dist/string-scanner.d.ts +133 -0
  554. package/dist/string-scanner.js +248 -0
  555. package/dist/string-scanner.js.map +1 -0
  556. package/dist/struct.d.ts +54 -0
  557. package/dist/struct.js +222 -0
  558. package/dist/struct.js.map +1 -0
  559. package/dist/symbol.d.ts +48 -0
  560. package/dist/symbol.js +107 -0
  561. package/dist/symbol.js.map +1 -0
  562. package/dist/tempfile.d.ts +173 -0
  563. package/dist/tempfile.js +295 -0
  564. package/dist/tempfile.js.map +1 -0
  565. package/dist/temporal-tag.d.ts +23 -0
  566. package/dist/temporal-tag.js +29 -0
  567. package/dist/temporal-tag.js.map +1 -0
  568. package/dist/thread-error.d.ts +13 -0
  569. package/dist/thread-error.js +13 -0
  570. package/dist/thread-error.js.map +1 -0
  571. package/dist/thread-pool-executor.d.ts +121 -0
  572. package/dist/thread-pool-executor.js +254 -0
  573. package/dist/thread-pool-executor.js.map +1 -0
  574. package/dist/thread.d.ts +211 -0
  575. package/dist/thread.js +495 -0
  576. package/dist/thread.js.map +1 -0
  577. package/dist/timeout.d.ts +29 -0
  578. package/dist/timeout.js +41 -0
  579. package/dist/timeout.js.map +1 -0
  580. package/dist/tse.d.ts +40 -0
  581. package/dist/tse.js +66 -0
  582. package/dist/tse.js.map +1 -0
  583. package/dist/type-error.d.ts +14 -0
  584. package/dist/type-error.js +14 -0
  585. package/dist/type-error.js.map +1 -0
  586. package/dist/undefined-conversion-error.d.ts +10 -0
  587. package/dist/undefined-conversion-error.js +10 -0
  588. package/dist/undefined-conversion-error.js.map +1 -0
  589. package/dist/uri/common.d.ts +209 -0
  590. package/dist/uri/common.js +369 -0
  591. package/dist/uri/common.js.map +1 -0
  592. package/dist/uri/generic.d.ts +280 -0
  593. package/dist/uri/generic.js +806 -0
  594. package/dist/uri/generic.js.map +1 -0
  595. package/dist/uri/http.d.ts +23 -0
  596. package/dist/uri/http.js +30 -0
  597. package/dist/uri/http.js.map +1 -0
  598. package/dist/uri/https.d.ts +13 -0
  599. package/dist/uri/https.js +15 -0
  600. package/dist/uri/https.js.map +1 -0
  601. package/dist/uri/rfc2396-parser.d.ts +70 -0
  602. package/dist/uri/rfc2396-parser.js +264 -0
  603. package/dist/uri/rfc2396-parser.js.map +1 -0
  604. package/dist/uri/rfc3986-parser.d.ts +46 -0
  605. package/dist/uri/rfc3986-parser.js +171 -0
  606. package/dist/uri/rfc3986-parser.js.map +1 -0
  607. package/dist/uri.d.ts +13 -0
  608. package/dist/uri.js +13 -0
  609. package/dist/uri.js.map +1 -0
  610. package/dist/variable.d.ts +183 -0
  611. package/dist/variable.js +463 -0
  612. package/dist/variable.js.map +1 -0
  613. package/dist/verbose.d.ts +39 -0
  614. package/dist/verbose.js +49 -0
  615. package/dist/verbose.js.map +1 -0
  616. package/dist/yaml.d.ts +9 -0
  617. package/dist/yaml.js +9 -0
  618. package/dist/yaml.js.map +1 -0
  619. package/dist/zlib-adapter.d.ts +119 -0
  620. package/dist/zlib-adapter.js +230 -0
  621. package/dist/zlib-adapter.js.map +1 -0
  622. package/dist/zlib.d.ts +299 -0
  623. package/dist/zlib.js +679 -0
  624. package/dist/zlib.js.map +1 -0
  625. package/package.json +172 -3
@@ -0,0 +1,806 @@
1
+ import { classpaths } from "../classpath.js";
2
+ import { b } from "../string/b.js";
3
+ import { ArgumentError } from "../argument-error.js";
4
+ import { rbEqual } from "../rb-equal.js";
5
+ import { BadURIError, DEFAULT_PARSER, InvalidComponentError, InvalidURIError, URI, } from "./common.js";
6
+ import { rbObjDup } from "../include.js";
7
+ import { IPAddr } from "../ipaddr.js";
8
+ import { warn } from "../kernel-warn.js";
9
+ import { env as ENV } from "../process-adapter.js";
10
+ import { IPSocket, SocketError } from "../socket.js";
11
+ /**
12
+ * `URI::Generic` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:21`), the base class of every
13
+ * scheme class and what `URI.parse` answers for a scheme it does not know.
14
+ * Only the members trails sends are ported: the component readers and their
15
+ * mutable setters, `merge` and the private helpers it reaches through. The
16
+ * unsent ones are not, and the list is exhaustive: `build2` (`generic.rb:78`),
17
+ * `registry` and its `check_` / `set_` / `=` trio
18
+ * (`generic.rb:252,750,755,760`), the `user=` / `password=` setters
19
+ * (`generic.rb:471,498`), `set_user` / `set_password`
20
+ * (`generic.rb:524,534`), `escape_userpass` (`generic.rb:551`),
21
+ * `decoded_user` / `decoded_password` (`generic.rb:584,589`),
22
+ * `hierarchical?` (`generic.rb:976`), `merge!` (`generic.rb:1096`), `route_from_path` / `route_from0` /
23
+ * `route_from` / `route_to` (`generic.rb:1167,1206,1274,1314`), `normalize` /
24
+ * `hash` / `eql?` (`generic.rb:1404,1408`), `select`
25
+ * (`generic.rb:1452`), `coerce`
26
+ * (`generic.rb:1486`), `replace!` (`generic.rb:299`), and `find_proxy` /
27
+ * `use_proxy?` (`generic.rb:1512,1578`).
28
+ *
29
+ * @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails: `URI::Generic`
30
+ * (`vendor/ruby/v3.3.11/lib/uri/generic.rb:21`) ships with the interpreter.
31
+ */
32
+ export class Generic {
33
+ /** `DEFAULT_PORT` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:27`). */
34
+ static DEFAULT_PORT = null;
35
+ /**
36
+ * `COMPONENT` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:46-52`).
37
+ *
38
+ * @noRailsEquivalent PERMANENT
39
+ */
40
+ static COMPONENT = Object.freeze([
41
+ "scheme",
42
+ "userinfo",
43
+ "host",
44
+ "port",
45
+ "registry",
46
+ "path",
47
+ "opaque",
48
+ "query",
49
+ "fragment",
50
+ ]);
51
+ /**
52
+ * `self.component` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:57`).
53
+ *
54
+ * @noRailsEquivalent PERMANENT
55
+ */
56
+ static component() {
57
+ return this.COMPONENT;
58
+ }
59
+ /**
60
+ * `self.build` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:116-137`): the
61
+ * components as an Array in `COMPONENT` order or a Hash keyed by them,
62
+ * passed to `new` with the default parser and `arg_check` on.
63
+ *
64
+ * @noRailsEquivalent PERMANENT
65
+ */
66
+ static build(args) {
67
+ let tmp;
68
+ if (Array.isArray(args) && args.length === Generic.COMPONENT.length) {
69
+ tmp = [...args];
70
+ }
71
+ else if (args != null && typeof args === "object" && !Array.isArray(args)) {
72
+ tmp = Generic.COMPONENT.map((c) => (Object.hasOwn(args, c) ? args[c] : null));
73
+ }
74
+ else {
75
+ const component = Generic.COMPONENT;
76
+ throw new ArgumentError(`expected Array of or Hash of components of Class (${component.join(", ")})`);
77
+ }
78
+ tmp.push(null);
79
+ tmp.push(true);
80
+ return new this(...tmp);
81
+ }
82
+ /** `self.default_port` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:32`). */
83
+ static get defaultPort() {
84
+ return this.DEFAULT_PORT;
85
+ }
86
+ /** `default_port` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:39`). */
87
+ get defaultPort() {
88
+ return this.constructor.defaultPort;
89
+ }
90
+ _scheme = null;
91
+ _user = null;
92
+ _password = null;
93
+ _host = null;
94
+ _port = null;
95
+ _path = null;
96
+ _query = null;
97
+ _opaque = null;
98
+ _fragment = null;
99
+ _parser;
100
+ /** `initialize` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:169`). */
101
+ constructor(scheme, userinfo, host, port, registry, path, opaque, query, fragment, parser = DEFAULT_PARSER, argCheck = false) {
102
+ this._parser = parser === DEFAULT_PARSER ? null : parser;
103
+ if (argCheck) {
104
+ this.scheme = scheme;
105
+ this.hostname = host;
106
+ this.port = port;
107
+ this.userinfo = userinfo;
108
+ this.path = path;
109
+ this.query = query;
110
+ this.opaque = opaque;
111
+ this.fragment = fragment;
112
+ }
113
+ else {
114
+ this.setScheme(scheme);
115
+ this.setHost(host);
116
+ this.setPort(port);
117
+ this.setUserinfo(userinfo);
118
+ this.setPath(path);
119
+ this.query = query;
120
+ this.setOpaque(opaque);
121
+ this.fragment = fragment;
122
+ }
123
+ if (registry != null) {
124
+ throw new InvalidURIError(`the scheme ${this._scheme} does not accept registry part: ${registry} (or bad hostname?)`);
125
+ }
126
+ if (this._path == null && this._opaque == null)
127
+ this.setPath("");
128
+ if (this.defaultPort != null && this._port == null)
129
+ this.setPort(this.defaultPort);
130
+ }
131
+ /** `scheme` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:221`). */
132
+ get scheme() {
133
+ return this._scheme;
134
+ }
135
+ /** `host` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:243`). */
136
+ get host() {
137
+ return this._host;
138
+ }
139
+ /**
140
+ * `hostname` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:668`).
141
+ *
142
+ * @noRailsEquivalent PERMANENT
143
+ */
144
+ get hostname() {
145
+ const v = this.host;
146
+ return v != null && v.startsWith("[") && v.endsWith("]") ? v.slice(1, -1) : v;
147
+ }
148
+ /** `port` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:250`). */
149
+ get port() {
150
+ return this._port;
151
+ }
152
+ /** `path` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:260`). */
153
+ get path() {
154
+ return this._path;
155
+ }
156
+ /** `query` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:266`). */
157
+ get query() {
158
+ return this._query;
159
+ }
160
+ /**
161
+ * `opaque` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:277`).
162
+ *
163
+ * @noRailsEquivalent PERMANENT
164
+ */
165
+ get opaque() {
166
+ return this._opaque;
167
+ }
168
+ /**
169
+ * `fragment` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:283`).
170
+ *
171
+ * @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails:
172
+ * `URI::Generic#fragment` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:283`).
173
+ */
174
+ get fragment() {
175
+ return this._fragment;
176
+ }
177
+ /** `parser` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:289`). */
178
+ get parser() {
179
+ return this._parser ?? DEFAULT_PARSER;
180
+ }
181
+ /**
182
+ * `check_scheme` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:320`).
183
+ * @internal
184
+ */
185
+ checkScheme(v) {
186
+ if (v != null && !this.parser.regexp.SCHEME.test(v)) {
187
+ throw new InvalidComponentError(`bad component(expected scheme component): ${v}`);
188
+ }
189
+ return true;
190
+ }
191
+ /** `set_scheme` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:334`). */
192
+ setScheme(v) {
193
+ this._scheme = v?.toLowerCase() ?? null;
194
+ }
195
+ /** `scheme=` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:360`). */
196
+ set scheme(v) {
197
+ this.checkScheme(v);
198
+ this.setScheme(v);
199
+ }
200
+ /**
201
+ * `check_userinfo` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:375`).
202
+ * @internal
203
+ */
204
+ checkUserinfo(user, password = null) {
205
+ if (password == null) {
206
+ [user, password] = this.splitUserinfo(user);
207
+ }
208
+ this.checkUser(user);
209
+ this.checkPassword(password, user);
210
+ return true;
211
+ }
212
+ /**
213
+ * `check_user` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:393`).
214
+ * @internal
215
+ */
216
+ checkUser(v) {
217
+ if (this._opaque != null) {
218
+ throw new InvalidURIError("can not set user with opaque");
219
+ }
220
+ if (v == null)
221
+ return v;
222
+ if (!this.parser.regexp.USERINFO.test(v)) {
223
+ throw new InvalidComponentError(`bad component(expected userinfo component or user component): ${v}`);
224
+ }
225
+ return true;
226
+ }
227
+ /**
228
+ * `check_password` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:417`).
229
+ * @internal
230
+ */
231
+ checkPassword(v, user = this._user) {
232
+ if (this._opaque != null) {
233
+ throw new InvalidURIError("can not set password with opaque");
234
+ }
235
+ if (v == null)
236
+ return v;
237
+ if (user == null) {
238
+ throw new InvalidURIError("password component depends user component");
239
+ }
240
+ if (!this.parser.regexp.USERINFO.test(v)) {
241
+ throw new InvalidComponentError("bad password component");
242
+ }
243
+ return true;
244
+ }
245
+ /**
246
+ * `userinfo=` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:441`).
247
+ *
248
+ * @noRailsEquivalent PERMANENT
249
+ */
250
+ set userinfo(userinfo) {
251
+ if (userinfo == null) {
252
+ return;
253
+ }
254
+ this.checkUserinfo(userinfo);
255
+ this.setUserinfo(userinfo);
256
+ }
257
+ /** `set_userinfo` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:509`). */
258
+ setUserinfo(user, password = null) {
259
+ if (password == null) {
260
+ [user, password] = this.splitUserinfo(user);
261
+ }
262
+ this._user = user;
263
+ this._password = password;
264
+ return [this._user, this._password];
265
+ }
266
+ /** `split_userinfo` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:542`). */
267
+ splitUserinfo(ui) {
268
+ if (ui == null)
269
+ return [null, null];
270
+ const i = ui.indexOf(":");
271
+ const [user, password] = i < 0 ? [ui, undefined] : [ui.slice(0, i), ui.slice(i + 1)];
272
+ return [user, password ?? null];
273
+ }
274
+ /**
275
+ * `userinfo` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:557`) — `user`, or
276
+ * `user:password` where both are set.
277
+ *
278
+ * @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails:
279
+ * `URI::Generic#userinfo` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:557`).
280
+ */
281
+ get userinfo() {
282
+ if (this._user == null) {
283
+ return null;
284
+ }
285
+ else if (this._password == null) {
286
+ return this._user;
287
+ }
288
+ else {
289
+ return this._user + ":" + this._password;
290
+ }
291
+ }
292
+ /**
293
+ * `user` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:568`).
294
+ *
295
+ * @noRailsEquivalent PERMANENT
296
+ */
297
+ get user() {
298
+ return this._user;
299
+ }
300
+ /**
301
+ * `password` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:573`).
302
+ *
303
+ * @noRailsEquivalent PERMANENT
304
+ */
305
+ get password() {
306
+ return this._password;
307
+ }
308
+ /** `authority` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:579`) — the array of user,
309
+ * password, host and port, or `nil` when none of them is set. */
310
+ get authority() {
311
+ if (this._user != null || this._password != null || this._host != null || this._port != null) {
312
+ return [this._user, this._password, this._host, this._port];
313
+ }
314
+ return null;
315
+ }
316
+ /**
317
+ * `check_host` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:600`).
318
+ * @internal
319
+ */
320
+ checkHost(v) {
321
+ if (v == null)
322
+ return v;
323
+ if (this._opaque != null) {
324
+ throw new InvalidURIError("can not set host with registry or opaque");
325
+ }
326
+ else if (!this.parser.regexp.HOST.test(v)) {
327
+ throw new InvalidComponentError(`bad component(expected host component): ${v}`);
328
+ }
329
+ return true;
330
+ }
331
+ /** `set_host` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:619`). */
332
+ setHost(v) {
333
+ this._host = v;
334
+ }
335
+ /** `set_authority` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:626`). */
336
+ setAuthority(user, password, host, port = null) {
337
+ [this._user, this._password, this._host, this._port] = [
338
+ user,
339
+ password,
340
+ host,
341
+ port ?? this.defaultPort,
342
+ ];
343
+ }
344
+ /**
345
+ * `hostname=` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:685`).
346
+ *
347
+ * @noRailsEquivalent PERMANENT
348
+ */
349
+ set hostname(v) {
350
+ if (!(v?.startsWith("[") && v?.endsWith("]")) && v != null && v.includes(":"))
351
+ v = `[${v}]`;
352
+ this.host = v;
353
+ }
354
+ /** `host=` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:652`). */
355
+ set host(v) {
356
+ this.checkHost(v);
357
+ this.setHost(v);
358
+ this.setUserinfo(null);
359
+ }
360
+ /** `check_port` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:697`). */
361
+ checkPort(v) {
362
+ if (v == null)
363
+ return v;
364
+ if (this._opaque != null) {
365
+ throw new InvalidURIError("can not set port with registry or opaque");
366
+ }
367
+ else if (typeof v !== "number" && !this.parser.regexp.PORT.test(v)) {
368
+ throw new InvalidComponentError(`bad component(expected port component): ${JSON.stringify(v)}`);
369
+ }
370
+ return true;
371
+ }
372
+ /**
373
+ * `set_port` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:716`).
374
+ *
375
+ * The conversion is `String#to_i` (`rb_str_to_i`,
376
+ * `vendor/ruby/v3.3.11/string.c:6602`), which answers `0` for a string with no
377
+ * leading digit run — `regexp[:PORT]` admits one made only of whitespace —
378
+ * where `parseInt` would answer `NaN`.
379
+ */
380
+ setPort(v) {
381
+ if (v != null && typeof v !== "number") {
382
+ v = v === "" ? null : Number(/^\s*[+-]?\d+/.exec(v)?.[0] ?? 0);
383
+ }
384
+ this._port = v;
385
+ }
386
+ /** `port=` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:743`). */
387
+ set port(v) {
388
+ this.checkPort(v);
389
+ this.setPort(v);
390
+ this.setUserinfo(null);
391
+ }
392
+ /**
393
+ * `check_path` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:772`).
394
+ * @internal
395
+ */
396
+ checkPath(v) {
397
+ if (v != null && this._opaque != null) {
398
+ throw new InvalidURIError("path conflicts with opaque");
399
+ }
400
+ if (this._scheme != null && this._scheme !== "ftp") {
401
+ if (v != null && v !== "" && !this.parser.regexp.ABS_PATH.test(v)) {
402
+ throw new InvalidComponentError(`bad component(expected absolute path component): ${v}`);
403
+ }
404
+ }
405
+ else {
406
+ if (v != null &&
407
+ v !== "" &&
408
+ !this.parser.regexp.ABS_PATH.test(v) &&
409
+ !this.parser.regexp.REL_PATH.test(v)) {
410
+ throw new InvalidComponentError(`bad component(expected relative path component): ${v}`);
411
+ }
412
+ }
413
+ return true;
414
+ }
415
+ /** `set_path` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:804`). */
416
+ setPath(v) {
417
+ this._path = v;
418
+ }
419
+ /** `path=` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:830`). */
420
+ set path(v) {
421
+ this.checkPath(v);
422
+ this.setPath(v);
423
+ }
424
+ /** `query=` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:854`). */
425
+ set query(v) {
426
+ if (v == null) {
427
+ this._query = null;
428
+ return;
429
+ }
430
+ if (this._opaque != null)
431
+ throw new InvalidURIError("query conflicts with opaque");
432
+ v = v.replace(/[\t\r\n]/g, "");
433
+ const invalid = /(%[^0-9a-fA-F][^0-9a-fA-F])/.exec(v);
434
+ if (invalid)
435
+ throw new InvalidURIError(`invalid percent escape: ${invalid[1]}`);
436
+ this._query = v.replace(/(?!%[0-9a-fA-F]{2}|[!$-&(-;=?-_a-~])[\s\S]/g, (c) => {
437
+ let out = "";
438
+ for (const byte of b(c)) {
439
+ out += `%${byte.toString(16).toUpperCase().padStart(2, "0")}`;
440
+ }
441
+ return out;
442
+ });
443
+ }
444
+ /** `set_opaque` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:898`). */
445
+ setOpaque(v) {
446
+ this._opaque = v;
447
+ }
448
+ /**
449
+ * `opaque=` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:916`).
450
+ *
451
+ * @noRailsEquivalent PERMANENT
452
+ */
453
+ set opaque(v) {
454
+ this.checkOpaque(v);
455
+ this.setOpaque(v);
456
+ }
457
+ /** `check_opaque` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:876`). */
458
+ checkOpaque(v) {
459
+ if (v == null)
460
+ return v;
461
+ if (this._host != null || this._port != null || this._user != null || this._path != null) {
462
+ throw new InvalidURIError("can not set opaque with host, port, userinfo or path");
463
+ }
464
+ else if (!this.parser.regexp.OPAQUE?.test(v)) {
465
+ throw new InvalidComponentError(`bad component(expected opaque component): ${v}`);
466
+ }
467
+ return true;
468
+ }
469
+ /** `fragment=` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:944`). */
470
+ set fragment(v) {
471
+ if (v == null) {
472
+ this._fragment = null;
473
+ return;
474
+ }
475
+ v = v.replace(/[\t\r\n]/g, "");
476
+ this._fragment = v.replace(/(?!%[0-9a-fA-F]{2}|[!-~])[\s\S]/g, (c) => {
477
+ let out = "";
478
+ for (const byte of b(c)) {
479
+ out += `%${byte.toString(16).toUpperCase().padStart(2, "0")}`;
480
+ }
481
+ return out;
482
+ });
483
+ }
484
+ /**
485
+ * `component` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:313`).
486
+ *
487
+ * @noRailsEquivalent PERMANENT
488
+ */
489
+ component() {
490
+ return this.constructor.component();
491
+ }
492
+ /**
493
+ * `normalize` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:1331`).
494
+ *
495
+ * @noRailsEquivalent PERMANENT
496
+ */
497
+ normalize() {
498
+ const uri = rbObjDup(this);
499
+ uri.normalizeBang();
500
+ return uri;
501
+ }
502
+ /**
503
+ * `normalize!` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:1340`).
504
+ *
505
+ * @noRailsEquivalent PERMANENT
506
+ */
507
+ normalizeBang() {
508
+ if (this.path === "") {
509
+ this.setPath("/");
510
+ }
511
+ if (this.scheme != null && this.scheme !== this.scheme.toLowerCase()) {
512
+ this.setScheme(this.scheme.toLowerCase());
513
+ }
514
+ if (this.host != null && this.host !== this.host.toLowerCase()) {
515
+ this.setHost(this.host.toLowerCase());
516
+ }
517
+ }
518
+ /**
519
+ * `==` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:1396`): the same class, and equal
520
+ * `component_ary`s once both sides are normalized.
521
+ *
522
+ * @noRailsEquivalent PERMANENT
523
+ */
524
+ equals(oth) {
525
+ if (this.constructor === oth?.constructor) {
526
+ return rbEqual(this.normalize().componentAry(), oth.normalize().componentAry());
527
+ }
528
+ else {
529
+ return false;
530
+ }
531
+ }
532
+ /**
533
+ * `component_ary` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:1428`).
534
+ * @internal
535
+ */
536
+ componentAry() {
537
+ return this.component().map((x) => this[x]);
538
+ }
539
+ /**
540
+ * `inspect` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:1463`). Every scheme class
541
+ * lives under `URI`, so the class is named with that prefix.
542
+ *
543
+ * @noRailsEquivalent PERMANENT
544
+ */
545
+ inspect() {
546
+ return `#<URI::${this.constructor.name} ${this.toString()}>`;
547
+ }
548
+ /**
549
+ * `absolute?` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:987`).
550
+ *
551
+ * @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails:
552
+ * `URI::Generic#absolute?` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:987`).
553
+ */
554
+ isAbsolute() {
555
+ if (this._scheme != null) {
556
+ return true;
557
+ }
558
+ else {
559
+ return false;
560
+ }
561
+ }
562
+ /**
563
+ * `relative?` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:999`).
564
+ *
565
+ * @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails:
566
+ * `URI::Generic#relative?` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:999`).
567
+ */
568
+ isRelative() {
569
+ return !this.isAbsolute();
570
+ }
571
+ /** `split_path` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:1006`) — Ruby's
572
+ * `String#split("/", -1)` keeps trailing empties and answers `[]` for `""`,
573
+ * neither of which JS's `String#split` does. */
574
+ splitPath(path) {
575
+ return path === "" ? [] : path.split("/");
576
+ }
577
+ /** `merge_path` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:1015`). */
578
+ mergePath(base, rel) {
579
+ const basePath = this.splitPath(base);
580
+ const relPath = this.splitPath(rel);
581
+ if (basePath[basePath.length - 1] === "..")
582
+ basePath.push("");
583
+ let i;
584
+ while ((i = basePath.indexOf("..")) >= 0) {
585
+ basePath.splice(i - 1, 2);
586
+ }
587
+ const first = relPath[0];
588
+ if (first != null && first === "") {
589
+ basePath.length = 0;
590
+ relPath.shift();
591
+ }
592
+ const last = relPath[relPath.length - 1];
593
+ if (last === "." || last === "..")
594
+ relPath.push("");
595
+ for (let j = relPath.length - 1; j >= 0; j--) {
596
+ if (relPath[j] === ".")
597
+ relPath.splice(j, 1);
598
+ }
599
+ const tmp = [];
600
+ for (const x of relPath) {
601
+ if (x === ".." && !(tmp.length === 0 || tmp[tmp.length - 1] === "..")) {
602
+ tmp.pop();
603
+ }
604
+ else {
605
+ tmp.push(x);
606
+ }
607
+ }
608
+ let addTrailerSlash = tmp.length > 0;
609
+ if (basePath.length === 0) {
610
+ basePath.push("");
611
+ }
612
+ else if (addTrailerSlash) {
613
+ basePath.pop();
614
+ }
615
+ let x;
616
+ while ((x = tmp.shift()) !== undefined) {
617
+ if (x === "..") {
618
+ if (basePath.length > 1)
619
+ basePath.pop();
620
+ }
621
+ else {
622
+ basePath.push(x);
623
+ for (const t of tmp)
624
+ basePath.push(t);
625
+ addTrailerSlash = false;
626
+ break;
627
+ }
628
+ }
629
+ if (addTrailerSlash)
630
+ basePath.push("");
631
+ return basePath.join("/");
632
+ }
633
+ /** `merge` / `+` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:1124`). */
634
+ merge(oth) {
635
+ const rel = this.parser.convertToUri(oth);
636
+ if (rel.isAbsolute()) {
637
+ return rel;
638
+ }
639
+ if (!this.isAbsolute()) {
640
+ throw new BadURIError("both URI are relative");
641
+ }
642
+ const base = rbObjDup(this);
643
+ const authority = rel.authority;
644
+ if ((rel.path == null || rel.path === "") && authority == null && rel.query == null) {
645
+ if (rel.fragment != null)
646
+ base.fragment = rel.fragment;
647
+ return base;
648
+ }
649
+ base.query = null;
650
+ base.fragment = null;
651
+ if (authority != null) {
652
+ base.setAuthority(...authority);
653
+ base.setPath(rel.path);
654
+ }
655
+ else if (base.path != null && rel.path != null) {
656
+ base.setPath(this.mergePath(base.path, rel.path));
657
+ }
658
+ if (rel.query != null)
659
+ base.query = rel.query;
660
+ if (rel.fragment != null)
661
+ base.fragment = rel.fragment;
662
+ return base;
663
+ }
664
+ /**
665
+ * `find_proxy` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:1512-1576`). The
666
+ * `IPSocket.getaddress` lookup is the adapter's resolver, so the method is
667
+ * awaited.
668
+ *
669
+ * @noRailsEquivalent PERMANENT
670
+ */
671
+ async findProxy(env = ENV) {
672
+ if (this.isRelative())
673
+ throw new BadURIError(`relative URI: ${this.toString()}`);
674
+ let name = this.scheme.toLowerCase() + "_proxy";
675
+ let proxyUri;
676
+ if (name === "http_proxy" && "REQUEST_METHOD" in env) {
677
+ const pairs = Object.entries(env).filter(([k]) => /^http_proxy$/i.test(k));
678
+ switch (pairs.length) {
679
+ case 0:
680
+ proxyUri = null;
681
+ break;
682
+ case 1: {
683
+ const [k] = pairs.shift();
684
+ if (k === "http_proxy" && env[k.toUpperCase()] == null) {
685
+ proxyUri = env[name];
686
+ }
687
+ else {
688
+ proxyUri = null;
689
+ }
690
+ break;
691
+ }
692
+ default:
693
+ proxyUri = env[name];
694
+ }
695
+ if (!proxyUri) {
696
+ proxyUri = env[`CGI_${name.toUpperCase()}`];
697
+ }
698
+ }
699
+ else if (name === "http_proxy") {
700
+ if (!(proxyUri = env[name])) {
701
+ if ((proxyUri = env[name.toUpperCase()])) {
702
+ warn("The environment variable HTTP_PROXY is discouraged. Use http_proxy.", {
703
+ uplevel: 1,
704
+ });
705
+ }
706
+ }
707
+ }
708
+ else {
709
+ proxyUri = env[name] || env[name.toUpperCase()];
710
+ }
711
+ if (proxyUri == null || proxyUri.length === 0) {
712
+ return null;
713
+ }
714
+ let addr = null;
715
+ if (this.hostname) {
716
+ try {
717
+ addr = await IPSocket.getaddress(this.hostname);
718
+ if (/^127\.|^::1$/.test(addr))
719
+ return null;
720
+ }
721
+ catch (e) {
722
+ if (!(e instanceof SocketError))
723
+ throw e;
724
+ }
725
+ }
726
+ name = "no_proxy";
727
+ let noProxy;
728
+ if ((noProxy = env[name] || env[name.toUpperCase()])) {
729
+ if (!Generic.isUseProxy(this.hostname, addr, this.port, noProxy))
730
+ return null;
731
+ }
732
+ return URI.parse(proxyUri);
733
+ }
734
+ /**
735
+ * `self.use_proxy?` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:1578-1597`).
736
+ *
737
+ * @noRailsEquivalent PERMANENT
738
+ */
739
+ static isUseProxy(hostname, addr, port, noProxy) {
740
+ hostname = hostname.toLowerCase();
741
+ const dothostname = `.${hostname}`;
742
+ for (const [, pHost, pPort] of noProxy.matchAll(/([^:,\s]+)(?::(\d+))?/g)) {
743
+ if (pPort === undefined || port === parseInt(pPort, 10)) {
744
+ if (pHost.startsWith(".")) {
745
+ if (hostname.endsWith(pHost.toLowerCase()))
746
+ return false;
747
+ }
748
+ else {
749
+ if (dothostname.endsWith(`.${pHost.toLowerCase()}`))
750
+ return false;
751
+ }
752
+ if (addr) {
753
+ try {
754
+ if (new IPAddr(pHost).includes(addr))
755
+ return false;
756
+ }
757
+ catch (e) {
758
+ if (e instanceof IPAddr.InvalidAddressError)
759
+ continue;
760
+ throw e;
761
+ }
762
+ }
763
+ }
764
+ }
765
+ return true;
766
+ }
767
+ /** `to_s` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:1355`). */
768
+ toString() {
769
+ let str = "";
770
+ if (this._scheme != null) {
771
+ str += this._scheme;
772
+ str += ":";
773
+ }
774
+ if (this._opaque != null) {
775
+ str += this._opaque;
776
+ }
777
+ else {
778
+ if (this._host != null || ["file", "postgres"].includes(this._scheme)) {
779
+ str += "//";
780
+ }
781
+ if (this.userinfo != null) {
782
+ str += this.userinfo;
783
+ str += "@";
784
+ }
785
+ if (this._host != null) {
786
+ str += this._host;
787
+ }
788
+ if (this._port != null && this._port !== this.defaultPort) {
789
+ str += ":";
790
+ str += String(this._port);
791
+ }
792
+ str += this._path;
793
+ if (this._query != null) {
794
+ str += "?";
795
+ str += this._query;
796
+ }
797
+ }
798
+ if (this._fragment != null) {
799
+ str += "#";
800
+ str += this._fragment;
801
+ }
802
+ return str;
803
+ }
804
+ }
805
+ classpaths.set(Generic, { path: "URI::Generic", permanent: true });
806
+ //# sourceMappingURL=generic.js.map