@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,369 @@
|
|
|
1
|
+
import { TopLevel } from "../object.js";
|
|
2
|
+
import { ArgumentError } from "../argument-error.js";
|
|
3
|
+
import { Encoding } from "../encoding.js";
|
|
4
|
+
import { rbObjClone, constSet } from "../include.js";
|
|
5
|
+
import { bytes, strNew } from "../string/bytes.js";
|
|
6
|
+
import { encode } from "../string/encode.js";
|
|
7
|
+
import { forceEncoding, rbObjEncoding } from "../string/force-encoding.js";
|
|
8
|
+
import { Generic } from "./generic.js";
|
|
9
|
+
import { RFC2396Parser } from "./rfc2396-parser.js";
|
|
10
|
+
import { RFC3986Parser } from "./rfc3986-parser.js";
|
|
11
|
+
/**
|
|
12
|
+
* `URI::RFC3986_PARSER` (`vendor/ruby/v3.3.11/lib/uri/common.rb:20`), the parser
|
|
13
|
+
* `URI.parse` splits with and the one every parsed URI carries.
|
|
14
|
+
*
|
|
15
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails: `URI::RFC3986_PARSER`
|
|
16
|
+
* (`vendor/ruby/v3.3.11/lib/uri/common.rb:20`) ships with the interpreter.
|
|
17
|
+
*/
|
|
18
|
+
export const RFC3986_PARSER = new RFC3986Parser();
|
|
19
|
+
/**
|
|
20
|
+
* `URI::RFC2396_PARSER` (`vendor/ruby/v3.3.11/lib/uri/common.rb:22`), which
|
|
21
|
+
* `Rack::Utils::URI_PARSER` (`vendor/rack/v3.2.8/lib/rack/utils.rb:27`) and
|
|
22
|
+
* `RoutesInspector#normalize_filter` (`inspector.rb:104`) escape through.
|
|
23
|
+
*
|
|
24
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails: `URI::RFC2396_PARSER`
|
|
25
|
+
* (`vendor/ruby/v3.3.11/lib/uri/common.rb:22`) ships with the interpreter.
|
|
26
|
+
*/
|
|
27
|
+
export const RFC2396_PARSER = new RFC2396Parser();
|
|
28
|
+
/**
|
|
29
|
+
* `URI::DEFAULT_PARSER` (`vendor/ruby/v3.3.11/lib/uri/common.rb:26`), `URI::Parser.new`
|
|
30
|
+
* — `Parser` is `RFC2396_Parser` (`common.rb:19`) — and the parser
|
|
31
|
+
* `URI::Generic#initialize` defaults to (`generic.rb:174`). MRI's `const_set`
|
|
32
|
+
* loop copying its tables onto `URI` (`common.rb:27-34`) has no port: nothing
|
|
33
|
+
* here reads `URI::ABS_URI`, and the tables hang off the parser.
|
|
34
|
+
*
|
|
35
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails: `URI::DEFAULT_PARSER`
|
|
36
|
+
* (`vendor/ruby/v3.3.11/lib/uri/common.rb:26`) ships with the interpreter.
|
|
37
|
+
*/
|
|
38
|
+
export const DEFAULT_PARSER = new RFC2396Parser();
|
|
39
|
+
/**
|
|
40
|
+
* `URI::Error` (`vendor/ruby/v3.3.11/lib/uri/common.rb:140`), the base class of every
|
|
41
|
+
* URI exception. It extends `globalThis.Error` rather than a bare `Error`
|
|
42
|
+
* because the class's own binding shadows the global inside its own heritage
|
|
43
|
+
* clause; `StandardError`, Ruby's superclass here, is the JS `Error`.
|
|
44
|
+
*
|
|
45
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails: `URI::Error`
|
|
46
|
+
* (`vendor/ruby/v3.3.11/lib/uri/common.rb:140`).
|
|
47
|
+
*/
|
|
48
|
+
export class Error extends globalThis.Error {
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* `URI::InvalidURIError` (`vendor/ruby/v3.3.11/lib/uri/common.rb:144`) — not a URI.
|
|
52
|
+
*
|
|
53
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails:
|
|
54
|
+
* `URI::InvalidURIError` (`vendor/ruby/v3.3.11/lib/uri/common.rb:144`).
|
|
55
|
+
*/
|
|
56
|
+
export class InvalidURIError extends Error {
|
|
57
|
+
constructor(message) {
|
|
58
|
+
super(message);
|
|
59
|
+
this.name = "URI::InvalidURIError";
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* `URI::InvalidComponentError` (`vendor/ruby/v3.3.11/lib/uri/common.rb:148`) — not a
|
|
64
|
+
* URI component.
|
|
65
|
+
*
|
|
66
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails:
|
|
67
|
+
* `URI::InvalidComponentError` (`vendor/ruby/v3.3.11/lib/uri/common.rb:148`).
|
|
68
|
+
*/
|
|
69
|
+
export class InvalidComponentError extends Error {
|
|
70
|
+
constructor(message) {
|
|
71
|
+
super(message);
|
|
72
|
+
this.name = "URI::InvalidComponentError";
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* `URI::BadURIError` (`vendor/ruby/v3.3.11/lib/uri/common.rb:152`) — the URI is valid,
|
|
77
|
+
* the usage is not.
|
|
78
|
+
*
|
|
79
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails: `URI::BadURIError`
|
|
80
|
+
* (`vendor/ruby/v3.3.11/lib/uri/common.rb:152`).
|
|
81
|
+
*/
|
|
82
|
+
export class BadURIError extends Error {
|
|
83
|
+
constructor(message) {
|
|
84
|
+
super(message);
|
|
85
|
+
this.name = "URI::BadURIError";
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/** `URI::Schemes` (`vendor/ruby/v3.3.11/lib/uri/common.rb:69`), the namespace
|
|
89
|
+
* `register_scheme` sets a constant on. A Map here: a JS module has no
|
|
90
|
+
* namespace to hang a constant off, and MRI's `const_set` is doing no more
|
|
91
|
+
* than this. */
|
|
92
|
+
const Schemes = new Map();
|
|
93
|
+
/**
|
|
94
|
+
* `URI::TBLENCWWWCOMP_` (`vendor/ruby/v3.3.11/lib/uri/common.rb:283-289`), the
|
|
95
|
+
* byte-to-escape table `encode_www_form_component` substitutes through, with
|
|
96
|
+
* `' '` mapped to `'+'`. `TBLENCURICOMP_` (`common.rb:287`) has no call site
|
|
97
|
+
* here and is not ported.
|
|
98
|
+
*/
|
|
99
|
+
const TBLENCWWWCOMP_ = {};
|
|
100
|
+
for (let i = 0; i < 256; i++) {
|
|
101
|
+
TBLENCWWWCOMP_[String.fromCharCode(i)] = `%${i.toString(16).toUpperCase().padStart(2, "0")}`;
|
|
102
|
+
}
|
|
103
|
+
TBLENCWWWCOMP_[" "] = "+";
|
|
104
|
+
/**
|
|
105
|
+
* `URI::TBLDECWWWCOMP_` (`vendor/ruby/v3.3.11/lib/uri/common.rb:290-299`), the
|
|
106
|
+
* table `decode_www_form` substitutes `+` and each `%XX` through, in all four
|
|
107
|
+
* hex-digit cases.
|
|
108
|
+
*/
|
|
109
|
+
const TBLDECWWWCOMP_ = {};
|
|
110
|
+
for (let i = 0; i < 256; i++) {
|
|
111
|
+
const [h, l] = [(i >> 4).toString(16), (i & 15).toString(16)];
|
|
112
|
+
for (const hh of [h.toUpperCase(), h]) {
|
|
113
|
+
for (const ll of [l.toUpperCase(), l])
|
|
114
|
+
TBLDECWWWCOMP_[`%${hh}${ll}`] = String.fromCharCode(i);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
TBLDECWWWCOMP_["+"] = " ";
|
|
118
|
+
/**
|
|
119
|
+
* `URI::Util` (`vendor/ruby/v3.3.11/lib/uri/common.rb:36-67`).
|
|
120
|
+
*
|
|
121
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails: `URI::Util`
|
|
122
|
+
* (`vendor/ruby/v3.3.11/lib/uri/common.rb:36`) ships with the interpreter.
|
|
123
|
+
*/
|
|
124
|
+
export const Util = {
|
|
125
|
+
/**
|
|
126
|
+
* `make_components_hash` (`vendor/ruby/v3.3.11/lib/uri/common.rb:38-65`): an
|
|
127
|
+
* Array of every component but the scheme, in `klass.component` order, or a
|
|
128
|
+
* Hash of them, copied into a new Hash with `scheme` set to the class's
|
|
129
|
+
* downcased short name.
|
|
130
|
+
*
|
|
131
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails:
|
|
132
|
+
* `URI::Util.make_components_hash` (`vendor/ruby/v3.3.11/lib/uri/common.rb:38`).
|
|
133
|
+
*/
|
|
134
|
+
makeComponentsHash(klass, arrayHash) {
|
|
135
|
+
const tmp = {};
|
|
136
|
+
if (Array.isArray(arrayHash) && arrayHash.length === klass.component().length - 1) {
|
|
137
|
+
klass
|
|
138
|
+
.component()
|
|
139
|
+
.slice(1)
|
|
140
|
+
.forEach((c, i) => {
|
|
141
|
+
tmp[c] = rbObjClone(arrayHash[i]);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
else if (arrayHash != null && typeof arrayHash === "object" && !Array.isArray(arrayHash)) {
|
|
145
|
+
for (const [key, value] of Object.entries(arrayHash)) {
|
|
146
|
+
tmp[key] = rbObjClone(value);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
throw new ArgumentError(`expected Array of or Hash of components of ${klass.name} (${klass.component().slice(1).join(", ")})`);
|
|
151
|
+
}
|
|
152
|
+
tmp["scheme"] = klass.name.replace(/^.*::/, "").toLowerCase();
|
|
153
|
+
return tmp;
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* `URI` (`vendor/ruby/v3.3.11/lib/uri/common.rb:15`), the module `parse` and the
|
|
158
|
+
* scheme registry live on. Only the members trails sends are ported —
|
|
159
|
+
* `scheme_list` (`common.rb:99`), `split` (`common.rb:172`) and `join`
|
|
160
|
+
* (`common.rb:213`) have no call site in this repo and are not.
|
|
161
|
+
*
|
|
162
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails: `URI`
|
|
163
|
+
* (`vendor/ruby/v3.3.11/lib/uri/common.rb:15`) ships with the interpreter.
|
|
164
|
+
*/
|
|
165
|
+
export class URI {
|
|
166
|
+
/**
|
|
167
|
+
* `URI::Generic` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:21`).
|
|
168
|
+
*
|
|
169
|
+
* @noRailsEquivalent PERMANENT
|
|
170
|
+
*/
|
|
171
|
+
static get Generic() {
|
|
172
|
+
return Generic;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* `URI.register_scheme` (`vendor/ruby/v3.3.11/lib/uri/common.rb:81`).
|
|
176
|
+
*
|
|
177
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails:
|
|
178
|
+
* `URI.register_scheme` (`vendor/ruby/v3.3.11/lib/uri/common.rb:81`).
|
|
179
|
+
*/
|
|
180
|
+
static registerScheme(scheme, klass) {
|
|
181
|
+
Schemes.set(scheme.toUpperCase(), klass);
|
|
182
|
+
return klass;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* `URI.for` (`vendor/ruby/v3.3.11/lib/uri/common.rb:125`). MRI reads the
|
|
186
|
+
* Ractor-shareable `INITIAL_SCHEMES` snapshot before `Schemes` itself and
|
|
187
|
+
* guards the `const_get` with `/\A[A-Z]\w*\z/` (`common.rb:126-131`);
|
|
188
|
+
* there is one Map registry here, so one lookup answers both and a Map key
|
|
189
|
+
* needs no constant-name check. The `default:` kwarg keeps its `Generic`
|
|
190
|
+
* value but not its name — `default` is a reserved word in a JS parameter
|
|
191
|
+
* list — and no caller in the tree passes it.
|
|
192
|
+
*/
|
|
193
|
+
static for(scheme, ...args) {
|
|
194
|
+
const constName = String(scheme).toUpperCase();
|
|
195
|
+
let uriClass = Schemes.get(constName);
|
|
196
|
+
uriClass ??= Generic;
|
|
197
|
+
return new uriClass(scheme, ...args);
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* `URI.encode_www_form_component` (`vendor/ruby/v3.3.11/lib/uri/common.rb:337-339`).
|
|
201
|
+
*
|
|
202
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails:
|
|
203
|
+
* `URI.encode_www_form_component` (`vendor/ruby/v3.3.11/lib/uri/common.rb:337`).
|
|
204
|
+
*/
|
|
205
|
+
static encodeWwwFormComponent(str, enc = null) {
|
|
206
|
+
return URI._encodeUriComponent(/[^*\-.0-9A-Z_a-z]/g, TBLENCWWWCOMP_, str, enc);
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* `URI._encode_uri_component`
|
|
210
|
+
* (`vendor/ruby/v3.3.11/lib/uri/common.rb:385-397`), private in MRI. `str.to_s` is
|
|
211
|
+
* `""` for `nil`. `force_encoding(ASCII_8BIT)` leaves a JS string as it is,
|
|
212
|
+
* so the `gsub!` runs over the String's bytes and the table is indexed by
|
|
213
|
+
* byte exactly as MRI indexes it.
|
|
214
|
+
*/
|
|
215
|
+
static _encodeUriComponent(regexp, table, str, enc) {
|
|
216
|
+
let s = str == null ? "" : str instanceof Uint8Array ? str : String(str);
|
|
217
|
+
if (rbObjEncoding(s) !== Encoding.ASCII_8BIT) {
|
|
218
|
+
if (enc != null && enc !== Encoding.ASCII_8BIT) {
|
|
219
|
+
s = encode(s, Encoding.UTF_8, { invalid: ":replace", undef: ":replace" });
|
|
220
|
+
s = encode(s, enc, { fallback: (x) => `&#${x.codePointAt(0)};` });
|
|
221
|
+
}
|
|
222
|
+
s = forceEncoding(s, Encoding.ASCII_8BIT);
|
|
223
|
+
}
|
|
224
|
+
let b = "";
|
|
225
|
+
for (const byte of typeof s === "string" ? bytes(s) : s) {
|
|
226
|
+
b += String.fromCharCode(byte);
|
|
227
|
+
}
|
|
228
|
+
return b.replace(regexp, (c) => table[c]);
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* `URI.decode_www_form_component` (`vendor/ruby/v3.3.11/lib/uri/common.rb:370-372`).
|
|
232
|
+
* `enc` is accepted for Ruby's signature; the result is always the UTF-8 arm,
|
|
233
|
+
* since a JS string has no encoding tag (CLAUDE.md, "A String has no encoding
|
|
234
|
+
* tag either").
|
|
235
|
+
*
|
|
236
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails:
|
|
237
|
+
* `URI.decode_www_form_component` (`vendor/ruby/v3.3.11/lib/uri/common.rb:370`).
|
|
238
|
+
*/
|
|
239
|
+
static decodeWwwFormComponent(str, enc = Encoding.UTF_8) {
|
|
240
|
+
return URI._decodeUriComponent(/\+|%[0-9a-fA-F]{2}/g, str, enc);
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* `URI._decode_uri_component` (`vendor/ruby/v3.3.11/lib/uri/common.rb:399-402`),
|
|
244
|
+
* private in MRI. `str.b` is the String's bytes one character per byte; the
|
|
245
|
+
* `force_encoding` is its UTF-8 arm (CLAUDE.md, "A String has no encoding tag
|
|
246
|
+
* either"), so a byte that is not well-formed UTF-8 is carried, not raised on.
|
|
247
|
+
*
|
|
248
|
+
* @perf 4x — PERMANENT
|
|
249
|
+
*/
|
|
250
|
+
static _decodeUriComponent(regexp, str, _enc) {
|
|
251
|
+
if (/%(?![0-9a-fA-F]{2})/.test(str))
|
|
252
|
+
throw new ArgumentError(`invalid %-encoding (${str})`);
|
|
253
|
+
let b = "";
|
|
254
|
+
if (!/[\u0080-\uffff]/.test(str))
|
|
255
|
+
b = str;
|
|
256
|
+
else
|
|
257
|
+
for (const byte of bytes(str))
|
|
258
|
+
b += String.fromCharCode(byte);
|
|
259
|
+
const decoded = b.replace(regexp, (c) => TBLDECWWWCOMP_[c]);
|
|
260
|
+
if (!/[\u0080-\uffff]/.test(decoded))
|
|
261
|
+
return decoded;
|
|
262
|
+
return strNew(Array.from(decoded, (c) => c.charCodeAt(0)));
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* `URI.split` (`vendor/ruby/v3.3.11/lib/uri/common.rb:172`).
|
|
266
|
+
*
|
|
267
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails: `URI.split`
|
|
268
|
+
* (`vendor/ruby/v3.3.11/lib/uri/common.rb:172`).
|
|
269
|
+
*/
|
|
270
|
+
static split(uri) {
|
|
271
|
+
return RFC3986_PARSER.split(uri);
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* `URI.encode_www_form` (`vendor/ruby/v3.3.11/lib/uri/common.rb:503-521`): each
|
|
275
|
+
* pair as `key=value`, a `nil` value as the bare key and an Array value as
|
|
276
|
+
* one pair per element, joined by `&`.
|
|
277
|
+
*
|
|
278
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails: `URI.encode_www_form`
|
|
279
|
+
* (`vendor/ruby/v3.3.11/lib/uri/common.rb:503`).
|
|
280
|
+
*/
|
|
281
|
+
static encodeWwwForm(enum_, enc = null) {
|
|
282
|
+
return (Array.isArray(enum_) ? enum_ : Object.entries(enum_))
|
|
283
|
+
.map(([k, v]) => {
|
|
284
|
+
if (v == null) {
|
|
285
|
+
return URI.encodeWwwFormComponent(k, enc);
|
|
286
|
+
}
|
|
287
|
+
else if (Array.isArray(v)) {
|
|
288
|
+
return v
|
|
289
|
+
.map((w) => {
|
|
290
|
+
let str = URI.encodeWwwFormComponent(k, enc);
|
|
291
|
+
if (w != null) {
|
|
292
|
+
str += "=";
|
|
293
|
+
str += URI.encodeWwwFormComponent(w, enc);
|
|
294
|
+
}
|
|
295
|
+
return str;
|
|
296
|
+
})
|
|
297
|
+
.join("&");
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
let str = URI.encodeWwwFormComponent(k, enc);
|
|
301
|
+
str += "=";
|
|
302
|
+
str += URI.encodeWwwFormComponent(v, enc);
|
|
303
|
+
return str;
|
|
304
|
+
}
|
|
305
|
+
})
|
|
306
|
+
.join("&");
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* `URI.decode_www_form` (`vendor/ruby/v3.3.11/lib/uri/common.rb:556-596`), its
|
|
310
|
+
* default `separator: '&'` arm: the `[key, value]` pairs of an ASCII
|
|
311
|
+
* query string, `+` and each `%XX` decoded and the bytes read as UTF-8 with
|
|
312
|
+
* invalid sequences scrubbed. The `enc`, `use__charset_` and `isindex`
|
|
313
|
+
* arms have no caller and are not ported.
|
|
314
|
+
*
|
|
315
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails: `URI.decode_www_form`
|
|
316
|
+
* (`vendor/ruby/v3.3.11/lib/uri/common.rb:556`).
|
|
317
|
+
*/
|
|
318
|
+
static decodeWwwForm(str) {
|
|
319
|
+
// eslint-disable-next-line no-control-regex
|
|
320
|
+
if (!/^[\x00-\x7f]*$/.test(str)) {
|
|
321
|
+
throw new ArgumentError("the input of URI.decode_www_form must be ASCII only string");
|
|
322
|
+
}
|
|
323
|
+
const ary = [];
|
|
324
|
+
if (str === "")
|
|
325
|
+
return ary;
|
|
326
|
+
const decoder = new TextDecoder("utf-8");
|
|
327
|
+
const scrub = (s) => decoder.decode(Uint8Array.from(s, (c) => c.charCodeAt(0)));
|
|
328
|
+
for (const string of str.split(/(?<=&)/)) {
|
|
329
|
+
const field = string.endsWith("&") ? string.slice(0, -1) : string;
|
|
330
|
+
const i = field.indexOf("=");
|
|
331
|
+
const key = i < 0 ? field : field.slice(0, i);
|
|
332
|
+
const val = i < 0 ? "" : field.slice(i + 1);
|
|
333
|
+
ary.push([
|
|
334
|
+
scrub(key.replace(/\+|%[0-9a-fA-F]{2}/g, (c) => TBLDECWWWCOMP_[c])),
|
|
335
|
+
scrub(val.replace(/\+|%[0-9a-fA-F]{2}/g, (c) => TBLDECWWWCOMP_[c])),
|
|
336
|
+
]);
|
|
337
|
+
}
|
|
338
|
+
return ary;
|
|
339
|
+
}
|
|
340
|
+
/** `URI.parse` (`vendor/ruby/v3.3.11/lib/uri/common.rb:186`). */
|
|
341
|
+
static parse(uri) {
|
|
342
|
+
return RFC3986_PARSER.parse(uri);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
constSet(TopLevel, "URI", URI);
|
|
346
|
+
constSet(URI, "Error", Error);
|
|
347
|
+
constSet(URI, "InvalidURIError", InvalidURIError);
|
|
348
|
+
constSet(URI, "InvalidComponentError", InvalidComponentError);
|
|
349
|
+
constSet(URI, "BadURIError", BadURIError);
|
|
350
|
+
/**
|
|
351
|
+
* Mirrors: Ruby's `Kernel#URI`, `vendor/ruby/v3.3.11/lib/uri/common.rb:844`.
|
|
352
|
+
*
|
|
353
|
+
* @noRailsEquivalent PERMANENT
|
|
354
|
+
*/
|
|
355
|
+
export function kernelURI(uri) {
|
|
356
|
+
if (uri instanceof Generic) {
|
|
357
|
+
return uri;
|
|
358
|
+
}
|
|
359
|
+
else if (typeof uri === "string") {
|
|
360
|
+
return URI.parse(uri);
|
|
361
|
+
}
|
|
362
|
+
else if (uri != null && typeof uri.toStr === "function") {
|
|
363
|
+
return URI.parse(uri.toStr());
|
|
364
|
+
}
|
|
365
|
+
else {
|
|
366
|
+
throw new ArgumentError("bad argument (expected URI object or URI string)");
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../lib/uri/common.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AAQ,CAAC,GAAG,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;AAE1C;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,GAAY;IACpC,IAAI,GAAG,YAAY,OAAO,EAAE,CAAC;QAC3B,OAAO,GAAG,CAAC;IACb,CAAC;SAAM,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QACnC,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;SAAM,IAAI,GAAG,IAAI,IAAI,IAAI,OAAQ,GAA2B,CAAC,KAAK,KAAK,UAAU,EAAE,CAAC;QACnF,OAAO,GAAG,CAAC,KAAK,CAAE,GAA2B,CAAC,KAAK,EAAE,CAAC,CAAC;IACzD,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,aAAa,CAAC,kDAAkD,CAAC,CAAC;IAC9E,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import type { RFC2396Parser } from "./rfc2396-parser.js";
|
|
2
|
+
import type { RFC3986Parser } from "./rfc3986-parser.js";
|
|
3
|
+
/**
|
|
4
|
+
* `URI::Generic` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:21`), the base class of every
|
|
5
|
+
* scheme class and what `URI.parse` answers for a scheme it does not know.
|
|
6
|
+
* Only the members trails sends are ported: the component readers and their
|
|
7
|
+
* mutable setters, `merge` and the private helpers it reaches through. The
|
|
8
|
+
* unsent ones are not, and the list is exhaustive: `build2` (`generic.rb:78`),
|
|
9
|
+
* `registry` and its `check_` / `set_` / `=` trio
|
|
10
|
+
* (`generic.rb:252,750,755,760`), the `user=` / `password=` setters
|
|
11
|
+
* (`generic.rb:471,498`), `set_user` / `set_password`
|
|
12
|
+
* (`generic.rb:524,534`), `escape_userpass` (`generic.rb:551`),
|
|
13
|
+
* `decoded_user` / `decoded_password` (`generic.rb:584,589`),
|
|
14
|
+
* `hierarchical?` (`generic.rb:976`), `merge!` (`generic.rb:1096`), `route_from_path` / `route_from0` /
|
|
15
|
+
* `route_from` / `route_to` (`generic.rb:1167,1206,1274,1314`), `normalize` /
|
|
16
|
+
* `hash` / `eql?` (`generic.rb:1404,1408`), `select`
|
|
17
|
+
* (`generic.rb:1452`), `coerce`
|
|
18
|
+
* (`generic.rb:1486`), `replace!` (`generic.rb:299`), and `find_proxy` /
|
|
19
|
+
* `use_proxy?` (`generic.rb:1512,1578`).
|
|
20
|
+
*
|
|
21
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails: `URI::Generic`
|
|
22
|
+
* (`vendor/ruby/v3.3.11/lib/uri/generic.rb:21`) ships with the interpreter.
|
|
23
|
+
*/
|
|
24
|
+
export declare class Generic {
|
|
25
|
+
/** `DEFAULT_PORT` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:27`). */
|
|
26
|
+
static readonly DEFAULT_PORT: number | null;
|
|
27
|
+
/**
|
|
28
|
+
* `COMPONENT` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:46-52`).
|
|
29
|
+
*
|
|
30
|
+
* @noRailsEquivalent PERMANENT
|
|
31
|
+
*/
|
|
32
|
+
static readonly COMPONENT: readonly string[];
|
|
33
|
+
/**
|
|
34
|
+
* `self.component` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:57`).
|
|
35
|
+
*
|
|
36
|
+
* @noRailsEquivalent PERMANENT
|
|
37
|
+
*/
|
|
38
|
+
static component(): readonly string[];
|
|
39
|
+
/**
|
|
40
|
+
* `self.build` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:116-137`): the
|
|
41
|
+
* components as an Array in `COMPONENT` order or a Hash keyed by them,
|
|
42
|
+
* passed to `new` with the default parser and `arg_check` on.
|
|
43
|
+
*
|
|
44
|
+
* @noRailsEquivalent PERMANENT
|
|
45
|
+
*/
|
|
46
|
+
static build(args: unknown[] | Record<string, unknown>): Generic;
|
|
47
|
+
/** `self.default_port` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:32`). */
|
|
48
|
+
static get defaultPort(): number | null;
|
|
49
|
+
/** `default_port` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:39`). */
|
|
50
|
+
get defaultPort(): number | null;
|
|
51
|
+
protected _scheme: string | null;
|
|
52
|
+
protected _user: string | null;
|
|
53
|
+
protected _password: string | null;
|
|
54
|
+
protected _host: string | null;
|
|
55
|
+
protected _port: number | null;
|
|
56
|
+
protected _path: string | null;
|
|
57
|
+
protected _query: string | null;
|
|
58
|
+
protected _opaque: string | null;
|
|
59
|
+
protected _fragment: string | null;
|
|
60
|
+
protected _parser: RFC2396Parser | RFC3986Parser | null;
|
|
61
|
+
/** `initialize` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:169`). */
|
|
62
|
+
constructor(scheme: string | null, userinfo: string | null, host: string | null, port: string | number | null, registry: string | null, path: string | null, opaque: string | null, query: string | null, fragment: string | null, parser?: RFC2396Parser | RFC3986Parser, argCheck?: boolean);
|
|
63
|
+
/** `scheme` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:221`). */
|
|
64
|
+
get scheme(): string | null;
|
|
65
|
+
/** `host` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:243`). */
|
|
66
|
+
get host(): string | null;
|
|
67
|
+
/**
|
|
68
|
+
* `hostname` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:668`).
|
|
69
|
+
*
|
|
70
|
+
* @noRailsEquivalent PERMANENT
|
|
71
|
+
*/
|
|
72
|
+
get hostname(): string | null;
|
|
73
|
+
/** `port` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:250`). */
|
|
74
|
+
get port(): number | null;
|
|
75
|
+
/** `path` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:260`). */
|
|
76
|
+
get path(): string | null;
|
|
77
|
+
/** `query` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:266`). */
|
|
78
|
+
get query(): string | null;
|
|
79
|
+
/**
|
|
80
|
+
* `opaque` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:277`).
|
|
81
|
+
*
|
|
82
|
+
* @noRailsEquivalent PERMANENT
|
|
83
|
+
*/
|
|
84
|
+
get opaque(): string | null;
|
|
85
|
+
/**
|
|
86
|
+
* `fragment` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:283`).
|
|
87
|
+
*
|
|
88
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails:
|
|
89
|
+
* `URI::Generic#fragment` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:283`).
|
|
90
|
+
*/
|
|
91
|
+
get fragment(): string | null;
|
|
92
|
+
/** `parser` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:289`). */
|
|
93
|
+
get parser(): RFC2396Parser | RFC3986Parser;
|
|
94
|
+
/**
|
|
95
|
+
* `check_scheme` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:320`).
|
|
96
|
+
* @internal
|
|
97
|
+
*/
|
|
98
|
+
protected checkScheme(v: string | null): boolean;
|
|
99
|
+
/** `set_scheme` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:334`). */
|
|
100
|
+
protected setScheme(v: string | null): void;
|
|
101
|
+
/** `scheme=` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:360`). */
|
|
102
|
+
set scheme(v: string | null);
|
|
103
|
+
/**
|
|
104
|
+
* `check_userinfo` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:375`).
|
|
105
|
+
* @internal
|
|
106
|
+
*/
|
|
107
|
+
private checkUserinfo;
|
|
108
|
+
/**
|
|
109
|
+
* `check_user` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:393`).
|
|
110
|
+
* @internal
|
|
111
|
+
*/
|
|
112
|
+
private checkUser;
|
|
113
|
+
/**
|
|
114
|
+
* `check_password` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:417`).
|
|
115
|
+
* @internal
|
|
116
|
+
*/
|
|
117
|
+
private checkPassword;
|
|
118
|
+
/**
|
|
119
|
+
* `userinfo=` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:441`).
|
|
120
|
+
*
|
|
121
|
+
* @noRailsEquivalent PERMANENT
|
|
122
|
+
*/
|
|
123
|
+
set userinfo(userinfo: string | null);
|
|
124
|
+
/** `set_userinfo` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:509`). */
|
|
125
|
+
protected setUserinfo(user: string | null, password?: string | null): [string | null, string | null];
|
|
126
|
+
/** `split_userinfo` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:542`). */
|
|
127
|
+
private splitUserinfo;
|
|
128
|
+
/**
|
|
129
|
+
* `userinfo` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:557`) — `user`, or
|
|
130
|
+
* `user:password` where both are set.
|
|
131
|
+
*
|
|
132
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails:
|
|
133
|
+
* `URI::Generic#userinfo` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:557`).
|
|
134
|
+
*/
|
|
135
|
+
get userinfo(): string | null;
|
|
136
|
+
/**
|
|
137
|
+
* `user` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:568`).
|
|
138
|
+
*
|
|
139
|
+
* @noRailsEquivalent PERMANENT
|
|
140
|
+
*/
|
|
141
|
+
get user(): string | null;
|
|
142
|
+
/**
|
|
143
|
+
* `password` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:573`).
|
|
144
|
+
*
|
|
145
|
+
* @noRailsEquivalent PERMANENT
|
|
146
|
+
*/
|
|
147
|
+
get password(): string | null;
|
|
148
|
+
/** `authority` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:579`) — the array of user,
|
|
149
|
+
* password, host and port, or `nil` when none of them is set. */
|
|
150
|
+
get authority(): [string | null, string | null, string | null, number | null] | null;
|
|
151
|
+
/**
|
|
152
|
+
* `check_host` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:600`).
|
|
153
|
+
* @internal
|
|
154
|
+
*/
|
|
155
|
+
protected checkHost(v: string | null): boolean | null;
|
|
156
|
+
/** `set_host` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:619`). */
|
|
157
|
+
protected setHost(v: string | null): void;
|
|
158
|
+
/** `set_authority` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:626`). */
|
|
159
|
+
protected setAuthority(user: string | null, password: string | null, host: string | null, port?: number | null): void;
|
|
160
|
+
/**
|
|
161
|
+
* `hostname=` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:685`).
|
|
162
|
+
*
|
|
163
|
+
* @noRailsEquivalent PERMANENT
|
|
164
|
+
*/
|
|
165
|
+
set hostname(v: string | null);
|
|
166
|
+
/** `host=` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:652`). */
|
|
167
|
+
set host(v: string | null);
|
|
168
|
+
/** `check_port` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:697`). */
|
|
169
|
+
private checkPort;
|
|
170
|
+
/**
|
|
171
|
+
* `set_port` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:716`).
|
|
172
|
+
*
|
|
173
|
+
* The conversion is `String#to_i` (`rb_str_to_i`,
|
|
174
|
+
* `vendor/ruby/v3.3.11/string.c:6602`), which answers `0` for a string with no
|
|
175
|
+
* leading digit run — `regexp[:PORT]` admits one made only of whitespace —
|
|
176
|
+
* where `parseInt` would answer `NaN`.
|
|
177
|
+
*/
|
|
178
|
+
protected setPort(v: string | number | null): void;
|
|
179
|
+
/** `port=` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:743`). */
|
|
180
|
+
set port(v: string | number | null);
|
|
181
|
+
/**
|
|
182
|
+
* `check_path` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:772`).
|
|
183
|
+
* @internal
|
|
184
|
+
*/
|
|
185
|
+
protected checkPath(v: string | null): unknown;
|
|
186
|
+
/** `set_path` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:804`). */
|
|
187
|
+
protected setPath(v: string | null): void;
|
|
188
|
+
/** `path=` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:830`). */
|
|
189
|
+
set path(v: string | null);
|
|
190
|
+
/** `query=` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:854`). */
|
|
191
|
+
set query(v: string | null);
|
|
192
|
+
/** `set_opaque` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:898`). */
|
|
193
|
+
protected setOpaque(v: string | null): void;
|
|
194
|
+
/**
|
|
195
|
+
* `opaque=` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:916`).
|
|
196
|
+
*
|
|
197
|
+
* @noRailsEquivalent PERMANENT
|
|
198
|
+
*/
|
|
199
|
+
set opaque(v: string | null);
|
|
200
|
+
/** `check_opaque` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:876`). */
|
|
201
|
+
private checkOpaque;
|
|
202
|
+
/** `fragment=` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:944`). */
|
|
203
|
+
set fragment(v: string | null);
|
|
204
|
+
/**
|
|
205
|
+
* `component` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:313`).
|
|
206
|
+
*
|
|
207
|
+
* @noRailsEquivalent PERMANENT
|
|
208
|
+
*/
|
|
209
|
+
component(): readonly string[];
|
|
210
|
+
/**
|
|
211
|
+
* `normalize` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:1331`).
|
|
212
|
+
*
|
|
213
|
+
* @noRailsEquivalent PERMANENT
|
|
214
|
+
*/
|
|
215
|
+
normalize(): this;
|
|
216
|
+
/**
|
|
217
|
+
* `normalize!` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:1340`).
|
|
218
|
+
*
|
|
219
|
+
* @noRailsEquivalent PERMANENT
|
|
220
|
+
*/
|
|
221
|
+
normalizeBang(): void;
|
|
222
|
+
/**
|
|
223
|
+
* `==` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:1396`): the same class, and equal
|
|
224
|
+
* `component_ary`s once both sides are normalized.
|
|
225
|
+
*
|
|
226
|
+
* @noRailsEquivalent PERMANENT
|
|
227
|
+
*/
|
|
228
|
+
equals(oth: unknown): boolean;
|
|
229
|
+
/**
|
|
230
|
+
* `component_ary` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:1428`).
|
|
231
|
+
* @internal
|
|
232
|
+
*/
|
|
233
|
+
protected componentAry(): unknown[];
|
|
234
|
+
/**
|
|
235
|
+
* `inspect` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:1463`). Every scheme class
|
|
236
|
+
* lives under `URI`, so the class is named with that prefix.
|
|
237
|
+
*
|
|
238
|
+
* @noRailsEquivalent PERMANENT
|
|
239
|
+
*/
|
|
240
|
+
inspect(): string;
|
|
241
|
+
/**
|
|
242
|
+
* `absolute?` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:987`).
|
|
243
|
+
*
|
|
244
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails:
|
|
245
|
+
* `URI::Generic#absolute?` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:987`).
|
|
246
|
+
*/
|
|
247
|
+
isAbsolute(): boolean;
|
|
248
|
+
/**
|
|
249
|
+
* `relative?` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:999`).
|
|
250
|
+
*
|
|
251
|
+
* @noRailsEquivalent PERMANENT — Ruby stdlib, not Rails:
|
|
252
|
+
* `URI::Generic#relative?` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:999`).
|
|
253
|
+
*/
|
|
254
|
+
isRelative(): boolean;
|
|
255
|
+
/** `split_path` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:1006`) — Ruby's
|
|
256
|
+
* `String#split("/", -1)` keeps trailing empties and answers `[]` for `""`,
|
|
257
|
+
* neither of which JS's `String#split` does. */
|
|
258
|
+
private splitPath;
|
|
259
|
+
/** `merge_path` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:1015`). */
|
|
260
|
+
private mergePath;
|
|
261
|
+
/** `merge` / `+` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:1124`). */
|
|
262
|
+
merge(oth: Generic | string): Generic;
|
|
263
|
+
/** `Object#dup` (`vendor/ruby/v3.3.11/object.c:2205`) of a URI — the shallow copy
|
|
264
|
+
* `merge` mutates in place (`generic.rb:1140`). */
|
|
265
|
+
protected dup(): this;
|
|
266
|
+
/**
|
|
267
|
+
* `find_proxy` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:1512-1576`). The
|
|
268
|
+
* `IPSocket.getaddress` lookup is the adapter's resolver, so the method is
|
|
269
|
+
* awaited.
|
|
270
|
+
*
|
|
271
|
+
* @noRailsEquivalent PERMANENT
|
|
272
|
+
*/
|
|
273
|
+
findProxy(env?: Readonly<Record<string, string | undefined>>): Promise<Generic | null>;
|
|
274
|
+
/**
|
|
275
|
+
* `self.use_proxy?` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:1578-1597`).
|
|
276
|
+
*
|
|
277
|
+
* @noRailsEquivalent PERMANENT
|
|
278
|
+
*/
|
|
279
|
+
static isUseProxy(hostname: string, addr: string | null, port: number | null, noProxy: string): boolean;
|
|
280
|
+
/** `to_s` (`vendor/ruby/v3.3.11/lib/uri/generic.rb:1355`). */
|
|
281
|
+
toString(): string;
|
|
282
|
+
}
|
|
283
|
+
//# sourceMappingURL=generic.d.ts.map
|