@blazetrails/ruby-compat 0.0.0-stage → 0.1.0-alpha0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +78 -0
- package/dist/backtrace-location.js +158 -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 +111 -0
- package/dist/big-decimal.js +584 -0
- package/dist/big-decimal.js.map +1 -0
- package/dist/bundler.d.ts +44 -0
- package/dist/bundler.js +97 -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 +93 -0
- package/dist/classpath.js +210 -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 +49 -0
- package/dist/complex.js +164 -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 +225 -0
- package/dist/dir.js +608 -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 +1102 -0
- package/dist/enumerable.js.map +1 -0
- package/dist/enumerator.d.ts +324 -0
- package/dist/enumerator.js +625 -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 +447 -0
- package/dist/errno.js +616 -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 +44 -0
- package/dist/exception.js +115 -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 +1824 -0
- package/dist/file-utils.js.map +1 -0
- package/dist/file.d.ts +643 -0
- package/dist/file.js +1334 -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 +41 -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 +55 -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 +124 -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 +2208 -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 +70 -0
- package/dist/json.js +181 -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 +39 -0
- package/dist/kernel-system.js +103 -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 +128 -0
- package/dist/load.js +278 -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 +218 -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 +81 -0
- package/dist/method-cache.js +109 -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 +13 -0
- package/dist/not-implemented-error.js.map +1 -0
- package/dist/numeric-class.d.ts +29 -0
- package/dist/numeric-class.js +41 -0
- package/dist/numeric-class.js.map +1 -0
- package/dist/numeric.d.ts +226 -0
- package/dist/numeric.js +848 -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 +833 -0
- package/dist/object.js +2131 -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 +73 -0
- package/dist/pathname.js +412 -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 +229 -0
- package/dist/process-adapter.js +889 -0
- package/dist/process-adapter.js.map +1 -0
- package/dist/process.d.ts +202 -0
- package/dist/process.js +433 -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 +31 -0
- package/dist/psych/scalar-scanner.js +169 -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 +137 -0
- package/dist/queue.js +236 -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 +168 -0
- package/dist/rational.js +587 -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 +262 -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 +270 -0
- package/dist/repl-adapter.js +562 -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 +15 -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 +50 -0
- package/dist/secure-random.js +141 -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 +43 -0
- package/dist/signal-exception.js +88 -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 +27 -0
- package/dist/standard-error.js +49 -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 +142 -0
- package/dist/string/support.js +296 -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 +295 -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 +121 -0
- package/dist/thread-pool-executor.js +254 -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 +66 -0
- package/dist/tse.js.map +1 -0
- package/dist/type-error.d.ts +14 -0
- package/dist/type-error.js +14 -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 +280 -0
- package/dist/uri/generic.js +806 -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 +39 -0
- package/dist/verbose.js +49 -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 +119 -0
- package/dist/zlib-adapter.js +230 -0
- package/dist/zlib-adapter.js.map +1 -0
- package/dist/zlib.d.ts +299 -0
- package/dist/zlib.js +679 -0
- package/dist/zlib.js.map +1 -0
- package/package.json +172 -3
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ruby's core `Enumerable` module (`vendor/ruby/v3.3.11/enum.c:5047` `Init_Enumerable`):
|
|
3
|
+
* members derived from the including class's `each`, mixed in with
|
|
4
|
+
* `include(Klass, Enumerable)`. Where `each` answers a promise, each member
|
|
5
|
+
* answers a promise of its result.
|
|
6
|
+
*
|
|
7
|
+
* Only the members a trails includer reaches are ported; the rest of
|
|
8
|
+
* `Init_Enumerable` joins as a caller needs it.
|
|
9
|
+
*/
|
|
10
|
+
import { classModule } from "./class-module.js";
|
|
11
|
+
import { Hash } from "./hash.js";
|
|
12
|
+
import { Enumerator } from "./enumerator.js";
|
|
13
|
+
/** @noRailsEquivalent PERMANENT */
|
|
14
|
+
export interface Each<T, E = unknown> {
|
|
15
|
+
each(block: (i: T) => void): E;
|
|
16
|
+
}
|
|
17
|
+
/** @noRailsEquivalent PERMANENT */
|
|
18
|
+
export type Enumerated<E, R> = 0 extends 1 & E ? R : E extends Promise<unknown> ? Promise<R> : R;
|
|
19
|
+
/**
|
|
20
|
+
* `rb_yield` (`vendor/ruby/v3.3.11/vm_eval.c:1376`): one value to the block,
|
|
21
|
+
* splatted across its parameters when it is an Array and the block takes more
|
|
22
|
+
* than one, as `vm_callee_setup_block_arg_arg0_splat`
|
|
23
|
+
* (`vendor/ruby/v3.3.11/vm_insnhelper.c:4807`) does. A JS function's `length`
|
|
24
|
+
* stands in for the iseq's `lead_num`; it does not count a defaulted or rest
|
|
25
|
+
* parameter (CLAUDE.md, "Runtime facts Node does not expose", arity -1).
|
|
26
|
+
* @noRailsEquivalent PERMANENT
|
|
27
|
+
*/
|
|
28
|
+
export declare function rbYield<R>(block: (...args: never[]) => R, val: unknown): R;
|
|
29
|
+
/**
|
|
30
|
+
* `enum_to_a` (`vendor/ruby/v3.3.11/enum.c:711`): the elements `each` yields,
|
|
31
|
+
* which is what a block-less member's enumerator (`RETURN_ENUMERATOR`) holds.
|
|
32
|
+
* @noRailsEquivalent PERMANENT
|
|
33
|
+
*/
|
|
34
|
+
declare function enumToA<T, E = unknown>(obj: Iterable<T> | Each<T, E>): Enumerated<E, T[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Mirrors: Ruby's Enumerable#partition — `vendor/ruby/v3.3.11/enum.c:1102` `enum_partition`:
|
|
37
|
+
* the elements whose block result `RTEST`s, then the others (`partition_i`, `:1057`).
|
|
38
|
+
* @noRailsEquivalent PERMANENT
|
|
39
|
+
*/
|
|
40
|
+
export declare function partition<T, E = unknown>(obj: Iterable<T> | Each<T, E>, block: (i: T) => unknown): Enumerated<E, [T[], T[]]>;
|
|
41
|
+
/** @noRailsEquivalent PERMANENT */
|
|
42
|
+
export declare function partition<T, E = unknown>(obj: Iterable<T> | Each<T, E>): Enumerated<E, T[]>;
|
|
43
|
+
/**
|
|
44
|
+
* Mirrors: Ruby's Enumerable#group_by — `vendor/ruby/v3.3.11/enum.c:1157` `enum_group_by`,
|
|
45
|
+
* pushing each element onto the Array under its block result (`group_by_i`, `:1115`).
|
|
46
|
+
* @noRailsEquivalent PERMANENT
|
|
47
|
+
*/
|
|
48
|
+
export declare function groupBy<T, K, E = unknown>(obj: Iterable<T> | Each<T, E>, block: (i: T) => K): Enumerated<E, Hash<K, T[]>>;
|
|
49
|
+
/** @noRailsEquivalent PERMANENT */
|
|
50
|
+
export declare function groupBy<T, K, E = unknown>(obj: Iterable<T> | Each<T, E>, block?: (i: T) => K): Enumerated<E, Hash<K, T[]> | T[]>;
|
|
51
|
+
/**
|
|
52
|
+
* Mirrors: Ruby's Enumerable#tally — `vendor/ruby/v3.3.11/enum.c:1229` `enum_tally`: a
|
|
53
|
+
* Hash counting each element (`tally_up`, `:1165`). The `hash` argument arm is
|
|
54
|
+
* not ported: nothing passes one.
|
|
55
|
+
* @noRailsEquivalent PERMANENT
|
|
56
|
+
*/
|
|
57
|
+
export declare function tally<T, E = unknown>(obj: Iterable<T> | Each<T, E>): Enumerated<E, Hash<T, number>>;
|
|
58
|
+
/**
|
|
59
|
+
* Mirrors: Ruby's Enumerable#find_all — `vendor/ruby/v3.3.11/enum.c:509` `enum_find_all`,
|
|
60
|
+
* pushing each element whose block result `RTEST`s (`find_all_i`, `:456`).
|
|
61
|
+
* @noRailsEquivalent PERMANENT
|
|
62
|
+
*/
|
|
63
|
+
declare function enumFindAll<T, E = unknown>(obj: Iterable<T> | Each<T, E>, block?: (i: T, ...rest: never[]) => unknown): Enumerated<E, T[]>;
|
|
64
|
+
export { enumFindAll as findAll, enumFindAll as select };
|
|
65
|
+
/**
|
|
66
|
+
* Mirrors: Ruby's Enumerable#grep — `vendor/ruby/v3.3.11/enum.c:173` `enum_grep`: each
|
|
67
|
+
* element for which `pattern === elem` holds (`grep_i`), mapped through the block when
|
|
68
|
+
* one is given (`grep_iter_i`).
|
|
69
|
+
* @noRailsEquivalent PERMANENT
|
|
70
|
+
*/
|
|
71
|
+
export declare function grep<T, E = unknown>(obj: Iterable<T> | Each<T, E>, pattern: unknown, block?: (i: T) => unknown): Enumerated<E, unknown[]>;
|
|
72
|
+
export { enumToA as toA };
|
|
73
|
+
/**
|
|
74
|
+
* Mirrors: Ruby's Enumerable#reject — `vendor/ruby/v3.3.11/enum.c:593` `enum_reject`,
|
|
75
|
+
* pushing each element whose block result does not `RTEST` (`reject_i`, `:564`).
|
|
76
|
+
* @noRailsEquivalent PERMANENT
|
|
77
|
+
*/
|
|
78
|
+
export declare function reject<T, E = unknown>(obj: Iterable<T> | Each<T, E>, block?: (i: T) => unknown): Enumerated<E, T[]>;
|
|
79
|
+
/**
|
|
80
|
+
* Mirrors: Ruby's Enumerable#count — `vendor/ruby/v3.3.11/enum.c:298` `enum_count`:
|
|
81
|
+
* every element (`count_all_i`, `:263`), those `rb_equal` to the argument
|
|
82
|
+
* (`count_i`, `:239`), or those whose block result `RTEST`s (`count_iter_i`,
|
|
83
|
+
* `:252`). The block is the trailing function argument.
|
|
84
|
+
* @noRailsEquivalent PERMANENT
|
|
85
|
+
*/
|
|
86
|
+
export declare function count<T, E = unknown>(obj: Iterable<T> | Each<T, E>, ...argv: unknown[]): Enumerated<E, number>;
|
|
87
|
+
/**
|
|
88
|
+
* Mirrors: Ruby's Enumerable#filter_map — `vendor/ruby/v3.3.11/enum.c:550` `enum_filter_map`,
|
|
89
|
+
* pushing each block result that `RTEST`s (`filter_map_i`, `:522`).
|
|
90
|
+
* @noRailsEquivalent PERMANENT
|
|
91
|
+
*/
|
|
92
|
+
export declare function filterMap<T, R, E = unknown>(obj: Iterable<T> | Each<T, E>, block: (i: T) => R | false | null | undefined): Enumerated<E, R[]>;
|
|
93
|
+
/**
|
|
94
|
+
* Mirrors: Ruby's Enumerable#find — `vendor/ruby/v3.3.11/enum.c:361` `enum_find`,
|
|
95
|
+
* breaking out of `each` at the first element whose block result `RTEST`s
|
|
96
|
+
* (`find_i`, `:324`). The block is the last argument.
|
|
97
|
+
* @noRailsEquivalent PERMANENT
|
|
98
|
+
*/
|
|
99
|
+
export declare function find<T, E = unknown>(obj: Iterable<T> | Each<T, E>, ...argv: unknown[]): Enumerated<E, unknown>;
|
|
100
|
+
/**
|
|
101
|
+
* Mirrors: Ruby's Enumerable#map — `vendor/ruby/v3.3.11/enum.c:638` `enum_collect`,
|
|
102
|
+
* whose `collect_i` (`:606`) yields the values `each` yielded as they are
|
|
103
|
+
* (`rb_yield_values2`), unpacked; a lone Array reaching a block that takes
|
|
104
|
+
* more than one parameter is splatted across them, as
|
|
105
|
+
* `vm_callee_setup_block_arg_arg0_splat` does (`vendor/ruby/v3.3.11/vm_insnhelper.c:4807`).
|
|
106
|
+
* With no block it answers the enumerator
|
|
107
|
+
* `RETURN_SIZED_ENUMERATOR` builds.
|
|
108
|
+
* @noRailsEquivalent PERMANENT
|
|
109
|
+
*/
|
|
110
|
+
export declare function map<A extends unknown[], R, E = unknown>(obj: Enumerator<A, E>, block: (...args: A) => R): Enumerated<E, R[]>;
|
|
111
|
+
/** @noRailsEquivalent PERMANENT */
|
|
112
|
+
export declare function map<T, R, E = unknown>(obj: Iterable<T> | Each<T, E>, block: (i: T, ...rest: never[]) => R): Enumerated<E, R[]>;
|
|
113
|
+
/** @noRailsEquivalent PERMANENT */
|
|
114
|
+
export declare function map<T, E = unknown>(obj: Iterable<T> | Each<T, E>): Enumerator<T, E>;
|
|
115
|
+
/**
|
|
116
|
+
* Mirrors: Ruby's Enumerable#first — `vendor/ruby/v3.3.11/enum.c:1284` `enum_first`,
|
|
117
|
+
* whose `n` arm is `enum_take` (`:3514`).
|
|
118
|
+
* @noRailsEquivalent PERMANENT
|
|
119
|
+
*/
|
|
120
|
+
export declare function first<T, E = unknown>(obj: Iterable<T> | Each<T, E>): Enumerated<E, T | null>;
|
|
121
|
+
/** @noRailsEquivalent PERMANENT */
|
|
122
|
+
export declare function first<T, E = unknown>(obj: Iterable<T> | Each<T, E>, n: number): Enumerated<E, T[]>;
|
|
123
|
+
/**
|
|
124
|
+
* Mirrors: Ruby's Enumerable#take — `vendor/ruby/v3.3.11/enum.c:3514` `enum_take`, whose
|
|
125
|
+
* `take_i` (`:3490`) breaks once `n` elements are pushed, so an endless `each` stops.
|
|
126
|
+
* @noRailsEquivalent PERMANENT
|
|
127
|
+
*/
|
|
128
|
+
export declare function take<T, E = unknown>(obj: Iterable<T> | Each<T, E>, n: number): Enumerated<E, T[]>;
|
|
129
|
+
/**
|
|
130
|
+
* Mirrors: Ruby's Enumerable#take_while — `vendor/ruby/v3.3.11/enum.c:3560` `enum_take_while`,
|
|
131
|
+
* whose `take_while_i` (`:3533`) breaks at the first element the block answers falsy for.
|
|
132
|
+
* @noRailsEquivalent PERMANENT
|
|
133
|
+
*/
|
|
134
|
+
export declare function takeWhile<T, E = unknown>(obj: Iterable<T> | Each<T, E>, block: (i: T) => unknown): Enumerated<E, T[]>;
|
|
135
|
+
/**
|
|
136
|
+
* Mirrors: Ruby's Enumerable#drop — `vendor/ruby/v3.3.11/enum.c:3603` `enum_drop`, whose
|
|
137
|
+
* `drop_i` (`:3571`) counts `n` elements down before it pushes.
|
|
138
|
+
* @noRailsEquivalent PERMANENT
|
|
139
|
+
*/
|
|
140
|
+
export declare function drop<T, E = unknown>(obj: Iterable<T> | Each<T, E>, n: number): Enumerated<E, T[]>;
|
|
141
|
+
/**
|
|
142
|
+
* Mirrors: Ruby's Enumerable#each_with_index — `vendor/ruby/v3.3.11/enum.c:2967`
|
|
143
|
+
* `enum_each_with_index`, yielding each element with its count
|
|
144
|
+
* (`each_with_index_i`, `:2930`) and answering the receiver.
|
|
145
|
+
* @noRailsEquivalent PERMANENT
|
|
146
|
+
*/
|
|
147
|
+
export declare function eachWithIndex<T, E = unknown>(obj: Iterable<T> | Each<T, E>, block: (i: T, n: number) => PromiseLike<unknown>): Promise<Iterable<T> | Each<T, E>>;
|
|
148
|
+
/** @noRailsEquivalent PERMANENT */
|
|
149
|
+
export declare function eachWithIndex<T, E = unknown>(obj: Iterable<T> | Each<T, E>, block: (i: T, n: number) => unknown): Enumerated<E, Iterable<T> | Each<T, E>>;
|
|
150
|
+
/** @noRailsEquivalent PERMANENT */
|
|
151
|
+
export declare function eachWithIndex<T, E = unknown>(obj: Iterable<T> | Each<T, E>): Enumerator<[T, number], E>;
|
|
152
|
+
/**
|
|
153
|
+
* Mirrors: Ruby's Enumerable#each_with_object — `vendor/ruby/v3.3.11/enum.c:3285`
|
|
154
|
+
* `enum_each_with_object`, yielding each element with the memo
|
|
155
|
+
* (`each_with_object_i`) and answering the memo.
|
|
156
|
+
* @noRailsEquivalent PERMANENT
|
|
157
|
+
*/
|
|
158
|
+
export declare function eachWithObject<T, M, E = unknown>(obj: Iterable<T> | Each<T, E>, memo: M, block: (i: T, memo: M) => PromiseLike<unknown>): Promise<M>;
|
|
159
|
+
/** @noRailsEquivalent PERMANENT */
|
|
160
|
+
export declare function eachWithObject<T, M, E = unknown>(obj: Iterable<T> | Each<T, E>, memo: M, block: (i: T, memo: M) => unknown): Enumerated<E, M>;
|
|
161
|
+
/** @noRailsEquivalent PERMANENT */
|
|
162
|
+
export declare function eachWithObject<T, M, E = unknown>(obj: Iterable<T> | Each<T, E>, memo: M): Enumerator<[T, M], E>;
|
|
163
|
+
/**
|
|
164
|
+
* Mirrors: Ruby's Enumerable#sort_by — `vendor/ruby/v3.3.11/enum.c:1651` `enum_sort_by`,
|
|
165
|
+
* which pairs each element with its block value (`sort_by_i`) and sorts the
|
|
166
|
+
* pairs by `<=>` on the values (`sort_by_cmp`, `:1379`).
|
|
167
|
+
* @noRailsEquivalent PERMANENT
|
|
168
|
+
*/
|
|
169
|
+
export declare function sortBy<T, E = unknown>(obj: Iterable<T> | Each<T, E>, block?: (i: T) => unknown): Enumerated<E, T[]>;
|
|
170
|
+
/**
|
|
171
|
+
* Mirrors: Ruby's Enumerable#each_slice — `vendor/ruby/v3.3.11/enum.c:3166` `enum_each_slice`,
|
|
172
|
+
* yielding each full slice as it fills (`each_slice_i`, `:3102`) and the
|
|
173
|
+
* remainder last, then answering the receiver. With no block it answers its
|
|
174
|
+
* `RETURN_SIZED_ENUMERATOR`, sized by `enum_each_slice_size` (`:3127`).
|
|
175
|
+
* The enumerator's receiver answers this method by name over `obj`, since
|
|
176
|
+
* `rbFSend` reaches no free function on an Array, Set or generator.
|
|
177
|
+
* @noRailsEquivalent PERMANENT
|
|
178
|
+
*/
|
|
179
|
+
export declare function eachSlice<T, E = unknown>(obj: Iterable<T> | Each<T, E>, n: number): Enumerator<T[], E>;
|
|
180
|
+
/** @noRailsEquivalent PERMANENT */
|
|
181
|
+
export declare function eachSlice<T, O extends Iterable<T> | Each<T, unknown>>(obj: O, n: number, block: (slice: T[]) => unknown): Enumerated<O extends Each<T, infer E> ? E : unknown, O>;
|
|
182
|
+
/**
|
|
183
|
+
* Mirrors: Ruby's Enumerable#min_by — `vendor/ruby/v3.3.11/enum.c:2686` `enum_min_by`,
|
|
184
|
+
* keeping the first element whose block value compares lowest (`min_by_i`,
|
|
185
|
+
* `:2630`) and answering `nil` for an empty receiver. With `n` it answers the
|
|
186
|
+
* `n` elements with the lowest block values, in order (`rb_nmin_run`).
|
|
187
|
+
* The enumerator's receiver answers this method by name over `obj`, since
|
|
188
|
+
* `rbFSend` reaches no free function on an Array, Set or generator.
|
|
189
|
+
* @noRailsEquivalent PERMANENT
|
|
190
|
+
*/
|
|
191
|
+
export declare function minBy<T, E = unknown>(obj: Iterable<T> | Each<T, E>, n?: number | null): Enumerator<T, E>;
|
|
192
|
+
/** @noRailsEquivalent PERMANENT */
|
|
193
|
+
export declare function minBy<T, E = unknown>(obj: Iterable<T> | Each<T, E>, block: (i: T) => unknown): Enumerated<E, T | null>;
|
|
194
|
+
/** @noRailsEquivalent PERMANENT */
|
|
195
|
+
export declare function minBy<T, E = unknown>(obj: Iterable<T> | Each<T, E>, n: number | null, block: (i: T) => unknown): Enumerated<E, T[] | T | null>;
|
|
196
|
+
/**
|
|
197
|
+
* Mirrors: Ruby's Enumerable#max_by — `vendor/ruby/v3.3.11/enum.c:2760` `enum_max_by`,
|
|
198
|
+
* the `max_by_i` (`:2704`) twin of {@link minBy}.
|
|
199
|
+
* @noRailsEquivalent PERMANENT
|
|
200
|
+
*/
|
|
201
|
+
export declare function maxBy<T, E = unknown>(obj: Iterable<T> | Each<T, E>, n?: number | null): Enumerator<T, E>;
|
|
202
|
+
/** @noRailsEquivalent PERMANENT */
|
|
203
|
+
export declare function maxBy<T, E = unknown>(obj: Iterable<T> | Each<T, E>, block: (i: T) => unknown): Enumerated<E, T | null>;
|
|
204
|
+
/** @noRailsEquivalent PERMANENT */
|
|
205
|
+
export declare function maxBy<T, E = unknown>(obj: Iterable<T> | Each<T, E>, n: number | null, block: (i: T) => unknown): Enumerated<E, T[] | T | null>;
|
|
206
|
+
/**
|
|
207
|
+
* Mirrors: Ruby's Enumerable#each_cons — `vendor/ruby/v3.3.11/enum.c:3244` `enum_each_cons`,
|
|
208
|
+
* which raises `ArgumentError "invalid size"` for a size that is not positive
|
|
209
|
+
* and yields each window of `n` consecutive elements as it fills
|
|
210
|
+
* (`each_cons_i`, `:3187`), answering the receiver. With no block it answers
|
|
211
|
+
* its `RETURN_SIZED_ENUMERATOR`, sized by `enum_each_cons_size` (`:3209`).
|
|
212
|
+
* The enumerator's receiver answers this method by name over `obj`, since
|
|
213
|
+
* `rbFSend` reaches no free function on an Array, Set or generator.
|
|
214
|
+
* @noRailsEquivalent PERMANENT
|
|
215
|
+
*/
|
|
216
|
+
export declare function eachCons<T, E = unknown>(obj: Iterable<T> | Each<T, E>, n: number): Enumerator<T[], E>;
|
|
217
|
+
/** @noRailsEquivalent PERMANENT */
|
|
218
|
+
export declare function eachCons<T, E = unknown>(obj: Iterable<T> | Each<T, E>, n: number, block: (cons: T[]) => unknown): Enumerated<E, Iterable<T> | Each<T, E>>;
|
|
219
|
+
/**
|
|
220
|
+
* Mirrors: Ruby's Enumerable#all? — `vendor/ruby/v3.3.11/enum.c:1799` `enum_all`,
|
|
221
|
+
* breaking on the first element whose `pattern === element`, or the element
|
|
222
|
+
* itself with no argument, fails `RTEST`.
|
|
223
|
+
* @noRailsEquivalent PERMANENT
|
|
224
|
+
*/
|
|
225
|
+
export declare function isAll<T, E = unknown>(obj: Iterable<T> | Each<T, E>, ...args: unknown[]): Enumerated<E, boolean>;
|
|
226
|
+
/**
|
|
227
|
+
* Mirrors: Ruby's Enumerable#any? — `vendor/ruby/v3.3.11/enum.c:1861` `enum_any`,
|
|
228
|
+
* `RTEST`ing `pattern === element`, or the element itself with no argument.
|
|
229
|
+
* @noRailsEquivalent PERMANENT
|
|
230
|
+
*/
|
|
231
|
+
export declare function isAny<T, E = unknown>(obj: Iterable<T> | Each<T, E>, ...args: unknown[]): Enumerated<E, boolean>;
|
|
232
|
+
/**
|
|
233
|
+
* Mirrors: Ruby's Enumerable#one? — `vendor/ruby/v3.3.11/enum.c:2148` `enum_one`, which
|
|
234
|
+
* breaks on the second match (`:1869`).
|
|
235
|
+
* @noRailsEquivalent PERMANENT
|
|
236
|
+
*/
|
|
237
|
+
export declare function isOne<T, E = unknown>(obj: Iterable<T> | Each<T, E>, ...args: unknown[]): Enumerated<E, boolean>;
|
|
238
|
+
/**
|
|
239
|
+
* Mirrors: Ruby's Enumerable#none? — `vendor/ruby/v3.3.11/enum.c:2210` `enum_none`
|
|
240
|
+
* (`:2160`).
|
|
241
|
+
* @noRailsEquivalent PERMANENT
|
|
242
|
+
*/
|
|
243
|
+
export declare function isNone<T, E = unknown>(obj: Iterable<T> | Each<T, E>, ...args: unknown[]): Enumerated<E, boolean>;
|
|
244
|
+
/**
|
|
245
|
+
* Mirrors: Ruby's Enumerable#include? — `vendor/ruby/v3.3.11/enum.c:2921` `enum_member`,
|
|
246
|
+
* whose `member_i` (`:2892`) asks `rb_equal(element, val)` and breaks on the first hit.
|
|
247
|
+
* @noRailsEquivalent PERMANENT
|
|
248
|
+
*/
|
|
249
|
+
export declare function isInclude<T, E = unknown>(obj: Iterable<T> | Each<T, E>, val: unknown): Enumerated<E, boolean>;
|
|
250
|
+
/**
|
|
251
|
+
* Mirrors: Ruby's Enumerable#sum — `vendor/ruby/v3.3.11/enum.c:4753` `enum_sum`. The
|
|
252
|
+
* block is the trailing function argument, so a function cannot be the initial
|
|
253
|
+
* value. The Range arm (`int_range_sum`, `:4706`) is the caller's, and no
|
|
254
|
+
* includer is a Hash.
|
|
255
|
+
* @noRailsEquivalent PERMANENT
|
|
256
|
+
*/
|
|
257
|
+
export declare function sum<T, E = unknown>(obj: Iterable<T> | Each<T, E>, ...args: unknown[]): unknown;
|
|
258
|
+
/**
|
|
259
|
+
* Mirrors: Ruby's Enumerable#reduce — `vendor/ruby/v3.3.11/enum.c:1005` `enum_inject`,
|
|
260
|
+
* bound as `reduce` at `:5085`. The receiver is the first argument, and the
|
|
261
|
+
* block is the trailing function argument. `rb_check_id` turns a String naming a method into its Symbol,
|
|
262
|
+
* which every String here does; `rb_warning("given block not used")` prints
|
|
263
|
+
* only under `$VERBOSE`.
|
|
264
|
+
* Unported: the `rb_method_basic_definition_p` checks on `each` (`:1044`) and
|
|
265
|
+
* on `Integer#+` (`:836`), which ask whether a core method was redefined.
|
|
266
|
+
* @noRailsEquivalent PERMANENT
|
|
267
|
+
*/
|
|
268
|
+
export declare function reduce<T, E = unknown>(obj: Iterable<T> | Each<T, E>, ...argv: unknown[]): Enumerated<E, unknown>;
|
|
269
|
+
/**
|
|
270
|
+
* Ruby's `Enumerable` (`vendor/ruby/v3.3.11/enum.c:5047` `Init_Enumerable`) as
|
|
271
|
+
* a class module: `include(Klass, Enumerable)` copies its prototype members
|
|
272
|
+
* onto `Klass`, and `new Enumerable(xs)` wraps any Array, Set, Map, generator
|
|
273
|
+
* or `each`-answerer, so `new Enumerable(xs).partition(fn)` is Ruby's
|
|
274
|
+
* `xs.partition(&fn)`. Every member is the free function of the same name over
|
|
275
|
+
* `this`, and one answering a collection answers an Array or `Hash`.
|
|
276
|
+
* @noRailsEquivalent PERMANENT
|
|
277
|
+
*/
|
|
278
|
+
export declare class Enumerable<T = unknown, E = unknown> {
|
|
279
|
+
/** @noRailsEquivalent PERMANENT */
|
|
280
|
+
static readonly [classModule] = true;
|
|
281
|
+
each: (block: (i: T) => void) => E;
|
|
282
|
+
/** @noRailsEquivalent PERMANENT */
|
|
283
|
+
select: Enumerable["findAll"];
|
|
284
|
+
/** @noRailsEquivalent PERMANENT */
|
|
285
|
+
constructor(obj: Iterable<T> | Each<T, E>);
|
|
286
|
+
find<T, E = unknown>(this: Each<T, E>, ...argv: unknown[]): Enumerated<E, unknown>;
|
|
287
|
+
/** @noRailsEquivalent PERMANENT */
|
|
288
|
+
findAll<T, E = unknown>(this: Each<T, E>, block?: (i: T) => unknown): Enumerated<E, T[]>;
|
|
289
|
+
grep<T, E = unknown>(this: Each<T, E>, pattern: unknown, block?: (i: T) => unknown): Enumerated<E, unknown[]>;
|
|
290
|
+
map<T, E = unknown>(this: Each<T, E>): Enumerator<T, E>;
|
|
291
|
+
map<T, R, E = unknown>(this: Each<T, E>, block: (i: T) => R): Enumerated<E, R[]>;
|
|
292
|
+
groupBy<T, K, E = unknown>(this: Each<T, E>, block?: (i: T) => K): Enumerated<E, T[] | Hash<K, T[]>>;
|
|
293
|
+
partition<T, E = unknown>(this: Each<T, E>, block?: (i: T) => unknown): Enumerated<E, T[]> | Enumerated<E, [T[], T[]]>;
|
|
294
|
+
tally<T, E = unknown>(this: Each<T, E>): Enumerated<E, Hash<T, number>>;
|
|
295
|
+
reject<T, E = unknown>(this: Each<T, E>, block?: (i: T) => unknown): Enumerated<E, T[]>;
|
|
296
|
+
filterMap<T, R, E = unknown>(this: Each<T, E>, block: (i: T) => R | false | null | undefined): Enumerated<E, R[]>;
|
|
297
|
+
first<T, E = unknown>(this: Each<T, E>, n?: number): Enumerated<E, T | null | T[]>;
|
|
298
|
+
drop<T, E = unknown>(this: Each<T, E>, n: number): Enumerated<E, T[]>;
|
|
299
|
+
take<T, E = unknown>(this: Each<T, E>, n: number): Enumerated<E, T[]>;
|
|
300
|
+
takeWhile<T, E = unknown>(this: Each<T, E>, block: (i: T) => unknown): Enumerated<E, T[]>;
|
|
301
|
+
eachSlice<T, E = unknown>(this: Each<T, E>, n: number, block?: (slice: T[]) => unknown): Enumerator<T[], E> | Enumerated<E, Each<T, E>>;
|
|
302
|
+
sortBy<T, E = unknown>(this: Each<T, E>, block?: (i: T) => unknown): Enumerated<E, T[]>;
|
|
303
|
+
isAll<T, E = unknown>(this: Each<T, E>, ...args: unknown[]): Enumerated<E, boolean>;
|
|
304
|
+
isAny<T, E = unknown>(this: Each<T, E>, ...args: unknown[]): Enumerated<E, boolean>;
|
|
305
|
+
isOne<T, E = unknown>(this: Each<T, E>, ...args: unknown[]): Enumerated<E, boolean>;
|
|
306
|
+
isNone<T, E = unknown>(this: Each<T, E>, ...args: unknown[]): Enumerated<E, boolean>;
|
|
307
|
+
isInclude<T, E = unknown>(this: Each<T, E>, val: unknown): Enumerated<E, boolean>;
|
|
308
|
+
sum<T, E = unknown>(this: Each<T, E>, ...args: unknown[]): unknown;
|
|
309
|
+
/** Mirrors: Ruby's Enumerable#to_a — `vendor/ruby/v3.3.11/enum.c:711` `enum_to_a`. */
|
|
310
|
+
toA<T, E = unknown>(this: Each<T, E>): Enumerated<E, T[]>;
|
|
311
|
+
/**
|
|
312
|
+
* Mirrors: Ruby's Enumerable#to_h — `vendor/ruby/v3.3.11/enum.c:767` `enum_to_h`, each
|
|
313
|
+
* pair set by `rb_hash_set_pair` (`vendor/ruby/v3.3.11/hash.c:3503`).
|
|
314
|
+
*
|
|
315
|
+
* @noRailsEquivalent PERMANENT
|
|
316
|
+
*/
|
|
317
|
+
toH(this: Each<unknown, unknown>, block?: (...argv: unknown[]) => unknown): Record<string, unknown>;
|
|
318
|
+
/** @noRailsEquivalent PERMANENT */
|
|
319
|
+
[Symbol.iterator](this: Each<T, E>): IterableIterator<T>;
|
|
320
|
+
}
|
|
321
|
+
/** @noRailsEquivalent PERMANENT */
|
|
322
|
+
export interface AsyncEach<T> {
|
|
323
|
+
each(): AsyncIterable<T>;
|
|
324
|
+
each(block: (i: T) => unknown): PromiseLike<unknown>;
|
|
325
|
+
}
|
|
326
|
+
/** @noRailsEquivalent PERMANENT */
|
|
327
|
+
export interface AsyncEnumerator<T> extends AsyncEach<T> {
|
|
328
|
+
toA(): Promise<T[]>;
|
|
329
|
+
first(): Promise<T | null>;
|
|
330
|
+
first(n: number): Promise<T[]>;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* `Enumerable` (`vendor/ruby/v3.3.11/enum.c:5047` `Init_Enumerable`) for a class
|
|
334
|
+
* whose `each` awaits: every member awaits `each`, and `each` awaits the block
|
|
335
|
+
* before it yields the next element.
|
|
336
|
+
* @noRailsEquivalent PERMANENT
|
|
337
|
+
*/
|
|
338
|
+
export declare const AsyncEnumerable: {
|
|
339
|
+
/**
|
|
340
|
+
* Mirrors: Ruby's Enumerable#to_a — `vendor/ruby/v3.3.11/enum.c:711` `enum_to_a`.
|
|
341
|
+
* @noRailsEquivalent PERMANENT
|
|
342
|
+
*/
|
|
343
|
+
toA<T>(this: AsyncEach<T>): Promise<T[]>;
|
|
344
|
+
/**
|
|
345
|
+
* Mirrors: Ruby's Enumerable#sum — `vendor/ruby/v3.3.11/enum.c:4753` `enum_sum`, awaiting
|
|
346
|
+
* the block's result before it is added (`sum_iter`'s `rb_yield`, `:4645`).
|
|
347
|
+
* @noRailsEquivalent PERMANENT
|
|
348
|
+
*/
|
|
349
|
+
sum<T>(this: AsyncEach<T>, ...args: unknown[]): Promise<unknown>;
|
|
350
|
+
/**
|
|
351
|
+
* Mirrors: Ruby's Enumerable#map — `vendor/ruby/v3.3.11/enum.c:638` `enum_collect`,
|
|
352
|
+
* awaiting the block before the next element, so side effects keep Ruby's
|
|
353
|
+
* order. An Array receiver is read directly, having no `each` member.
|
|
354
|
+
* @noRailsEquivalent PERMANENT
|
|
355
|
+
*/
|
|
356
|
+
map<T, R>(this: AsyncEach<T> | T[], block: (i: T) => R | Promise<R>): Promise<R[]>;
|
|
357
|
+
/**
|
|
358
|
+
* Mirrors: Ruby's Enumerable#any? — `vendor/ruby/v3.3.11/enum.c:1861` `enum_any`,
|
|
359
|
+
* awaiting the block and stopping at its first truthy result. An Array
|
|
360
|
+
* receiver is read directly, having no `each` member.
|
|
361
|
+
* @noRailsEquivalent PERMANENT
|
|
362
|
+
*/
|
|
363
|
+
isAny<T>(this: T[], block: (i: T) => unknown): Promise<boolean>;
|
|
364
|
+
first: <T, E = unknown>(this: Each<T, E>, n?: number) => Enumerated<E, T | null | T[]>;
|
|
365
|
+
/**
|
|
366
|
+
* Mirrors: Ruby's Enumerable#reverse_each — `vendor/ruby/v3.3.11/enum.c:3006`
|
|
367
|
+
* `enum_reverse_each`: `to_a`, then the block over it from the last element.
|
|
368
|
+
* With no block it answers the enumerator `RETURN_SIZED_ENUMERATOR` builds.
|
|
369
|
+
* @noRailsEquivalent PERMANENT
|
|
370
|
+
*/
|
|
371
|
+
reverseEach<T>(this: AsyncEach<T>, block?: (i: T) => unknown): AsyncEnumerator<T> | Promise<unknown>;
|
|
372
|
+
/** @noRailsEquivalent PERMANENT */
|
|
373
|
+
[Symbol.asyncIterator]<T>(this: AsyncEach<T>): AsyncIterator<T>;
|
|
374
|
+
};
|
|
375
|
+
//# sourceMappingURL=enumerable.d.ts.map
|