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