@pnpm/exe 11.0.0-dev.1003 → 11.0.0-rc.0
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/dist/node-gyp-bin/node-gyp +6 -0
- package/dist/node-gyp-bin/node-gyp.cmd +5 -0
- package/dist/node_modules/@gar/promise-retry/LICENSE +20 -0
- package/dist/node_modules/@gar/promise-retry/lib/index.js +62 -0
- package/dist/node_modules/@gar/promise-retry/lib/retry.js +109 -0
- package/dist/node_modules/@gar/promise-retry/package.json +45 -0
- package/dist/node_modules/@isaacs/fs-minipass/LICENSE +15 -0
- package/dist/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js +430 -0
- package/dist/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json +3 -0
- package/dist/node_modules/@isaacs/fs-minipass/dist/esm/index.js +420 -0
- package/dist/node_modules/@isaacs/fs-minipass/dist/esm/package.json +3 -0
- package/dist/node_modules/@isaacs/fs-minipass/package.json +72 -0
- package/dist/node_modules/@npmcli/agent/lib/agents.js +206 -0
- package/dist/node_modules/@npmcli/agent/lib/dns.js +53 -0
- package/dist/node_modules/@npmcli/agent/lib/errors.js +61 -0
- package/dist/node_modules/@npmcli/agent/lib/index.js +56 -0
- package/dist/node_modules/@npmcli/agent/lib/options.js +86 -0
- package/dist/node_modules/@npmcli/agent/lib/proxy.js +88 -0
- package/dist/node_modules/@npmcli/agent/package.json +60 -0
- package/dist/node_modules/@npmcli/fs/lib/common/get-options.js +20 -0
- package/dist/node_modules/@npmcli/fs/lib/common/node.js +9 -0
- package/dist/node_modules/@npmcli/fs/lib/cp/LICENSE +15 -0
- package/dist/node_modules/@npmcli/fs/lib/cp/errors.js +129 -0
- package/dist/node_modules/@npmcli/fs/lib/cp/index.js +22 -0
- package/dist/node_modules/@npmcli/fs/lib/cp/polyfill.js +428 -0
- package/dist/node_modules/@npmcli/fs/lib/index.js +13 -0
- package/dist/node_modules/@npmcli/fs/lib/move-file.js +78 -0
- package/dist/node_modules/@npmcli/fs/lib/readdir-scoped.js +20 -0
- package/dist/node_modules/@npmcli/fs/lib/with-temp-dir.js +39 -0
- package/dist/node_modules/@npmcli/fs/package.json +54 -0
- package/dist/node_modules/@npmcli/redact/LICENSE +21 -0
- package/dist/node_modules/@npmcli/redact/lib/deep-map.js +71 -0
- package/dist/node_modules/@npmcli/redact/lib/error.js +28 -0
- package/dist/node_modules/@npmcli/redact/lib/index.js +44 -0
- package/dist/node_modules/@npmcli/redact/lib/matchers.js +88 -0
- package/dist/node_modules/@npmcli/redact/lib/server.js +59 -0
- package/dist/node_modules/@npmcli/redact/lib/utils.js +202 -0
- package/dist/node_modules/@npmcli/redact/package.json +52 -0
- package/dist/node_modules/abbrev/LICENSE +46 -0
- package/dist/node_modules/abbrev/lib/index.js +53 -0
- package/dist/node_modules/abbrev/package.json +41 -0
- package/dist/node_modules/agent-base/LICENSE +22 -0
- package/dist/node_modules/agent-base/dist/helpers.js +66 -0
- package/dist/node_modules/agent-base/dist/index.js +178 -0
- package/dist/node_modules/agent-base/package.json +46 -0
- package/dist/node_modules/balanced-match/dist/commonjs/index.js +59 -0
- package/dist/node_modules/balanced-match/dist/commonjs/package.json +3 -0
- package/dist/node_modules/balanced-match/dist/esm/index.js +54 -0
- package/dist/node_modules/balanced-match/dist/esm/package.json +3 -0
- package/dist/node_modules/balanced-match/package.json +68 -0
- package/dist/node_modules/brace-expansion/LICENSE +23 -0
- package/dist/node_modules/brace-expansion/dist/commonjs/index.js +201 -0
- package/dist/node_modules/brace-expansion/dist/commonjs/package.json +3 -0
- package/dist/node_modules/brace-expansion/dist/esm/index.js +197 -0
- package/dist/node_modules/brace-expansion/dist/esm/package.json +3 -0
- package/dist/node_modules/brace-expansion/package.json +64 -0
- package/dist/node_modules/cacache/lib/content/path.js +29 -0
- package/dist/node_modules/cacache/lib/content/read.js +165 -0
- package/dist/node_modules/cacache/lib/content/rm.js +18 -0
- package/dist/node_modules/cacache/lib/content/write.js +206 -0
- package/dist/node_modules/cacache/lib/entry-index.js +336 -0
- package/dist/node_modules/cacache/lib/get.js +170 -0
- package/dist/node_modules/cacache/lib/index.js +42 -0
- package/dist/node_modules/cacache/lib/memoization.js +72 -0
- package/dist/node_modules/cacache/lib/put.js +80 -0
- package/dist/node_modules/cacache/lib/rm.js +31 -0
- package/dist/node_modules/cacache/lib/util/glob.js +7 -0
- package/dist/node_modules/cacache/lib/util/hash-to-segments.js +7 -0
- package/dist/node_modules/cacache/lib/util/tmp.js +32 -0
- package/dist/node_modules/cacache/lib/verify.js +258 -0
- package/dist/node_modules/cacache/package.json +81 -0
- package/dist/node_modules/chownr/dist/commonjs/index.js +93 -0
- package/dist/node_modules/chownr/dist/commonjs/package.json +3 -0
- package/dist/node_modules/chownr/dist/esm/index.js +85 -0
- package/dist/node_modules/chownr/dist/esm/package.json +3 -0
- package/dist/node_modules/chownr/package.json +69 -0
- package/dist/node_modules/debug/LICENSE +20 -0
- package/dist/node_modules/debug/package.json +64 -0
- package/dist/node_modules/debug/src/browser.js +272 -0
- package/dist/node_modules/debug/src/common.js +292 -0
- package/dist/node_modules/debug/src/index.js +10 -0
- package/dist/node_modules/debug/src/node.js +263 -0
- package/dist/node_modules/env-paths/index.js +74 -0
- package/dist/node_modules/env-paths/license +9 -0
- package/dist/node_modules/env-paths/package.json +45 -0
- package/dist/node_modules/exponential-backoff/LICENSE +202 -0
- package/dist/node_modules/exponential-backoff/dist/backoff.js +124 -0
- package/dist/node_modules/exponential-backoff/dist/delay/always/always.delay.js +25 -0
- package/dist/node_modules/exponential-backoff/dist/delay/delay.base.js +45 -0
- package/dist/node_modules/exponential-backoff/dist/delay/delay.factory.js +17 -0
- package/dist/node_modules/exponential-backoff/dist/delay/delay.interface.js +3 -0
- package/dist/node_modules/exponential-backoff/dist/delay/skip-first/skip-first.delay.js +82 -0
- package/dist/node_modules/exponential-backoff/dist/jitter/full/full.jitter.js +8 -0
- package/dist/node_modules/exponential-backoff/dist/jitter/jitter.factory.js +15 -0
- package/dist/node_modules/exponential-backoff/dist/jitter/no/no.jitter.js +7 -0
- package/dist/node_modules/exponential-backoff/dist/options.js +31 -0
- package/dist/node_modules/exponential-backoff/package.json +62 -0
- package/dist/node_modules/fdir/LICENSE +7 -0
- package/dist/node_modules/fdir/dist/index.cjs +588 -0
- package/dist/node_modules/fdir/dist/index.d.cts +155 -0
- package/dist/node_modules/fdir/dist/index.d.mts +155 -0
- package/dist/node_modules/fdir/dist/index.mjs +570 -0
- package/dist/node_modules/fdir/package.json +103 -0
- package/dist/node_modules/fs-minipass/LICENSE +15 -0
- package/dist/node_modules/fs-minipass/lib/index.js +443 -0
- package/dist/node_modules/fs-minipass/package.json +54 -0
- package/dist/node_modules/glob/dist/commonjs/glob.js +248 -0
- package/dist/node_modules/glob/dist/commonjs/has-magic.js +27 -0
- package/dist/node_modules/glob/dist/commonjs/ignore.js +119 -0
- package/dist/node_modules/glob/dist/commonjs/index.js +68 -0
- package/dist/node_modules/glob/dist/commonjs/index.min.js +4 -0
- package/dist/node_modules/glob/dist/commonjs/package.json +3 -0
- package/dist/node_modules/glob/dist/commonjs/pattern.js +223 -0
- package/dist/node_modules/glob/dist/commonjs/processor.js +301 -0
- package/dist/node_modules/glob/dist/commonjs/walker.js +387 -0
- package/dist/node_modules/glob/dist/esm/glob.js +244 -0
- package/dist/node_modules/glob/dist/esm/has-magic.js +23 -0
- package/dist/node_modules/glob/dist/esm/ignore.js +115 -0
- package/dist/node_modules/glob/dist/esm/index.js +55 -0
- package/dist/node_modules/glob/dist/esm/index.min.js +4 -0
- package/dist/node_modules/glob/dist/esm/package.json +3 -0
- package/dist/node_modules/glob/dist/esm/pattern.js +219 -0
- package/dist/node_modules/glob/dist/esm/processor.js +294 -0
- package/dist/node_modules/glob/dist/esm/walker.js +381 -0
- package/dist/node_modules/glob/package.json +98 -0
- package/dist/node_modules/graceful-fs/LICENSE +15 -0
- package/dist/node_modules/graceful-fs/clone.js +23 -0
- package/dist/node_modules/graceful-fs/graceful-fs.js +448 -0
- package/dist/node_modules/graceful-fs/legacy-streams.js +118 -0
- package/dist/node_modules/graceful-fs/package.json +53 -0
- package/dist/node_modules/graceful-fs/polyfills.js +355 -0
- package/dist/node_modules/http-cache-semantics/LICENSE +9 -0
- package/dist/node_modules/http-cache-semantics/index.js +928 -0
- package/dist/node_modules/http-cache-semantics/package.json +22 -0
- package/dist/node_modules/http-proxy-agent/LICENSE +22 -0
- package/dist/node_modules/http-proxy-agent/dist/index.js +148 -0
- package/dist/node_modules/http-proxy-agent/package.json +47 -0
- package/dist/node_modules/https-proxy-agent/LICENSE +22 -0
- package/dist/node_modules/https-proxy-agent/dist/index.js +180 -0
- package/dist/node_modules/https-proxy-agent/dist/parse-proxy-response.js +101 -0
- package/dist/node_modules/https-proxy-agent/package.json +50 -0
- package/dist/node_modules/iconv-lite/LICENSE +21 -0
- package/dist/node_modules/iconv-lite/encodings/dbcs-codec.js +532 -0
- package/dist/node_modules/iconv-lite/encodings/dbcs-data.js +185 -0
- package/dist/node_modules/iconv-lite/encodings/index.js +23 -0
- package/dist/node_modules/iconv-lite/encodings/internal.js +218 -0
- package/dist/node_modules/iconv-lite/encodings/sbcs-codec.js +75 -0
- package/dist/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- package/dist/node_modules/iconv-lite/encodings/sbcs-data.js +178 -0
- package/dist/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- package/dist/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- package/dist/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- package/dist/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- package/dist/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- package/dist/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- package/dist/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
- package/dist/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- package/dist/node_modules/iconv-lite/encodings/utf16.js +187 -0
- package/dist/node_modules/iconv-lite/encodings/utf32.js +307 -0
- package/dist/node_modules/iconv-lite/encodings/utf7.js +283 -0
- package/dist/node_modules/iconv-lite/lib/bom-handling.js +48 -0
- package/dist/node_modules/iconv-lite/lib/helpers/merge-exports.js +13 -0
- package/dist/node_modules/iconv-lite/lib/index.js +182 -0
- package/dist/node_modules/iconv-lite/lib/streams.js +105 -0
- package/dist/node_modules/iconv-lite/package.json +70 -0
- package/dist/node_modules/ip-address/LICENSE +19 -0
- package/dist/node_modules/ip-address/dist/address-error.js +12 -0
- package/dist/node_modules/ip-address/dist/common.js +46 -0
- package/dist/node_modules/ip-address/dist/ip-address.js +35 -0
- package/dist/node_modules/ip-address/dist/ipv4.js +360 -0
- package/dist/node_modules/ip-address/dist/ipv6.js +1003 -0
- package/dist/node_modules/ip-address/dist/v4/constants.js +8 -0
- package/dist/node_modules/ip-address/dist/v6/constants.js +76 -0
- package/dist/node_modules/ip-address/dist/v6/helpers.js +45 -0
- package/dist/node_modules/ip-address/dist/v6/regular-expressions.js +95 -0
- package/dist/node_modules/ip-address/package.json +78 -0
- package/dist/node_modules/isexe/dist/commonjs/index.js +56 -0
- package/dist/node_modules/isexe/dist/commonjs/index.min.js +2 -0
- package/dist/node_modules/isexe/dist/commonjs/options.js +3 -0
- package/dist/node_modules/isexe/dist/commonjs/package.json +3 -0
- package/dist/node_modules/isexe/dist/commonjs/posix.js +67 -0
- package/dist/node_modules/isexe/dist/commonjs/win32.js +63 -0
- package/dist/node_modules/isexe/dist/esm/index.js +16 -0
- package/dist/node_modules/isexe/dist/esm/index.min.js +2 -0
- package/dist/node_modules/isexe/dist/esm/options.js +2 -0
- package/dist/node_modules/isexe/dist/esm/package.json +3 -0
- package/dist/node_modules/isexe/dist/esm/posix.js +62 -0
- package/dist/node_modules/isexe/dist/esm/win32.js +58 -0
- package/dist/node_modules/isexe/package.json +78 -0
- package/dist/node_modules/lru-cache/dist/commonjs/index.js +1595 -0
- package/dist/node_modules/lru-cache/dist/commonjs/index.min.js +2 -0
- package/dist/node_modules/lru-cache/dist/commonjs/package.json +3 -0
- package/dist/node_modules/lru-cache/dist/esm/index.js +1591 -0
- package/dist/node_modules/lru-cache/dist/esm/index.min.js +2 -0
- package/dist/node_modules/lru-cache/dist/esm/package.json +3 -0
- package/dist/node_modules/lru-cache/package.json +93 -0
- package/dist/node_modules/make-fetch-happen/LICENSE +16 -0
- package/dist/node_modules/make-fetch-happen/lib/cache/entry.js +471 -0
- package/dist/node_modules/make-fetch-happen/lib/cache/errors.js +11 -0
- package/dist/node_modules/make-fetch-happen/lib/cache/index.js +49 -0
- package/dist/node_modules/make-fetch-happen/lib/cache/key.js +17 -0
- package/dist/node_modules/make-fetch-happen/lib/cache/policy.js +161 -0
- package/dist/node_modules/make-fetch-happen/lib/fetch.js +118 -0
- package/dist/node_modules/make-fetch-happen/lib/index.js +41 -0
- package/dist/node_modules/make-fetch-happen/lib/options.js +59 -0
- package/dist/node_modules/make-fetch-happen/lib/pipeline.js +41 -0
- package/dist/node_modules/make-fetch-happen/lib/remote.js +134 -0
- package/dist/node_modules/make-fetch-happen/package.json +75 -0
- package/dist/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
- package/dist/node_modules/minimatch/dist/commonjs/ast.js +846 -0
- package/dist/node_modules/minimatch/dist/commonjs/brace-expressions.js +150 -0
- package/dist/node_modules/minimatch/dist/commonjs/escape.js +30 -0
- package/dist/node_modules/minimatch/dist/commonjs/index.js +1121 -0
- package/dist/node_modules/minimatch/dist/commonjs/package.json +3 -0
- package/dist/node_modules/minimatch/dist/commonjs/unescape.js +38 -0
- package/dist/node_modules/minimatch/dist/esm/assert-valid-pattern.js +10 -0
- package/dist/node_modules/minimatch/dist/esm/ast.js +842 -0
- package/dist/node_modules/minimatch/dist/esm/brace-expressions.js +146 -0
- package/dist/node_modules/minimatch/dist/esm/escape.js +26 -0
- package/dist/node_modules/minimatch/dist/esm/index.js +1108 -0
- package/dist/node_modules/minimatch/dist/esm/package.json +3 -0
- package/dist/node_modules/minimatch/dist/esm/unescape.js +34 -0
- package/dist/node_modules/minimatch/package.json +67 -0
- package/dist/node_modules/minipass/dist/commonjs/index.js +1038 -0
- package/dist/node_modules/minipass/dist/commonjs/package.json +3 -0
- package/dist/node_modules/minipass/dist/esm/index.js +1020 -0
- package/dist/node_modules/minipass/dist/esm/package.json +3 -0
- package/dist/node_modules/minipass/package.json +77 -0
- package/dist/node_modules/minipass-collect/LICENSE +15 -0
- package/dist/node_modules/minipass-collect/index.js +71 -0
- package/dist/node_modules/minipass-collect/package.json +30 -0
- package/dist/node_modules/minipass-fetch/LICENSE +28 -0
- package/dist/node_modules/minipass-fetch/lib/abort-error.js +17 -0
- package/dist/node_modules/minipass-fetch/lib/blob.js +97 -0
- package/dist/node_modules/minipass-fetch/lib/body.js +360 -0
- package/dist/node_modules/minipass-fetch/lib/fetch-error.js +32 -0
- package/dist/node_modules/minipass-fetch/lib/headers.js +267 -0
- package/dist/node_modules/minipass-fetch/lib/index.js +376 -0
- package/dist/node_modules/minipass-fetch/lib/request.js +282 -0
- package/dist/node_modules/minipass-fetch/lib/response.js +90 -0
- package/dist/node_modules/minipass-fetch/package.json +70 -0
- package/dist/node_modules/minipass-flush/LICENSE +15 -0
- package/dist/node_modules/minipass-flush/index.js +39 -0
- package/dist/node_modules/minipass-flush/node_modules/minipass/LICENSE +15 -0
- package/dist/node_modules/minipass-flush/node_modules/minipass/index.js +649 -0
- package/dist/node_modules/minipass-flush/node_modules/minipass/package.json +56 -0
- package/dist/node_modules/minipass-flush/package.json +39 -0
- package/dist/node_modules/minipass-pipeline/LICENSE +15 -0
- package/dist/node_modules/minipass-pipeline/index.js +128 -0
- package/dist/node_modules/minipass-pipeline/node_modules/minipass/LICENSE +15 -0
- package/dist/node_modules/minipass-pipeline/node_modules/minipass/index.js +649 -0
- package/dist/node_modules/minipass-pipeline/node_modules/minipass/package.json +56 -0
- package/dist/node_modules/minipass-pipeline/package.json +29 -0
- package/dist/node_modules/minipass-sized/LICENSE +15 -0
- package/dist/node_modules/minipass-sized/dist/commonjs/index.js +69 -0
- package/dist/node_modules/minipass-sized/dist/commonjs/package.json +3 -0
- package/dist/node_modules/minipass-sized/dist/esm/index.js +64 -0
- package/dist/node_modules/minipass-sized/dist/esm/package.json +3 -0
- package/dist/node_modules/minipass-sized/package.json +69 -0
- package/dist/node_modules/minizlib/LICENSE +26 -0
- package/dist/node_modules/minizlib/dist/commonjs/constants.js +123 -0
- package/dist/node_modules/minizlib/dist/commonjs/index.js +416 -0
- package/dist/node_modules/minizlib/dist/commonjs/package.json +3 -0
- package/dist/node_modules/minizlib/dist/esm/constants.js +117 -0
- package/dist/node_modules/minizlib/dist/esm/index.js +363 -0
- package/dist/node_modules/minizlib/dist/esm/package.json +3 -0
- package/dist/node_modules/minizlib/package.json +80 -0
- package/dist/node_modules/ms/index.js +162 -0
- package/dist/node_modules/ms/package.json +38 -0
- package/dist/node_modules/negotiator/LICENSE +24 -0
- package/dist/node_modules/negotiator/index.js +83 -0
- package/dist/node_modules/negotiator/lib/charset.js +169 -0
- package/dist/node_modules/negotiator/lib/encoding.js +205 -0
- package/dist/node_modules/negotiator/lib/language.js +179 -0
- package/dist/node_modules/negotiator/lib/mediaType.js +294 -0
- package/dist/node_modules/negotiator/package.json +43 -0
- package/dist/node_modules/node-gyp/.release-please-manifest.json +3 -0
- package/dist/node_modules/node-gyp/LICENSE +24 -0
- package/dist/node_modules/node-gyp/addon.gypi +204 -0
- package/dist/node_modules/node-gyp/bin/node-gyp.js +145 -0
- package/dist/node_modules/node-gyp/eslint.config.js +3 -0
- package/dist/node_modules/node-gyp/gyp/.release-please-manifest.json +3 -0
- package/dist/node_modules/node-gyp/gyp/LICENSE +28 -0
- package/dist/node_modules/node-gyp/gyp/data/ninja/build.ninja +4 -0
- package/dist/node_modules/node-gyp/gyp/data/win/large-pdb-shim.cc +12 -0
- package/dist/node_modules/node-gyp/gyp/gyp +8 -0
- package/dist/node_modules/node-gyp/gyp/gyp.bat +5 -0
- package/dist/node_modules/node-gyp/gyp/gyp_main.py +45 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py +365 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py +206 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py +1283 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +1545 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py +59 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py +152 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py +270 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py +599 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/__init__.py +707 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/common.py +725 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/common_test.py +186 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py +170 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py +113 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py +55 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.py +0 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py +805 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py +1169 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py +1316 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py +128 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +104 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py +461 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py +88 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py +55 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +2755 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py +3970 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py +44 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +2956 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +67 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py +1389 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py +26 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/input.py +3097 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/input_test.py +99 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py +765 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py +1255 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py +174 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py +61 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py +371 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py +1936 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation_test.py +54 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py +301 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +3180 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py +64 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE +3 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE.APACHE +177 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE.BSD +23 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/__init__.py +15 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_elffile.py +107 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_manylinux.py +252 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_musllinux.py +83 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_parser.py +359 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_structures.py +61 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_tokenizer.py +192 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/markers.py +251 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/metadata.py +824 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/py.typed +0 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/requirements.py +90 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/specifiers.py +1030 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/tags.py +553 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/utils.py +172 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/version.py +563 -0
- package/dist/node_modules/node-gyp/gyp/pyproject.toml +114 -0
- package/dist/node_modules/node-gyp/gyp/release-please-config.json +11 -0
- package/dist/node_modules/node-gyp/gyp/test_gyp.py +260 -0
- package/dist/node_modules/node-gyp/lib/Find-VisualStudio.cs +250 -0
- package/dist/node_modules/node-gyp/lib/build.js +230 -0
- package/dist/node_modules/node-gyp/lib/clean.js +15 -0
- package/dist/node_modules/node-gyp/lib/configure.js +328 -0
- package/dist/node_modules/node-gyp/lib/create-config-gypi.js +153 -0
- package/dist/node_modules/node-gyp/lib/download.js +39 -0
- package/dist/node_modules/node-gyp/lib/find-node-directory.js +63 -0
- package/dist/node_modules/node-gyp/lib/find-python.js +304 -0
- package/dist/node_modules/node-gyp/lib/find-visualstudio.js +606 -0
- package/dist/node_modules/node-gyp/lib/install.js +411 -0
- package/dist/node_modules/node-gyp/lib/list.js +26 -0
- package/dist/node_modules/node-gyp/lib/log.js +168 -0
- package/dist/node_modules/node-gyp/lib/node-gyp.js +199 -0
- package/dist/node_modules/node-gyp/lib/process-release.js +146 -0
- package/dist/node_modules/node-gyp/lib/rebuild.js +12 -0
- package/dist/node_modules/node-gyp/lib/remove.js +43 -0
- package/dist/node_modules/node-gyp/lib/util.js +81 -0
- package/dist/node_modules/node-gyp/macOS_Catalina_acid_test.sh +21 -0
- package/dist/node_modules/node-gyp/package.json +52 -0
- package/dist/node_modules/node-gyp/release-please-config.json +40 -0
- package/dist/node_modules/node-gyp/src/win_delay_load_hook.cc +41 -0
- package/dist/node_modules/nopt/LICENSE +15 -0
- package/dist/node_modules/nopt/bin/nopt.js +29 -0
- package/dist/node_modules/nopt/lib/debug.js +5 -0
- package/dist/node_modules/nopt/lib/nopt-lib.js +514 -0
- package/dist/node_modules/nopt/lib/nopt.js +34 -0
- package/dist/node_modules/nopt/lib/type-defs.js +91 -0
- package/dist/node_modules/nopt/package.json +52 -0
- package/dist/node_modules/p-map/index.js +283 -0
- package/dist/node_modules/p-map/license +9 -0
- package/dist/node_modules/p-map/package.json +57 -0
- package/dist/node_modules/path-scurry/dist/commonjs/index.js +2018 -0
- package/dist/node_modules/path-scurry/dist/commonjs/package.json +3 -0
- package/dist/node_modules/path-scurry/dist/esm/index.js +1983 -0
- package/dist/node_modules/path-scurry/dist/esm/package.json +3 -0
- package/dist/node_modules/path-scurry/package.json +72 -0
- package/dist/node_modules/picomatch/LICENSE +21 -0
- package/dist/node_modules/picomatch/index.js +17 -0
- package/dist/node_modules/picomatch/lib/constants.js +184 -0
- package/dist/node_modules/picomatch/lib/parse.js +1386 -0
- package/dist/node_modules/picomatch/lib/picomatch.js +349 -0
- package/dist/node_modules/picomatch/lib/scan.js +391 -0
- package/dist/node_modules/picomatch/lib/utils.js +72 -0
- package/dist/node_modules/picomatch/package.json +82 -0
- package/dist/node_modules/picomatch/posix.js +3 -0
- package/dist/node_modules/proc-log/LICENSE +15 -0
- package/dist/node_modules/proc-log/lib/index.js +158 -0
- package/dist/node_modules/proc-log/package.json +46 -0
- package/dist/node_modules/safer-buffer/LICENSE +21 -0
- package/dist/node_modules/safer-buffer/dangerous.js +58 -0
- package/dist/node_modules/safer-buffer/package.json +34 -0
- package/dist/node_modules/safer-buffer/safer.js +77 -0
- package/dist/node_modules/safer-buffer/tests.js +406 -0
- package/dist/node_modules/semver/LICENSE +15 -0
- package/dist/node_modules/semver/bin/semver.js +191 -0
- package/dist/node_modules/semver/classes/comparator.js +143 -0
- package/dist/node_modules/semver/classes/index.js +7 -0
- package/dist/node_modules/semver/classes/range.js +557 -0
- package/dist/node_modules/semver/classes/semver.js +333 -0
- package/dist/node_modules/semver/functions/clean.js +8 -0
- package/dist/node_modules/semver/functions/cmp.js +54 -0
- package/dist/node_modules/semver/functions/coerce.js +62 -0
- package/dist/node_modules/semver/functions/compare-build.js +9 -0
- package/dist/node_modules/semver/functions/compare-loose.js +5 -0
- package/dist/node_modules/semver/functions/compare.js +7 -0
- package/dist/node_modules/semver/functions/diff.js +60 -0
- package/dist/node_modules/semver/functions/eq.js +5 -0
- package/dist/node_modules/semver/functions/gt.js +5 -0
- package/dist/node_modules/semver/functions/gte.js +5 -0
- package/dist/node_modules/semver/functions/inc.js +21 -0
- package/dist/node_modules/semver/functions/lt.js +5 -0
- package/dist/node_modules/semver/functions/lte.js +5 -0
- package/dist/node_modules/semver/functions/major.js +5 -0
- package/dist/node_modules/semver/functions/minor.js +5 -0
- package/dist/node_modules/semver/functions/neq.js +5 -0
- package/dist/node_modules/semver/functions/parse.js +18 -0
- package/dist/node_modules/semver/functions/patch.js +5 -0
- package/dist/node_modules/semver/functions/prerelease.js +8 -0
- package/dist/node_modules/semver/functions/rcompare.js +5 -0
- package/dist/node_modules/semver/functions/rsort.js +5 -0
- package/dist/node_modules/semver/functions/satisfies.js +12 -0
- package/dist/node_modules/semver/functions/sort.js +5 -0
- package/dist/node_modules/semver/functions/valid.js +8 -0
- package/dist/node_modules/semver/index.js +91 -0
- package/dist/node_modules/semver/internal/constants.js +37 -0
- package/dist/node_modules/semver/internal/debug.js +11 -0
- package/dist/node_modules/semver/internal/identifiers.js +29 -0
- package/dist/node_modules/semver/internal/lrucache.js +42 -0
- package/dist/node_modules/semver/internal/parse-options.js +17 -0
- package/dist/node_modules/semver/internal/re.js +223 -0
- package/dist/node_modules/semver/package.json +78 -0
- package/dist/node_modules/semver/preload.js +4 -0
- package/dist/node_modules/semver/range.bnf +16 -0
- package/dist/node_modules/semver/ranges/gtr.js +6 -0
- package/dist/node_modules/semver/ranges/intersects.js +9 -0
- package/dist/node_modules/semver/ranges/ltr.js +6 -0
- package/dist/node_modules/semver/ranges/max-satisfying.js +27 -0
- package/dist/node_modules/semver/ranges/min-satisfying.js +26 -0
- package/dist/node_modules/semver/ranges/min-version.js +63 -0
- package/dist/node_modules/semver/ranges/outside.js +82 -0
- package/dist/node_modules/semver/ranges/simplify.js +49 -0
- package/dist/node_modules/semver/ranges/subset.js +249 -0
- package/dist/node_modules/semver/ranges/to-comparators.js +10 -0
- package/dist/node_modules/semver/ranges/valid.js +13 -0
- package/dist/node_modules/smart-buffer/.prettierrc.yaml +5 -0
- package/dist/node_modules/smart-buffer/LICENSE +20 -0
- package/dist/node_modules/smart-buffer/build/smartbuffer.js +1233 -0
- package/dist/node_modules/smart-buffer/build/utils.js +108 -0
- package/dist/node_modules/smart-buffer/package.json +79 -0
- package/dist/node_modules/socks/.eslintrc.cjs +11 -0
- package/dist/node_modules/socks/.prettierrc.yaml +7 -0
- package/dist/node_modules/socks/LICENSE +20 -0
- package/dist/node_modules/socks/build/client/socksclient.js +793 -0
- package/dist/node_modules/socks/build/common/constants.js +108 -0
- package/dist/node_modules/socks/build/common/helpers.js +167 -0
- package/dist/node_modules/socks/build/common/receivebuffer.js +43 -0
- package/dist/node_modules/socks/build/common/util.js +25 -0
- package/dist/node_modules/socks/build/index.js +18 -0
- package/dist/node_modules/socks/package.json +58 -0
- package/dist/node_modules/socks-proxy-agent/LICENSE +22 -0
- package/dist/node_modules/socks-proxy-agent/dist/index.js +195 -0
- package/dist/node_modules/socks-proxy-agent/package.json +142 -0
- package/dist/node_modules/ssri/lib/index.js +550 -0
- package/dist/node_modules/ssri/package.json +66 -0
- package/dist/node_modules/tar/dist/commonjs/create.js +82 -0
- package/dist/node_modules/tar/dist/commonjs/cwd-error.js +18 -0
- package/dist/node_modules/tar/dist/commonjs/extract.js +88 -0
- package/dist/node_modules/tar/dist/commonjs/get-write-flag.js +32 -0
- package/dist/node_modules/tar/dist/commonjs/header.js +312 -0
- package/dist/node_modules/tar/dist/commonjs/index.js +64 -0
- package/dist/node_modules/tar/dist/commonjs/index.min.js +4 -0
- package/dist/node_modules/tar/dist/commonjs/large-numbers.js +99 -0
- package/dist/node_modules/tar/dist/commonjs/list.js +145 -0
- package/dist/node_modules/tar/dist/commonjs/make-command.js +52 -0
- package/dist/node_modules/tar/dist/commonjs/mkdir.js +187 -0
- package/dist/node_modules/tar/dist/commonjs/mode-fix.js +29 -0
- package/dist/node_modules/tar/dist/commonjs/normalize-unicode.js +38 -0
- package/dist/node_modules/tar/dist/commonjs/normalize-windows-path.js +12 -0
- package/dist/node_modules/tar/dist/commonjs/options.js +66 -0
- package/dist/node_modules/tar/dist/commonjs/pack.js +511 -0
- package/dist/node_modules/tar/dist/commonjs/package.json +3 -0
- package/dist/node_modules/tar/dist/commonjs/parse.js +610 -0
- package/dist/node_modules/tar/dist/commonjs/path-reservations.js +170 -0
- package/dist/node_modules/tar/dist/commonjs/pax.js +158 -0
- package/dist/node_modules/tar/dist/commonjs/process-umask.js +7 -0
- package/dist/node_modules/tar/dist/commonjs/read-entry.js +136 -0
- package/dist/node_modules/tar/dist/commonjs/replace.js +227 -0
- package/dist/node_modules/tar/dist/commonjs/strip-absolute-path.js +29 -0
- package/dist/node_modules/tar/dist/commonjs/strip-trailing-slashes.js +18 -0
- package/dist/node_modules/tar/dist/commonjs/symlink-error.js +19 -0
- package/dist/node_modules/tar/dist/commonjs/types.js +50 -0
- package/dist/node_modules/tar/dist/commonjs/unpack.js +932 -0
- package/dist/node_modules/tar/dist/commonjs/update.js +33 -0
- package/dist/node_modules/tar/dist/commonjs/warn-method.js +31 -0
- package/dist/node_modules/tar/dist/commonjs/winchars.js +14 -0
- package/dist/node_modules/tar/dist/commonjs/write-entry.js +698 -0
- package/dist/node_modules/tar/dist/esm/create.js +76 -0
- package/dist/node_modules/tar/dist/esm/cwd-error.js +14 -0
- package/dist/node_modules/tar/dist/esm/extract.js +49 -0
- package/dist/node_modules/tar/dist/esm/get-write-flag.js +26 -0
- package/dist/node_modules/tar/dist/esm/header.js +275 -0
- package/dist/node_modules/tar/dist/esm/index.js +20 -0
- package/dist/node_modules/tar/dist/esm/index.min.js +4 -0
- package/dist/node_modules/tar/dist/esm/large-numbers.js +94 -0
- package/dist/node_modules/tar/dist/esm/list.js +105 -0
- package/dist/node_modules/tar/dist/esm/make-command.js +48 -0
- package/dist/node_modules/tar/dist/esm/mkdir.js +179 -0
- package/dist/node_modules/tar/dist/esm/mode-fix.js +25 -0
- package/dist/node_modules/tar/dist/esm/normalize-unicode.js +34 -0
- package/dist/node_modules/tar/dist/esm/normalize-windows-path.js +9 -0
- package/dist/node_modules/tar/dist/esm/options.js +54 -0
- package/dist/node_modules/tar/dist/esm/pack.js +469 -0
- package/dist/node_modules/tar/dist/esm/package.json +3 -0
- package/dist/node_modules/tar/dist/esm/parse.js +606 -0
- package/dist/node_modules/tar/dist/esm/path-reservations.js +166 -0
- package/dist/node_modules/tar/dist/esm/pax.js +154 -0
- package/dist/node_modules/tar/dist/esm/process-umask.js +3 -0
- package/dist/node_modules/tar/dist/esm/read-entry.js +132 -0
- package/dist/node_modules/tar/dist/esm/replace.js +221 -0
- package/dist/node_modules/tar/dist/esm/strip-absolute-path.js +25 -0
- package/dist/node_modules/tar/dist/esm/strip-trailing-slashes.js +14 -0
- package/dist/node_modules/tar/dist/esm/symlink-error.js +15 -0
- package/dist/node_modules/tar/dist/esm/types.js +45 -0
- package/dist/node_modules/tar/dist/esm/unpack.js +891 -0
- package/dist/node_modules/tar/dist/esm/update.js +30 -0
- package/dist/node_modules/tar/dist/esm/warn-method.js +27 -0
- package/dist/node_modules/tar/dist/esm/winchars.js +9 -0
- package/dist/node_modules/tar/dist/esm/write-entry.js +656 -0
- package/dist/node_modules/tar/node_modules/yallist/dist/commonjs/index.js +384 -0
- package/dist/node_modules/tar/node_modules/yallist/dist/commonjs/package.json +3 -0
- package/dist/node_modules/tar/node_modules/yallist/dist/esm/index.js +379 -0
- package/dist/node_modules/tar/node_modules/yallist/dist/esm/package.json +3 -0
- package/dist/node_modules/tar/node_modules/yallist/package.json +68 -0
- package/dist/node_modules/tar/package.json +297 -0
- package/dist/node_modules/tinyglobby/LICENSE +21 -0
- package/dist/node_modules/tinyglobby/dist/index.cjs +350 -0
- package/dist/node_modules/tinyglobby/dist/index.d.cts +147 -0
- package/dist/node_modules/tinyglobby/dist/index.d.mts +147 -0
- package/dist/node_modules/tinyglobby/dist/index.mjs +318 -0
- package/dist/node_modules/tinyglobby/package.json +73 -0
- package/{LICENSE → dist/node_modules/v8-compile-cache/LICENSE} +1 -2
- package/dist/node_modules/v8-compile-cache/package.json +34 -0
- package/dist/node_modules/v8-compile-cache/v8-compile-cache.js +373 -0
- package/dist/node_modules/which/LICENSE +15 -0
- package/dist/node_modules/which/bin/which.js +52 -0
- package/dist/node_modules/which/lib/index.js +111 -0
- package/dist/node_modules/which/package.json +52 -0
- package/dist/node_modules/yallist/LICENSE +15 -0
- package/dist/node_modules/yallist/iterator.js +8 -0
- package/dist/node_modules/yallist/package.json +29 -0
- package/dist/node_modules/yallist/yallist.js +426 -0
- package/dist/pnpm.mjs +266382 -0
- package/dist/pnpmrc +2 -0
- package/dist/templates/completion.bash +31 -0
- package/dist/templates/completion.fish +22 -0
- package/dist/templates/completion.ps1 +193 -0
- package/dist/templates/completion.zsh +27 -0
- package/dist/vendor/fastlist-0.3.0-x64.exe +0 -0
- package/dist/vendor/fastlist-0.3.0-x86.exe +0 -0
- package/dist/worker.js +10958 -0
- package/package.json +34 -12
- package/pn +2 -0
- package/pn.cmd +2 -0
- package/pn.ps1 +1 -0
- package/pnpx +2 -0
- package/pnpx.cmd +2 -0
- package/pnpx.ps1 +1 -0
- package/pnx +2 -0
- package/pnx.cmd +2 -0
- package/pnx.ps1 +1 -0
- package/prepare.js +26 -3
- package/setup.js +22 -11
- package/CHANGELOG.md +0 -15
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
"use strict"
|
|
2
|
+
var Buffer = require("safer-buffer").Buffer
|
|
3
|
+
|
|
4
|
+
// UTF-7 codec, according to https://tools.ietf.org/html/rfc2152
|
|
5
|
+
// See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3
|
|
6
|
+
|
|
7
|
+
exports.utf7 = Utf7Codec
|
|
8
|
+
exports.unicode11utf7 = "utf7" // Alias UNICODE-1-1-UTF-7
|
|
9
|
+
function Utf7Codec (codecOptions, iconv) {
|
|
10
|
+
this.iconv = iconv
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
Utf7Codec.prototype.encoder = Utf7Encoder
|
|
14
|
+
Utf7Codec.prototype.decoder = Utf7Decoder
|
|
15
|
+
Utf7Codec.prototype.bomAware = true
|
|
16
|
+
|
|
17
|
+
// -- Encoding
|
|
18
|
+
|
|
19
|
+
// Why scape ()?./?
|
|
20
|
+
// eslint-disable-next-line no-useless-escape
|
|
21
|
+
var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g
|
|
22
|
+
|
|
23
|
+
function Utf7Encoder (options, codec) {
|
|
24
|
+
this.iconv = codec.iconv
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
Utf7Encoder.prototype.write = function (str) {
|
|
28
|
+
// Naive implementation.
|
|
29
|
+
// Non-direct chars are encoded as "+<base64>-"; single "+" char is encoded as "+-".
|
|
30
|
+
return Buffer.from(str.replace(nonDirectChars, function (chunk) {
|
|
31
|
+
return "+" + (chunk === "+"
|
|
32
|
+
? ""
|
|
33
|
+
: this.iconv.encode(chunk, "utf16-be").toString("base64").replace(/=+$/, "")) +
|
|
34
|
+
"-"
|
|
35
|
+
}.bind(this)))
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
Utf7Encoder.prototype.end = function () {
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// -- Decoding
|
|
42
|
+
|
|
43
|
+
function Utf7Decoder (options, codec) {
|
|
44
|
+
this.iconv = codec.iconv
|
|
45
|
+
this.inBase64 = false
|
|
46
|
+
this.base64Accum = ""
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Why scape /?
|
|
50
|
+
// eslint-disable-next-line no-useless-escape
|
|
51
|
+
var base64Regex = /[A-Za-z0-9\/+]/
|
|
52
|
+
var base64Chars = []
|
|
53
|
+
for (var i = 0; i < 256; i++) { base64Chars[i] = base64Regex.test(String.fromCharCode(i)) }
|
|
54
|
+
|
|
55
|
+
var plusChar = "+".charCodeAt(0)
|
|
56
|
+
var minusChar = "-".charCodeAt(0)
|
|
57
|
+
var andChar = "&".charCodeAt(0)
|
|
58
|
+
|
|
59
|
+
Utf7Decoder.prototype.write = function (buf) {
|
|
60
|
+
var res = ""; var lastI = 0
|
|
61
|
+
var inBase64 = this.inBase64
|
|
62
|
+
var base64Accum = this.base64Accum
|
|
63
|
+
|
|
64
|
+
// The decoder is more involved as we must handle chunks in stream.
|
|
65
|
+
|
|
66
|
+
for (var i = 0; i < buf.length; i++) {
|
|
67
|
+
if (!inBase64) { // We're in direct mode.
|
|
68
|
+
// Write direct chars until '+'
|
|
69
|
+
if (buf[i] == plusChar) {
|
|
70
|
+
res += this.iconv.decode(buf.slice(lastI, i), "ascii") // Write direct chars.
|
|
71
|
+
lastI = i + 1
|
|
72
|
+
inBase64 = true
|
|
73
|
+
}
|
|
74
|
+
} else { // We decode base64.
|
|
75
|
+
if (!base64Chars[buf[i]]) { // Base64 ended.
|
|
76
|
+
if (i == lastI && buf[i] == minusChar) { // "+-" -> "+"
|
|
77
|
+
res += "+"
|
|
78
|
+
} else {
|
|
79
|
+
var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii")
|
|
80
|
+
res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be")
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (buf[i] != minusChar) // Minus is absorbed after base64.
|
|
84
|
+
{ i-- }
|
|
85
|
+
|
|
86
|
+
lastI = i + 1
|
|
87
|
+
inBase64 = false
|
|
88
|
+
base64Accum = ""
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (!inBase64) {
|
|
94
|
+
res += this.iconv.decode(buf.slice(lastI), "ascii") // Write direct chars.
|
|
95
|
+
} else {
|
|
96
|
+
var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii")
|
|
97
|
+
|
|
98
|
+
var canBeDecoded = b64str.length - (b64str.length % 8) // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars.
|
|
99
|
+
base64Accum = b64str.slice(canBeDecoded) // The rest will be decoded in future.
|
|
100
|
+
b64str = b64str.slice(0, canBeDecoded)
|
|
101
|
+
|
|
102
|
+
res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be")
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
this.inBase64 = inBase64
|
|
106
|
+
this.base64Accum = base64Accum
|
|
107
|
+
|
|
108
|
+
return res
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
Utf7Decoder.prototype.end = function () {
|
|
112
|
+
var res = ""
|
|
113
|
+
if (this.inBase64 && this.base64Accum.length > 0) { res = this.iconv.decode(Buffer.from(this.base64Accum, "base64"), "utf16-be") }
|
|
114
|
+
|
|
115
|
+
this.inBase64 = false
|
|
116
|
+
this.base64Accum = ""
|
|
117
|
+
return res
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// UTF-7-IMAP codec.
|
|
121
|
+
// RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3)
|
|
122
|
+
// Differences:
|
|
123
|
+
// * Base64 part is started by "&" instead of "+"
|
|
124
|
+
// * Direct characters are 0x20-0x7E, except "&" (0x26)
|
|
125
|
+
// * In Base64, "," is used instead of "/"
|
|
126
|
+
// * Base64 must not be used to represent direct characters.
|
|
127
|
+
// * No implicit shift back from Base64 (should always end with '-')
|
|
128
|
+
// * String must end in non-shifted position.
|
|
129
|
+
// * "-&" while in base64 is not allowed.
|
|
130
|
+
|
|
131
|
+
exports.utf7imap = Utf7IMAPCodec
|
|
132
|
+
function Utf7IMAPCodec (codecOptions, iconv) {
|
|
133
|
+
this.iconv = iconv
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder
|
|
137
|
+
Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder
|
|
138
|
+
Utf7IMAPCodec.prototype.bomAware = true
|
|
139
|
+
|
|
140
|
+
// -- Encoding
|
|
141
|
+
|
|
142
|
+
function Utf7IMAPEncoder (options, codec) {
|
|
143
|
+
this.iconv = codec.iconv
|
|
144
|
+
this.inBase64 = false
|
|
145
|
+
this.base64Accum = Buffer.alloc(6)
|
|
146
|
+
this.base64AccumIdx = 0
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
Utf7IMAPEncoder.prototype.write = function (str) {
|
|
150
|
+
var inBase64 = this.inBase64
|
|
151
|
+
var base64Accum = this.base64Accum
|
|
152
|
+
var base64AccumIdx = this.base64AccumIdx
|
|
153
|
+
var buf = Buffer.alloc(str.length * 5 + 10); var bufIdx = 0
|
|
154
|
+
|
|
155
|
+
for (var i = 0; i < str.length; i++) {
|
|
156
|
+
var uChar = str.charCodeAt(i)
|
|
157
|
+
if (uChar >= 0x20 && uChar <= 0x7E) { // Direct character or '&'.
|
|
158
|
+
if (inBase64) {
|
|
159
|
+
if (base64AccumIdx > 0) {
|
|
160
|
+
bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), bufIdx)
|
|
161
|
+
base64AccumIdx = 0
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
buf[bufIdx++] = minusChar // Write '-', then go to direct mode.
|
|
165
|
+
inBase64 = false
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (!inBase64) {
|
|
169
|
+
buf[bufIdx++] = uChar // Write direct character
|
|
170
|
+
|
|
171
|
+
if (uChar === andChar) // Ampersand -> '&-'
|
|
172
|
+
{ buf[bufIdx++] = minusChar }
|
|
173
|
+
}
|
|
174
|
+
} else { // Non-direct character
|
|
175
|
+
if (!inBase64) {
|
|
176
|
+
buf[bufIdx++] = andChar // Write '&', then go to base64 mode.
|
|
177
|
+
inBase64 = true
|
|
178
|
+
}
|
|
179
|
+
if (inBase64) {
|
|
180
|
+
base64Accum[base64AccumIdx++] = uChar >> 8
|
|
181
|
+
base64Accum[base64AccumIdx++] = uChar & 0xFF
|
|
182
|
+
|
|
183
|
+
if (base64AccumIdx == base64Accum.length) {
|
|
184
|
+
bufIdx += buf.write(base64Accum.toString("base64").replace(/\//g, ","), bufIdx)
|
|
185
|
+
base64AccumIdx = 0
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
this.inBase64 = inBase64
|
|
192
|
+
this.base64AccumIdx = base64AccumIdx
|
|
193
|
+
|
|
194
|
+
return buf.slice(0, bufIdx)
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
Utf7IMAPEncoder.prototype.end = function () {
|
|
198
|
+
var buf = Buffer.alloc(10); var bufIdx = 0
|
|
199
|
+
if (this.inBase64) {
|
|
200
|
+
if (this.base64AccumIdx > 0) {
|
|
201
|
+
bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), bufIdx)
|
|
202
|
+
this.base64AccumIdx = 0
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
buf[bufIdx++] = minusChar // Write '-', then go to direct mode.
|
|
206
|
+
this.inBase64 = false
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
return buf.slice(0, bufIdx)
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// -- Decoding
|
|
213
|
+
|
|
214
|
+
function Utf7IMAPDecoder (options, codec) {
|
|
215
|
+
this.iconv = codec.iconv
|
|
216
|
+
this.inBase64 = false
|
|
217
|
+
this.base64Accum = ""
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
var base64IMAPChars = base64Chars.slice()
|
|
221
|
+
base64IMAPChars[",".charCodeAt(0)] = true
|
|
222
|
+
|
|
223
|
+
Utf7IMAPDecoder.prototype.write = function (buf) {
|
|
224
|
+
var res = ""; var lastI = 0
|
|
225
|
+
var inBase64 = this.inBase64
|
|
226
|
+
var base64Accum = this.base64Accum
|
|
227
|
+
|
|
228
|
+
// The decoder is more involved as we must handle chunks in stream.
|
|
229
|
+
// It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end).
|
|
230
|
+
|
|
231
|
+
for (var i = 0; i < buf.length; i++) {
|
|
232
|
+
if (!inBase64) { // We're in direct mode.
|
|
233
|
+
// Write direct chars until '&'
|
|
234
|
+
if (buf[i] == andChar) {
|
|
235
|
+
res += this.iconv.decode(buf.slice(lastI, i), "ascii") // Write direct chars.
|
|
236
|
+
lastI = i + 1
|
|
237
|
+
inBase64 = true
|
|
238
|
+
}
|
|
239
|
+
} else { // We decode base64.
|
|
240
|
+
if (!base64IMAPChars[buf[i]]) { // Base64 ended.
|
|
241
|
+
if (i == lastI && buf[i] == minusChar) { // "&-" -> "&"
|
|
242
|
+
res += "&"
|
|
243
|
+
} else {
|
|
244
|
+
var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii").replace(/,/g, "/")
|
|
245
|
+
res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be")
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
if (buf[i] != minusChar) // Minus may be absorbed after base64.
|
|
249
|
+
{ i-- }
|
|
250
|
+
|
|
251
|
+
lastI = i + 1
|
|
252
|
+
inBase64 = false
|
|
253
|
+
base64Accum = ""
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if (!inBase64) {
|
|
259
|
+
res += this.iconv.decode(buf.slice(lastI), "ascii") // Write direct chars.
|
|
260
|
+
} else {
|
|
261
|
+
var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii").replace(/,/g, "/")
|
|
262
|
+
|
|
263
|
+
var canBeDecoded = b64str.length - (b64str.length % 8) // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars.
|
|
264
|
+
base64Accum = b64str.slice(canBeDecoded) // The rest will be decoded in future.
|
|
265
|
+
b64str = b64str.slice(0, canBeDecoded)
|
|
266
|
+
|
|
267
|
+
res += this.iconv.decode(Buffer.from(b64str, "base64"), "utf16-be")
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
this.inBase64 = inBase64
|
|
271
|
+
this.base64Accum = base64Accum
|
|
272
|
+
|
|
273
|
+
return res
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
Utf7IMAPDecoder.prototype.end = function () {
|
|
277
|
+
var res = ""
|
|
278
|
+
if (this.inBase64 && this.base64Accum.length > 0) { res = this.iconv.decode(Buffer.from(this.base64Accum, "base64"), "utf16-be") }
|
|
279
|
+
|
|
280
|
+
this.inBase64 = false
|
|
281
|
+
this.base64Accum = ""
|
|
282
|
+
return res
|
|
283
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict"
|
|
2
|
+
|
|
3
|
+
var BOMChar = "\uFEFF"
|
|
4
|
+
|
|
5
|
+
exports.PrependBOM = PrependBOMWrapper
|
|
6
|
+
function PrependBOMWrapper (encoder, options) {
|
|
7
|
+
this.encoder = encoder
|
|
8
|
+
this.addBOM = true
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
PrependBOMWrapper.prototype.write = function (str) {
|
|
12
|
+
if (this.addBOM) {
|
|
13
|
+
str = BOMChar + str
|
|
14
|
+
this.addBOM = false
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return this.encoder.write(str)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
PrependBOMWrapper.prototype.end = function () {
|
|
21
|
+
return this.encoder.end()
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// ------------------------------------------------------------------------------
|
|
25
|
+
|
|
26
|
+
exports.StripBOM = StripBOMWrapper
|
|
27
|
+
function StripBOMWrapper (decoder, options) {
|
|
28
|
+
this.decoder = decoder
|
|
29
|
+
this.pass = false
|
|
30
|
+
this.options = options || {}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
StripBOMWrapper.prototype.write = function (buf) {
|
|
34
|
+
var res = this.decoder.write(buf)
|
|
35
|
+
if (this.pass || !res) { return res }
|
|
36
|
+
|
|
37
|
+
if (res[0] === BOMChar) {
|
|
38
|
+
res = res.slice(1)
|
|
39
|
+
if (typeof this.options.stripBOM === "function") { this.options.stripBOM() }
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
this.pass = true
|
|
43
|
+
return res
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
StripBOMWrapper.prototype.end = function () {
|
|
47
|
+
return this.decoder.end()
|
|
48
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict"
|
|
2
|
+
|
|
3
|
+
var hasOwn = typeof Object.hasOwn === "undefined" ? Function.call.bind(Object.prototype.hasOwnProperty) : Object.hasOwn
|
|
4
|
+
|
|
5
|
+
function mergeModules (target, module) {
|
|
6
|
+
for (var key in module) {
|
|
7
|
+
if (hasOwn(module, key)) {
|
|
8
|
+
target[key] = module[key]
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
module.exports = mergeModules
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use strict"
|
|
2
|
+
|
|
3
|
+
var Buffer = require("safer-buffer").Buffer
|
|
4
|
+
|
|
5
|
+
var bomHandling = require("./bom-handling")
|
|
6
|
+
var mergeModules = require("./helpers/merge-exports")
|
|
7
|
+
|
|
8
|
+
// All codecs and aliases are kept here, keyed by encoding name/alias.
|
|
9
|
+
// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`.
|
|
10
|
+
// Cannot initialize with { __proto__: null } because Boolean({ __proto__: null }) === true
|
|
11
|
+
module.exports.encodings = null
|
|
12
|
+
|
|
13
|
+
// Characters emitted in case of error.
|
|
14
|
+
module.exports.defaultCharUnicode = "�"
|
|
15
|
+
module.exports.defaultCharSingleByte = "?"
|
|
16
|
+
|
|
17
|
+
// Public API.
|
|
18
|
+
module.exports.encode = function encode (str, encoding, options) {
|
|
19
|
+
str = "" + (str || "") // Ensure string.
|
|
20
|
+
|
|
21
|
+
var encoder = module.exports.getEncoder(encoding, options)
|
|
22
|
+
|
|
23
|
+
var res = encoder.write(str)
|
|
24
|
+
var trail = encoder.end()
|
|
25
|
+
|
|
26
|
+
return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
module.exports.decode = function decode (buf, encoding, options) {
|
|
30
|
+
if (typeof buf === "string") {
|
|
31
|
+
if (!module.exports.skipDecodeWarning) {
|
|
32
|
+
console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding")
|
|
33
|
+
module.exports.skipDecodeWarning = true
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
buf = Buffer.from("" + (buf || ""), "binary") // Ensure buffer.
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
var decoder = module.exports.getDecoder(encoding, options)
|
|
40
|
+
|
|
41
|
+
var res = decoder.write(buf)
|
|
42
|
+
var trail = decoder.end()
|
|
43
|
+
|
|
44
|
+
return trail ? (res + trail) : res
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
module.exports.encodingExists = function encodingExists (enc) {
|
|
48
|
+
try {
|
|
49
|
+
module.exports.getCodec(enc)
|
|
50
|
+
return true
|
|
51
|
+
} catch (e) {
|
|
52
|
+
return false
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Legacy aliases to convert functions
|
|
57
|
+
module.exports.toEncoding = module.exports.encode
|
|
58
|
+
module.exports.fromEncoding = module.exports.decode
|
|
59
|
+
|
|
60
|
+
// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache.
|
|
61
|
+
module.exports._codecDataCache = { __proto__: null }
|
|
62
|
+
|
|
63
|
+
module.exports.getCodec = function getCodec (encoding) {
|
|
64
|
+
if (!module.exports.encodings) {
|
|
65
|
+
var raw = require("../encodings")
|
|
66
|
+
// TODO: In future versions when old nodejs support is removed can use object.assign
|
|
67
|
+
module.exports.encodings = { __proto__: null } // Initialize as empty object.
|
|
68
|
+
mergeModules(module.exports.encodings, raw)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
|
|
72
|
+
var enc = module.exports._canonicalizeEncoding(encoding)
|
|
73
|
+
|
|
74
|
+
// Traverse iconv.encodings to find actual codec.
|
|
75
|
+
var codecOptions = {}
|
|
76
|
+
while (true) {
|
|
77
|
+
var codec = module.exports._codecDataCache[enc]
|
|
78
|
+
|
|
79
|
+
if (codec) { return codec }
|
|
80
|
+
|
|
81
|
+
var codecDef = module.exports.encodings[enc]
|
|
82
|
+
|
|
83
|
+
switch (typeof codecDef) {
|
|
84
|
+
case "string": // Direct alias to other encoding.
|
|
85
|
+
enc = codecDef
|
|
86
|
+
break
|
|
87
|
+
|
|
88
|
+
case "object": // Alias with options. Can be layered.
|
|
89
|
+
for (var key in codecDef) { codecOptions[key] = codecDef[key] }
|
|
90
|
+
|
|
91
|
+
if (!codecOptions.encodingName) { codecOptions.encodingName = enc }
|
|
92
|
+
|
|
93
|
+
enc = codecDef.type
|
|
94
|
+
break
|
|
95
|
+
|
|
96
|
+
case "function": // Codec itself.
|
|
97
|
+
if (!codecOptions.encodingName) { codecOptions.encodingName = enc }
|
|
98
|
+
|
|
99
|
+
// The codec function must load all tables and return object with .encoder and .decoder methods.
|
|
100
|
+
// It'll be called only once (for each different options object).
|
|
101
|
+
//
|
|
102
|
+
codec = new codecDef(codecOptions, module.exports)
|
|
103
|
+
|
|
104
|
+
module.exports._codecDataCache[codecOptions.encodingName] = codec // Save it to be reused later.
|
|
105
|
+
return codec
|
|
106
|
+
|
|
107
|
+
default:
|
|
108
|
+
throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '" + enc + "')")
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
module.exports._canonicalizeEncoding = function (encoding) {
|
|
114
|
+
// Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
|
|
115
|
+
return ("" + encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, "")
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
module.exports.getEncoder = function getEncoder (encoding, options) {
|
|
119
|
+
var codec = module.exports.getCodec(encoding)
|
|
120
|
+
var encoder = new codec.encoder(options, codec)
|
|
121
|
+
|
|
122
|
+
if (codec.bomAware && options && options.addBOM) { encoder = new bomHandling.PrependBOM(encoder, options) }
|
|
123
|
+
|
|
124
|
+
return encoder
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
module.exports.getDecoder = function getDecoder (encoding, options) {
|
|
128
|
+
var codec = module.exports.getCodec(encoding)
|
|
129
|
+
var decoder = new codec.decoder(options, codec)
|
|
130
|
+
|
|
131
|
+
if (codec.bomAware && !(options && options.stripBOM === false)) { decoder = new bomHandling.StripBOM(decoder, options) }
|
|
132
|
+
|
|
133
|
+
return decoder
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Streaming API
|
|
137
|
+
// NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add
|
|
138
|
+
// up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default.
|
|
139
|
+
// If you would like to enable it explicitly, please add the following code to your app:
|
|
140
|
+
// > iconv.enableStreamingAPI(require('stream'));
|
|
141
|
+
module.exports.enableStreamingAPI = function enableStreamingAPI (streamModule) {
|
|
142
|
+
if (module.exports.supportsStreams) { return }
|
|
143
|
+
|
|
144
|
+
// Dependency-inject stream module to create IconvLite stream classes.
|
|
145
|
+
var streams = require("./streams")(streamModule)
|
|
146
|
+
|
|
147
|
+
// Not public API yet, but expose the stream classes.
|
|
148
|
+
module.exports.IconvLiteEncoderStream = streams.IconvLiteEncoderStream
|
|
149
|
+
module.exports.IconvLiteDecoderStream = streams.IconvLiteDecoderStream
|
|
150
|
+
|
|
151
|
+
// Streaming API.
|
|
152
|
+
module.exports.encodeStream = function encodeStream (encoding, options) {
|
|
153
|
+
return new module.exports.IconvLiteEncoderStream(module.exports.getEncoder(encoding, options), options)
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
module.exports.decodeStream = function decodeStream (encoding, options) {
|
|
157
|
+
return new module.exports.IconvLiteDecoderStream(module.exports.getDecoder(encoding, options), options)
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
module.exports.supportsStreams = true
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments).
|
|
164
|
+
var streamModule
|
|
165
|
+
try {
|
|
166
|
+
streamModule = require("stream")
|
|
167
|
+
} catch (e) {}
|
|
168
|
+
|
|
169
|
+
if (streamModule && streamModule.Transform) {
|
|
170
|
+
module.exports.enableStreamingAPI(streamModule)
|
|
171
|
+
} else {
|
|
172
|
+
// In rare cases where 'stream' module is not available by default, throw a helpful exception.
|
|
173
|
+
module.exports.encodeStream = module.exports.decodeStream = function () {
|
|
174
|
+
throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.")
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Some environments, such as browsers, may not load JavaScript files as UTF-8
|
|
179
|
+
// eslint-disable-next-line no-constant-condition
|
|
180
|
+
if ("Ā" !== "\u0100") {
|
|
181
|
+
console.error("iconv-lite warning: js files use non-utf8 encoding. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info.")
|
|
182
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict"
|
|
2
|
+
|
|
3
|
+
var Buffer = require("safer-buffer").Buffer
|
|
4
|
+
|
|
5
|
+
// NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments),
|
|
6
|
+
// we opt to dependency-inject it instead of creating a hard dependency.
|
|
7
|
+
module.exports = function (streamModule) {
|
|
8
|
+
var Transform = streamModule.Transform
|
|
9
|
+
|
|
10
|
+
// == Encoder stream =======================================================
|
|
11
|
+
|
|
12
|
+
function IconvLiteEncoderStream (conv, options) {
|
|
13
|
+
this.conv = conv
|
|
14
|
+
options = options || {}
|
|
15
|
+
options.decodeStrings = false // We accept only strings, so we don't need to decode them.
|
|
16
|
+
Transform.call(this, options)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, {
|
|
20
|
+
constructor: { value: IconvLiteEncoderStream }
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
IconvLiteEncoderStream.prototype._transform = function (chunk, encoding, done) {
|
|
24
|
+
if (typeof chunk !== "string") {
|
|
25
|
+
return done(new Error("Iconv encoding stream needs strings as its input."))
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
var res = this.conv.write(chunk)
|
|
30
|
+
if (res && res.length) this.push(res)
|
|
31
|
+
done()
|
|
32
|
+
} catch (e) {
|
|
33
|
+
done(e)
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
IconvLiteEncoderStream.prototype._flush = function (done) {
|
|
38
|
+
try {
|
|
39
|
+
var res = this.conv.end()
|
|
40
|
+
if (res && res.length) this.push(res)
|
|
41
|
+
done()
|
|
42
|
+
} catch (e) {
|
|
43
|
+
done(e)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
IconvLiteEncoderStream.prototype.collect = function (cb) {
|
|
48
|
+
var chunks = []
|
|
49
|
+
this.on("error", cb)
|
|
50
|
+
this.on("data", function (chunk) { chunks.push(chunk) })
|
|
51
|
+
this.on("end", function () {
|
|
52
|
+
cb(null, Buffer.concat(chunks))
|
|
53
|
+
})
|
|
54
|
+
return this
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// == Decoder stream =======================================================
|
|
58
|
+
|
|
59
|
+
function IconvLiteDecoderStream (conv, options) {
|
|
60
|
+
this.conv = conv
|
|
61
|
+
options = options || {}
|
|
62
|
+
options.encoding = this.encoding = "utf8" // We output strings.
|
|
63
|
+
Transform.call(this, options)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, {
|
|
67
|
+
constructor: { value: IconvLiteDecoderStream }
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
IconvLiteDecoderStream.prototype._transform = function (chunk, encoding, done) {
|
|
71
|
+
if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array)) { return done(new Error("Iconv decoding stream needs buffers as its input.")) }
|
|
72
|
+
try {
|
|
73
|
+
var res = this.conv.write(chunk)
|
|
74
|
+
if (res && res.length) this.push(res, this.encoding)
|
|
75
|
+
done()
|
|
76
|
+
} catch (e) {
|
|
77
|
+
done(e)
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
IconvLiteDecoderStream.prototype._flush = function (done) {
|
|
82
|
+
try {
|
|
83
|
+
var res = this.conv.end()
|
|
84
|
+
if (res && res.length) this.push(res, this.encoding)
|
|
85
|
+
done()
|
|
86
|
+
} catch (e) {
|
|
87
|
+
done(e)
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
IconvLiteDecoderStream.prototype.collect = function (cb) {
|
|
92
|
+
var res = ""
|
|
93
|
+
this.on("error", cb)
|
|
94
|
+
this.on("data", function (chunk) { res += chunk })
|
|
95
|
+
this.on("end", function () {
|
|
96
|
+
cb(null, res)
|
|
97
|
+
})
|
|
98
|
+
return this
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
IconvLiteEncoderStream: IconvLiteEncoderStream,
|
|
103
|
+
IconvLiteDecoderStream: IconvLiteDecoderStream
|
|
104
|
+
}
|
|
105
|
+
}
|