ali-skills 0.0.21 → 0.0.22
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/node_modules/@ali/cli-skills/dist/cli.mjs +1214 -287
- package/node_modules/@ali/cli-skills/package.json +5 -2
- package/node_modules/@ali/o2-open-client/.editorconfig +11 -0
- package/node_modules/@ali/o2-open-client/README.md +80 -0
- package/node_modules/@ali/o2-open-client/abc.json +8 -0
- package/node_modules/@ali/o2-open-client/es/browser/ee.d.ts +23 -0
- package/node_modules/@ali/o2-open-client/es/browser/ee.js +82 -0
- package/node_modules/@ali/o2-open-client/es/browser/entry.d.ts +32 -0
- package/node_modules/@ali/o2-open-client/es/browser/entry.js +306 -0
- package/node_modules/@ali/o2-open-client/es/browser/escape.d.ts +12 -0
- package/node_modules/@ali/o2-open-client/es/browser/escape.js +178 -0
- package/node_modules/@ali/o2-open-client/es/browser/fetch.d.ts +1 -0
- package/node_modules/@ali/o2-open-client/es/browser/fetch.js +14 -0
- package/node_modules/@ali/o2-open-client/es/browser/index.d.ts +1 -0
- package/node_modules/@ali/o2-open-client/es/browser/index.js +1 -0
- package/node_modules/@ali/o2-open-client/es/common/constant.d.ts +42 -0
- package/node_modules/@ali/o2-open-client/es/common/constant.js +53 -0
- package/node_modules/@ali/o2-open-client/es/common/format.d.ts +14 -0
- package/node_modules/@ali/o2-open-client/es/common/format.js +43 -0
- package/node_modules/@ali/o2-open-client/es/common/service-meta.d.ts +33 -0
- package/node_modules/@ali/o2-open-client/es/common/service-meta.js +33 -0
- package/node_modules/@ali/o2-open-client/es/index.d.ts +1 -0
- package/node_modules/@ali/o2-open-client/es/index.js +8 -0
- package/node_modules/@ali/o2-open-client/es/node/config.d.ts +47 -0
- package/node_modules/@ali/o2-open-client/es/node/config.js +188 -0
- package/node_modules/@ali/o2-open-client/es/node/escape.d.ts +22 -0
- package/node_modules/@ali/o2-open-client/es/node/escape.js +131 -0
- package/node_modules/@ali/o2-open-client/es/node/help.d.ts +10 -0
- package/node_modules/@ali/o2-open-client/es/node/help.js +96 -0
- package/node_modules/@ali/o2-open-client/es/node/index.d.ts +48 -0
- package/node_modules/@ali/o2-open-client/es/node/index.js +247 -0
- package/node_modules/@ali/o2-open-client/es/node/token-handler.d.ts +1 -0
- package/node_modules/@ali/o2-open-client/es/node/token-handler.js +21 -0
- package/node_modules/@ali/o2-open-client/lib/browser/ee.d.ts +23 -0
- package/node_modules/@ali/o2-open-client/lib/browser/ee.js +86 -0
- package/node_modules/@ali/o2-open-client/lib/browser/entry.d.ts +32 -0
- package/node_modules/@ali/o2-open-client/lib/browser/entry.js +310 -0
- package/node_modules/@ali/o2-open-client/lib/browser/escape.d.ts +12 -0
- package/node_modules/@ali/o2-open-client/lib/browser/escape.js +185 -0
- package/node_modules/@ali/o2-open-client/lib/browser/fetch.d.ts +1 -0
- package/node_modules/@ali/o2-open-client/lib/browser/fetch.js +18 -0
- package/node_modules/@ali/o2-open-client/lib/common/constant.d.ts +42 -0
- package/node_modules/@ali/o2-open-client/lib/common/constant.js +56 -0
- package/node_modules/@ali/o2-open-client/lib/common/format.d.ts +14 -0
- package/node_modules/@ali/o2-open-client/lib/common/format.js +48 -0
- package/node_modules/@ali/o2-open-client/lib/common/service-meta.d.ts +33 -0
- package/node_modules/@ali/o2-open-client/lib/common/service-meta.js +36 -0
- package/node_modules/@ali/o2-open-client/lib/index.d.ts +1 -0
- package/node_modules/@ali/o2-open-client/lib/index.js +20 -0
- package/node_modules/@ali/o2-open-client/lib/node/config.d.ts +47 -0
- package/node_modules/@ali/o2-open-client/lib/node/config.js +192 -0
- package/node_modules/@ali/o2-open-client/lib/node/escape.d.ts +22 -0
- package/node_modules/@ali/o2-open-client/lib/node/escape.js +137 -0
- package/node_modules/@ali/o2-open-client/lib/node/help.d.ts +10 -0
- package/node_modules/@ali/o2-open-client/lib/node/help.js +100 -0
- package/node_modules/@ali/o2-open-client/lib/node/index.d.ts +48 -0
- package/node_modules/@ali/o2-open-client/lib/node/index.js +250 -0
- package/node_modules/@ali/o2-open-client/lib/node/token-handler.d.ts +1 -0
- package/node_modules/@ali/o2-open-client/lib/node/token-handler.js +25 -0
- package/node_modules/@ali/o2-open-client/package.json +46 -0
- package/node_modules/@ali/o2-open-client/playwright.config.ts +54 -0
- package/node_modules/@ali/o2-open-client/tsconfig.es.json +31 -0
- package/node_modules/@ali/o2-open-client/tsconfig.json +31 -0
- package/node_modules/@ali/o2-open-client/tsx2doc.config.js +5 -0
- package/node_modules/@ali/o2-open-client/typings/index.d.ts +36 -0
- package/node_modules/@types/node/LICENSE +21 -0
- package/node_modules/@types/node/README.md +15 -0
- package/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/node_modules/@types/node/assert.d.ts +1062 -0
- package/node_modules/@types/node/async_hooks.d.ts +605 -0
- package/node_modules/@types/node/buffer.buffer.d.ts +471 -0
- package/node_modules/@types/node/buffer.d.ts +1936 -0
- package/node_modules/@types/node/child_process.d.ts +1475 -0
- package/node_modules/@types/node/cluster.d.ts +577 -0
- package/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
- package/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
- package/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
- package/node_modules/@types/node/console.d.ts +452 -0
- package/node_modules/@types/node/constants.d.ts +21 -0
- package/node_modules/@types/node/crypto.d.ts +4590 -0
- package/node_modules/@types/node/dgram.d.ts +597 -0
- package/node_modules/@types/node/diagnostics_channel.d.ts +578 -0
- package/node_modules/@types/node/dns/promises.d.ts +479 -0
- package/node_modules/@types/node/dns.d.ts +871 -0
- package/node_modules/@types/node/domain.d.ts +170 -0
- package/node_modules/@types/node/events.d.ts +977 -0
- package/node_modules/@types/node/fs/promises.d.ts +1270 -0
- package/node_modules/@types/node/fs.d.ts +4375 -0
- package/node_modules/@types/node/globals.d.ts +172 -0
- package/node_modules/@types/node/globals.typedarray.d.ts +38 -0
- package/node_modules/@types/node/http.d.ts +2049 -0
- package/node_modules/@types/node/http2.d.ts +2631 -0
- package/node_modules/@types/node/https.d.ts +578 -0
- package/node_modules/@types/node/index.d.ts +93 -0
- package/node_modules/@types/node/inspector.generated.d.ts +3966 -0
- package/node_modules/@types/node/module.d.ts +539 -0
- package/node_modules/@types/node/net.d.ts +1031 -0
- package/node_modules/@types/node/os.d.ts +506 -0
- package/node_modules/@types/node/package.json +140 -0
- package/node_modules/@types/node/path.d.ts +200 -0
- package/node_modules/@types/node/perf_hooks.d.ts +961 -0
- package/node_modules/@types/node/process.d.ts +1961 -0
- package/node_modules/@types/node/punycode.d.ts +117 -0
- package/node_modules/@types/node/querystring.d.ts +152 -0
- package/node_modules/@types/node/readline/promises.d.ts +162 -0
- package/node_modules/@types/node/readline.d.ts +589 -0
- package/node_modules/@types/node/repl.d.ts +430 -0
- package/node_modules/@types/node/sea.d.ts +153 -0
- package/node_modules/@types/node/stream/consumers.d.ts +38 -0
- package/node_modules/@types/node/stream/promises.d.ts +90 -0
- package/node_modules/@types/node/stream/web.d.ts +533 -0
- package/node_modules/@types/node/stream.d.ts +1698 -0
- package/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/node_modules/@types/node/test.d.ts +1787 -0
- package/node_modules/@types/node/timers/promises.d.ts +108 -0
- package/node_modules/@types/node/timers.d.ts +286 -0
- package/node_modules/@types/node/tls.d.ts +1259 -0
- package/node_modules/@types/node/trace_events.d.ts +197 -0
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
- package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +34 -0
- package/node_modules/@types/node/ts5.6/index.d.ts +93 -0
- package/node_modules/@types/node/tty.d.ts +208 -0
- package/node_modules/@types/node/url.d.ts +964 -0
- package/node_modules/@types/node/util.d.ts +2331 -0
- package/node_modules/@types/node/v8.d.ts +809 -0
- package/node_modules/@types/node/vm.d.ts +1001 -0
- package/node_modules/@types/node/wasi.d.ts +181 -0
- package/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
- package/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/node_modules/@types/node/web-globals/events.d.ts +97 -0
- package/node_modules/@types/node/web-globals/fetch.d.ts +55 -0
- package/node_modules/@types/node/worker_threads.d.ts +715 -0
- package/node_modules/@types/node/zlib.d.ts +598 -0
- package/node_modules/ansi-styles/index.d.ts +345 -0
- package/node_modules/ansi-styles/index.js +163 -0
- package/node_modules/ansi-styles/license +9 -0
- package/node_modules/ansi-styles/package.json +56 -0
- package/node_modules/ansi-styles/readme.md +152 -0
- package/node_modules/await-event/LICENSE +22 -0
- package/node_modules/await-event/README.md +48 -0
- package/node_modules/await-event/index.js +13 -0
- package/node_modules/await-event/package.json +33 -0
- package/node_modules/await-first/LICENSE +21 -0
- package/node_modules/await-first/README.md +80 -0
- package/node_modules/await-first/lib/index.js +21 -0
- package/node_modules/await-first/package.json +49 -0
- package/node_modules/byte/LICENSE.txt +21 -0
- package/node_modules/byte/README.md +207 -0
- package/node_modules/byte/lib/byte.js +635 -0
- package/node_modules/byte/lib/number.js +82 -0
- package/node_modules/byte/package.json +61 -0
- package/node_modules/chalk/index.d.ts +415 -0
- package/node_modules/chalk/license +9 -0
- package/node_modules/chalk/package.json +68 -0
- package/node_modules/chalk/readme.md +341 -0
- package/node_modules/chalk/source/index.js +229 -0
- package/node_modules/chalk/source/templates.js +134 -0
- package/node_modules/chalk/source/util.js +39 -0
- package/node_modules/circular-json-for-egg/LICENSE.txt +19 -0
- package/node_modules/circular-json-for-egg/README.md +148 -0
- package/node_modules/circular-json-for-egg/build/circular-json.amd.js +2 -0
- package/node_modules/circular-json-for-egg/build/circular-json.js +2 -0
- package/node_modules/circular-json-for-egg/build/circular-json.max.amd.js +210 -0
- package/node_modules/circular-json-for-egg/build/circular-json.max.js +210 -0
- package/node_modules/circular-json-for-egg/build/circular-json.node.js +207 -0
- package/node_modules/circular-json-for-egg/package.json +42 -0
- package/node_modules/cluster-client/LICENSE +21 -0
- package/node_modules/cluster-client/README.md +319 -0
- package/node_modules/cluster-client/index.js +66 -0
- package/node_modules/cluster-client/lib/api_client.js +74 -0
- package/node_modules/cluster-client/lib/connection.js +180 -0
- package/node_modules/cluster-client/lib/const.js +5 -0
- package/node_modules/cluster-client/lib/default_logger.js +11 -0
- package/node_modules/cluster-client/lib/default_transcode.js +6 -0
- package/node_modules/cluster-client/lib/follower.js +331 -0
- package/node_modules/cluster-client/lib/index.js +213 -0
- package/node_modules/cluster-client/lib/leader.js +437 -0
- package/node_modules/cluster-client/lib/protocol/byte_buffer.js +8 -0
- package/node_modules/cluster-client/lib/protocol/packet.js +103 -0
- package/node_modules/cluster-client/lib/protocol/request.js +17 -0
- package/node_modules/cluster-client/lib/protocol/response.js +14 -0
- package/node_modules/cluster-client/lib/server.js +256 -0
- package/node_modules/cluster-client/lib/symbol.js +20 -0
- package/node_modules/cluster-client/lib/utils.js +103 -0
- package/node_modules/cluster-client/lib/wrapper/base.js +210 -0
- package/node_modules/cluster-client/lib/wrapper/cluster.js +57 -0
- package/node_modules/cluster-client/lib/wrapper/single.js +192 -0
- package/node_modules/cluster-client/package.json +60 -0
- package/node_modules/co/LICENSE +22 -0
- package/node_modules/co/Readme.md +212 -0
- package/node_modules/co/index.js +237 -0
- package/node_modules/co/package.json +34 -0
- package/node_modules/color-convert/LICENSE +21 -0
- package/node_modules/color-convert/README.md +68 -0
- package/node_modules/color-convert/conversions.js +839 -0
- package/node_modules/color-convert/index.js +81 -0
- package/node_modules/color-convert/package.json +48 -0
- package/node_modules/color-convert/route.js +97 -0
- package/node_modules/color-name/LICENSE +8 -0
- package/node_modules/color-name/README.md +11 -0
- package/node_modules/color-name/index.js +152 -0
- package/node_modules/color-name/package.json +28 -0
- package/node_modules/core-util-is/LICENSE +19 -0
- package/node_modules/core-util-is/README.md +3 -0
- package/node_modules/core-util-is/lib/util.js +107 -0
- package/node_modules/core-util-is/package.json +38 -0
- package/node_modules/debug/LICENSE +20 -0
- package/node_modules/debug/README.md +481 -0
- package/node_modules/debug/package.json +64 -0
- package/node_modules/debug/src/browser.js +272 -0
- package/node_modules/debug/src/common.js +292 -0
- package/node_modules/debug/src/index.js +10 -0
- package/node_modules/debug/src/node.js +263 -0
- package/node_modules/depd/History.md +103 -0
- package/node_modules/depd/LICENSE +22 -0
- package/node_modules/depd/Readme.md +280 -0
- package/node_modules/depd/index.js +538 -0
- package/node_modules/depd/lib/browser/index.js +77 -0
- package/node_modules/depd/package.json +45 -0
- package/node_modules/ee-first/LICENSE +22 -0
- package/node_modules/ee-first/README.md +80 -0
- package/node_modules/ee-first/index.js +95 -0
- package/node_modules/ee-first/package.json +29 -0
- package/node_modules/egg-errors/LICENSE +21 -0
- package/node_modules/egg-errors/README.md +259 -0
- package/node_modules/egg-errors/lib/base.d.ts +10 -0
- package/node_modules/egg-errors/lib/base.js +28 -0
- package/node_modules/egg-errors/lib/base_error.d.ts +6 -0
- package/node_modules/egg-errors/lib/base_error.js +13 -0
- package/node_modules/egg-errors/lib/base_exception.d.ts +6 -0
- package/node_modules/egg-errors/lib/base_exception.js +13 -0
- package/node_modules/egg-errors/lib/error.d.ts +6 -0
- package/node_modules/egg-errors/lib/error.js +13 -0
- package/node_modules/egg-errors/lib/error_options.d.ts +5 -0
- package/node_modules/egg-errors/lib/error_options.js +6 -0
- package/node_modules/egg-errors/lib/error_type.d.ts +6 -0
- package/node_modules/egg-errors/lib/error_type.js +10 -0
- package/node_modules/egg-errors/lib/exception.d.ts +6 -0
- package/node_modules/egg-errors/lib/exception.js +13 -0
- package/node_modules/egg-errors/lib/framework/formatter.d.ts +6 -0
- package/node_modules/egg-errors/lib/framework/formatter.js +29 -0
- package/node_modules/egg-errors/lib/framework/framework_base_error.d.ts +10 -0
- package/node_modules/egg-errors/lib/framework/framework_base_error.js +32 -0
- package/node_modules/egg-errors/lib/http/400.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/400.js +13 -0
- package/node_modules/egg-errors/lib/http/401.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/401.js +13 -0
- package/node_modules/egg-errors/lib/http/402.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/402.js +13 -0
- package/node_modules/egg-errors/lib/http/403.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/403.js +13 -0
- package/node_modules/egg-errors/lib/http/404.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/404.js +13 -0
- package/node_modules/egg-errors/lib/http/405.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/405.js +13 -0
- package/node_modules/egg-errors/lib/http/406.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/406.js +13 -0
- package/node_modules/egg-errors/lib/http/407.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/407.js +13 -0
- package/node_modules/egg-errors/lib/http/408.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/408.js +13 -0
- package/node_modules/egg-errors/lib/http/409.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/409.js +13 -0
- package/node_modules/egg-errors/lib/http/410.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/410.js +13 -0
- package/node_modules/egg-errors/lib/http/411.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/411.js +13 -0
- package/node_modules/egg-errors/lib/http/412.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/412.js +13 -0
- package/node_modules/egg-errors/lib/http/413.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/413.js +13 -0
- package/node_modules/egg-errors/lib/http/414.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/414.js +13 -0
- package/node_modules/egg-errors/lib/http/415.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/415.js +13 -0
- package/node_modules/egg-errors/lib/http/416.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/416.js +13 -0
- package/node_modules/egg-errors/lib/http/417.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/417.js +13 -0
- package/node_modules/egg-errors/lib/http/418.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/418.js +13 -0
- package/node_modules/egg-errors/lib/http/421.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/421.js +13 -0
- package/node_modules/egg-errors/lib/http/422.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/422.js +13 -0
- package/node_modules/egg-errors/lib/http/423.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/423.js +13 -0
- package/node_modules/egg-errors/lib/http/424.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/424.js +13 -0
- package/node_modules/egg-errors/lib/http/425.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/425.js +13 -0
- package/node_modules/egg-errors/lib/http/426.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/426.js +13 -0
- package/node_modules/egg-errors/lib/http/428.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/428.js +13 -0
- package/node_modules/egg-errors/lib/http/429.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/429.js +13 -0
- package/node_modules/egg-errors/lib/http/431.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/431.js +13 -0
- package/node_modules/egg-errors/lib/http/451.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/451.js +13 -0
- package/node_modules/egg-errors/lib/http/500.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/500.js +13 -0
- package/node_modules/egg-errors/lib/http/501.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/501.js +13 -0
- package/node_modules/egg-errors/lib/http/502.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/502.js +13 -0
- package/node_modules/egg-errors/lib/http/503.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/503.js +13 -0
- package/node_modules/egg-errors/lib/http/504.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/504.js +13 -0
- package/node_modules/egg-errors/lib/http/505.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/505.js +13 -0
- package/node_modules/egg-errors/lib/http/506.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/506.js +13 -0
- package/node_modules/egg-errors/lib/http/507.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/507.js +13 -0
- package/node_modules/egg-errors/lib/http/508.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/508.js +13 -0
- package/node_modules/egg-errors/lib/http/509.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/509.js +13 -0
- package/node_modules/egg-errors/lib/http/510.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/510.js +13 -0
- package/node_modules/egg-errors/lib/http/511.d.ts +5 -0
- package/node_modules/egg-errors/lib/http/511.js +13 -0
- package/node_modules/egg-errors/lib/http/http_error.d.ts +10 -0
- package/node_modules/egg-errors/lib/http/http_error.js +13 -0
- package/node_modules/egg-errors/lib/http/http_error_options.d.ts +6 -0
- package/node_modules/egg-errors/lib/http/http_error_options.js +7 -0
- package/node_modules/egg-errors/lib/http/http_header.d.ts +3 -0
- package/node_modules/egg-errors/lib/http/http_header.js +3 -0
- package/node_modules/egg-errors/lib/index.d.ts +50 -0
- package/node_modules/egg-errors/lib/index.js +149 -0
- package/node_modules/egg-errors/package.json +49 -0
- package/node_modules/egg-logger/LICENSE +21 -0
- package/node_modules/egg-logger/README.md +128 -0
- package/node_modules/egg-logger/README.zh-CN.md +125 -0
- package/node_modules/egg-logger/index.d.ts +233 -0
- package/node_modules/egg-logger/index.js +18 -0
- package/node_modules/egg-logger/lib/egg/console_logger.js +36 -0
- package/node_modules/egg-logger/lib/egg/context_logger.js +43 -0
- package/node_modules/egg-logger/lib/egg/custom_logger.js +10 -0
- package/node_modules/egg-logger/lib/egg/error_logger.js +31 -0
- package/node_modules/egg-logger/lib/egg/logger.js +128 -0
- package/node_modules/egg-logger/lib/egg/loggers.js +163 -0
- package/node_modules/egg-logger/lib/level.js +34 -0
- package/node_modules/egg-logger/lib/logger.js +170 -0
- package/node_modules/egg-logger/lib/transports/console.js +52 -0
- package/node_modules/egg-logger/lib/transports/file.js +134 -0
- package/node_modules/egg-logger/lib/transports/file_buffer.js +113 -0
- package/node_modules/egg-logger/lib/transports/transport.js +129 -0
- package/node_modules/egg-logger/lib/utils.js +296 -0
- package/node_modules/egg-logger/package.json +54 -0
- package/node_modules/escape-html/LICENSE +24 -0
- package/node_modules/escape-html/Readme.md +43 -0
- package/node_modules/escape-html/index.js +78 -0
- package/node_modules/escape-html/package.json +24 -0
- package/node_modules/extend-shallow/LICENSE +21 -0
- package/node_modules/extend-shallow/README.md +61 -0
- package/node_modules/extend-shallow/index.js +33 -0
- package/node_modules/extend-shallow/package.json +56 -0
- package/node_modules/has-flag/index.d.ts +39 -0
- package/node_modules/has-flag/index.js +8 -0
- package/node_modules/has-flag/license +9 -0
- package/node_modules/has-flag/package.json +46 -0
- package/node_modules/has-flag/readme.md +89 -0
- package/node_modules/heartbeats/.eslintrc +151 -0
- package/node_modules/heartbeats/.npmignore +28 -0
- package/node_modules/heartbeats/.travis.yml +10 -0
- package/node_modules/heartbeats/LICENSE +21 -0
- package/node_modules/heartbeats/README.md +323 -0
- package/node_modules/heartbeats/lib/beatevent.js +35 -0
- package/node_modules/heartbeats/lib/heart.js +178 -0
- package/node_modules/heartbeats/lib/pulse.js +39 -0
- package/node_modules/heartbeats/main.js +34 -0
- package/node_modules/heartbeats/package.json +39 -0
- package/node_modules/heartbeats/test/benchmark.js +138 -0
- package/node_modules/heartbeats/test/spawn.js +16 -0
- package/node_modules/heartbeats/test/test.js +158 -0
- package/node_modules/httpx/README.md +96 -0
- package/node_modules/httpx/lib/index.d.ts +31 -0
- package/node_modules/httpx/lib/index.js +396 -0
- package/node_modules/httpx/package.json +36 -0
- package/node_modules/iconv-lite/.github/dependabot.yml +11 -0
- package/node_modules/iconv-lite/.idea/codeStyles/Project.xml +47 -0
- package/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/node_modules/iconv-lite/.idea/iconv-lite.iml +12 -0
- package/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/node_modules/iconv-lite/.idea/modules.xml +8 -0
- package/node_modules/iconv-lite/.idea/vcs.xml +6 -0
- package/node_modules/iconv-lite/Changelog.md +212 -0
- package/node_modules/iconv-lite/LICENSE +21 -0
- package/node_modules/iconv-lite/README.md +130 -0
- package/node_modules/iconv-lite/encodings/dbcs-codec.js +597 -0
- package/node_modules/iconv-lite/encodings/dbcs-data.js +188 -0
- package/node_modules/iconv-lite/encodings/index.js +23 -0
- package/node_modules/iconv-lite/encodings/internal.js +198 -0
- package/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
- package/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- package/node_modules/iconv-lite/encodings/sbcs-data.js +179 -0
- package/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- package/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- package/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- package/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- package/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- package/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- package/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
- package/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- package/node_modules/iconv-lite/encodings/utf16.js +197 -0
- package/node_modules/iconv-lite/encodings/utf32.js +319 -0
- package/node_modules/iconv-lite/encodings/utf7.js +290 -0
- package/node_modules/iconv-lite/lib/bom-handling.js +52 -0
- package/node_modules/iconv-lite/lib/index.d.ts +41 -0
- package/node_modules/iconv-lite/lib/index.js +180 -0
- package/node_modules/iconv-lite/lib/streams.js +109 -0
- package/node_modules/iconv-lite/package.json +44 -0
- package/node_modules/ip/README.md +90 -0
- package/node_modules/ip/lib/ip.js +496 -0
- package/node_modules/ip/package.json +25 -0
- package/node_modules/is-class-hotfix/.editorconfig +23 -0
- package/node_modules/is-class-hotfix/.gitattributes +2 -0
- package/node_modules/is-class-hotfix/CHANGELOG.md +7 -0
- package/node_modules/is-class-hotfix/LICENSE.md +21 -0
- package/node_modules/is-class-hotfix/README.md +35 -0
- package/node_modules/is-class-hotfix/bower.json +24 -0
- package/node_modules/is-class-hotfix/is-class.js +28 -0
- package/node_modules/is-class-hotfix/package.json +31 -0
- package/node_modules/is-class-hotfix/test/babel-class.js +27 -0
- package/node_modules/is-class-hotfix/test/is-class.js +31 -0
- package/node_modules/is-extendable/LICENSE +21 -0
- package/node_modules/is-extendable/README.md +72 -0
- package/node_modules/is-extendable/index.js +13 -0
- package/node_modules/is-extendable/package.json +51 -0
- package/node_modules/is-type-of/LICENSE +21 -0
- package/node_modules/is-type-of/README.md +105 -0
- package/node_modules/is-type-of/index.d.ts +65 -0
- package/node_modules/is-type-of/index.js +125 -0
- package/node_modules/is-type-of/package.json +45 -0
- package/node_modules/isstream/.jshintrc +59 -0
- package/node_modules/isstream/.npmignore +1 -0
- package/node_modules/isstream/.travis.yml +12 -0
- package/node_modules/isstream/LICENSE.md +11 -0
- package/node_modules/isstream/README.md +66 -0
- package/node_modules/isstream/isstream.js +27 -0
- package/node_modules/isstream/package.json +33 -0
- package/node_modules/isstream/test.js +168 -0
- package/node_modules/json-stringify-safe/.npmignore +1 -0
- package/node_modules/json-stringify-safe/CHANGELOG.md +14 -0
- package/node_modules/json-stringify-safe/LICENSE +15 -0
- package/node_modules/json-stringify-safe/Makefile +35 -0
- package/node_modules/json-stringify-safe/README.md +52 -0
- package/node_modules/json-stringify-safe/package.json +31 -0
- package/node_modules/json-stringify-safe/stringify.js +27 -0
- package/node_modules/json-stringify-safe/test/mocha.opts +2 -0
- package/node_modules/json-stringify-safe/test/stringify_test.js +246 -0
- package/node_modules/kitx/LICENSE +21 -0
- package/node_modules/kitx/README.md +35 -0
- package/node_modules/kitx/lib/index.d.ts +45 -0
- package/node_modules/kitx/lib/index.js +289 -0
- package/node_modules/kitx/package.json +41 -0
- package/node_modules/long/LICENSE +202 -0
- package/node_modules/long/README.md +246 -0
- package/node_modules/long/dist/long.js +2 -0
- package/node_modules/long/dist/long.js.map +1 -0
- package/node_modules/long/index.js +1 -0
- package/node_modules/long/package.json +34 -0
- package/node_modules/long/src/long.js +1323 -0
- package/node_modules/ms/index.js +162 -0
- package/node_modules/ms/license.md +21 -0
- package/node_modules/ms/package.json +38 -0
- package/node_modules/ms/readme.md +59 -0
- package/node_modules/p-timeout/index.d.ts +113 -0
- package/node_modules/p-timeout/index.js +71 -0
- package/node_modules/p-timeout/license +9 -0
- package/node_modules/p-timeout/package.json +44 -0
- package/node_modules/p-timeout/readme.md +117 -0
- package/node_modules/safer-buffer/LICENSE +21 -0
- package/node_modules/safer-buffer/Porting-Buffer.md +268 -0
- package/node_modules/safer-buffer/Readme.md +156 -0
- package/node_modules/safer-buffer/dangerous.js +58 -0
- package/node_modules/safer-buffer/package.json +34 -0
- package/node_modules/safer-buffer/safer.js +77 -0
- package/node_modules/safer-buffer/tests.js +406 -0
- package/node_modules/sdk-base/LICENSE +21 -0
- package/node_modules/sdk-base/README.md +165 -0
- package/node_modules/sdk-base/index.d.ts +29 -0
- package/node_modules/sdk-base/index.js +251 -0
- package/node_modules/sdk-base/package.json +54 -0
- package/node_modules/serialize-json/LICENSE +21 -0
- package/node_modules/serialize-json/README.md +74 -0
- package/node_modules/serialize-json/lib/decoder.js +190 -0
- package/node_modules/serialize-json/lib/encoder.js +200 -0
- package/node_modules/serialize-json/lib/index.js +15 -0
- package/node_modules/serialize-json/package.json +53 -0
- package/node_modules/supports-color/browser.js +5 -0
- package/node_modules/supports-color/index.js +135 -0
- package/node_modules/supports-color/license +9 -0
- package/node_modules/supports-color/package.json +53 -0
- package/node_modules/supports-color/readme.md +76 -0
- package/node_modules/tcp-base/LICENSE +21 -0
- package/node_modules/tcp-base/README.md +134 -0
- package/node_modules/tcp-base/lib/base.js +456 -0
- package/node_modules/tcp-base/package.json +44 -0
- package/node_modules/undici-types/LICENSE +21 -0
- package/node_modules/undici-types/README.md +6 -0
- package/node_modules/undici-types/agent.d.ts +31 -0
- package/node_modules/undici-types/api.d.ts +43 -0
- package/node_modules/undici-types/balanced-pool.d.ts +29 -0
- package/node_modules/undici-types/cache.d.ts +36 -0
- package/node_modules/undici-types/client.d.ts +108 -0
- package/node_modules/undici-types/connector.d.ts +34 -0
- package/node_modules/undici-types/content-type.d.ts +21 -0
- package/node_modules/undici-types/cookies.d.ts +28 -0
- package/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
- package/node_modules/undici-types/dispatcher.d.ts +256 -0
- package/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
- package/node_modules/undici-types/errors.d.ts +149 -0
- package/node_modules/undici-types/eventsource.d.ts +61 -0
- package/node_modules/undici-types/fetch.d.ts +209 -0
- package/node_modules/undici-types/file.d.ts +39 -0
- package/node_modules/undici-types/filereader.d.ts +54 -0
- package/node_modules/undici-types/formdata.d.ts +108 -0
- package/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/node_modules/undici-types/global-origin.d.ts +7 -0
- package/node_modules/undici-types/handlers.d.ts +15 -0
- package/node_modules/undici-types/header.d.ts +4 -0
- package/node_modules/undici-types/index.d.ts +71 -0
- package/node_modules/undici-types/interceptors.d.ts +17 -0
- package/node_modules/undici-types/mock-agent.d.ts +50 -0
- package/node_modules/undici-types/mock-client.d.ts +25 -0
- package/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/node_modules/undici-types/mock-interceptor.d.ts +93 -0
- package/node_modules/undici-types/mock-pool.d.ts +25 -0
- package/node_modules/undici-types/package.json +55 -0
- package/node_modules/undici-types/patch.d.ts +33 -0
- package/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/node_modules/undici-types/pool.d.ts +39 -0
- package/node_modules/undici-types/proxy-agent.d.ts +28 -0
- package/node_modules/undici-types/readable.d.ts +65 -0
- package/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/node_modules/undici-types/retry-handler.d.ts +116 -0
- package/node_modules/undici-types/util.d.ts +18 -0
- package/node_modules/undici-types/webidl.d.ts +228 -0
- package/node_modules/undici-types/websocket.d.ts +150 -0
- package/node_modules/unescape/LICENSE +21 -0
- package/node_modules/unescape/README.md +134 -0
- package/node_modules/unescape/index.js +103 -0
- package/node_modules/unescape/package.json +67 -0
- package/node_modules/utility/LICENSE.txt +21 -0
- package/node_modules/utility/README.md +370 -0
- package/node_modules/utility/dist/commonjs/array.d.ts +11 -0
- package/node_modules/utility/dist/commonjs/array.js +46 -0
- package/node_modules/utility/dist/commonjs/crypto.d.ts +86 -0
- package/node_modules/utility/dist/commonjs/crypto.js +159 -0
- package/node_modules/utility/dist/commonjs/date.d.ts +63 -0
- package/node_modules/utility/dist/commonjs/date.js +219 -0
- package/node_modules/utility/dist/commonjs/fs.d.ts +6 -0
- package/node_modules/utility/dist/commonjs/fs.js +20 -0
- package/node_modules/utility/dist/commonjs/function.d.ts +12 -0
- package/node_modules/utility/dist/commonjs/function.js +35 -0
- package/node_modules/utility/dist/commonjs/index.d.ts +12 -0
- package/node_modules/utility/dist/commonjs/index.js +29 -0
- package/node_modules/utility/dist/commonjs/json.d.ts +14 -0
- package/node_modules/utility/dist/commonjs/json.js +41 -0
- package/node_modules/utility/dist/commonjs/number.d.ts +24 -0
- package/node_modules/utility/dist/commonjs/number.js +66 -0
- package/node_modules/utility/dist/commonjs/object.d.ts +20 -0
- package/node_modules/utility/dist/commonjs/object.js +73 -0
- package/node_modules/utility/dist/commonjs/optimize.d.ts +21 -0
- package/node_modules/utility/dist/commonjs/optimize.js +60 -0
- package/node_modules/utility/dist/commonjs/package.json +3 -0
- package/node_modules/utility/dist/commonjs/string.d.ts +29 -0
- package/node_modules/utility/dist/commonjs/string.js +126 -0
- package/node_modules/utility/dist/commonjs/timeout.d.ts +6 -0
- package/node_modules/utility/dist/commonjs/timeout.js +34 -0
- package/node_modules/utility/dist/commonjs/web.d.ts +29 -0
- package/node_modules/utility/dist/commonjs/web.js +61 -0
- package/node_modules/utility/dist/esm/array.d.ts +11 -0
- package/node_modules/utility/dist/esm/array.js +42 -0
- package/node_modules/utility/dist/esm/crypto.d.ts +86 -0
- package/node_modules/utility/dist/esm/crypto.js +146 -0
- package/node_modules/utility/dist/esm/date.d.ts +63 -0
- package/node_modules/utility/dist/esm/date.js +204 -0
- package/node_modules/utility/dist/esm/fs.d.ts +6 -0
- package/node_modules/utility/dist/esm/fs.js +17 -0
- package/node_modules/utility/dist/esm/function.d.ts +12 -0
- package/node_modules/utility/dist/esm/function.js +28 -0
- package/node_modules/utility/dist/esm/index.d.ts +12 -0
- package/node_modules/utility/dist/esm/index.js +13 -0
- package/node_modules/utility/dist/esm/json.d.ts +14 -0
- package/node_modules/utility/dist/esm/json.js +34 -0
- package/node_modules/utility/dist/esm/number.d.ts +24 -0
- package/node_modules/utility/dist/esm/number.js +60 -0
- package/node_modules/utility/dist/esm/object.d.ts +20 -0
- package/node_modules/utility/dist/esm/object.js +67 -0
- package/node_modules/utility/dist/esm/optimize.d.ts +21 -0
- package/node_modules/utility/dist/esm/optimize.js +54 -0
- package/node_modules/utility/dist/esm/package.json +3 -0
- package/node_modules/utility/dist/esm/string.d.ts +29 -0
- package/node_modules/utility/dist/esm/string.js +118 -0
- package/node_modules/utility/dist/esm/timeout.d.ts +6 -0
- package/node_modules/utility/dist/esm/timeout.js +28 -0
- package/node_modules/utility/dist/esm/web.d.ts +29 -0
- package/node_modules/utility/dist/esm/web.js +52 -0
- package/node_modules/utility/dist/package.json +4 -0
- package/node_modules/utility/package.json +85 -0
- package/node_modules/utility/src/array.ts +44 -0
- package/node_modules/utility/src/crypto.ts +160 -0
- package/node_modules/utility/src/date.ts +232 -0
- package/node_modules/utility/src/fs.ts +17 -0
- package/node_modules/utility/src/function.ts +30 -0
- package/node_modules/utility/src/index.ts +12 -0
- package/node_modules/utility/src/json.ts +48 -0
- package/node_modules/utility/src/number.ts +63 -0
- package/node_modules/utility/src/object.ts +72 -0
- package/node_modules/utility/src/optimize.ts +62 -0
- package/node_modules/utility/src/string.ts +132 -0
- package/node_modules/utility/src/timeout.ts +37 -0
- package/node_modules/utility/src/web.ts +53 -0
- package/node_modules/ylru/LICENSE +25 -0
- package/node_modules/ylru/README.md +120 -0
- package/node_modules/ylru/dist/commonjs/index.d.ts +21 -0
- package/node_modules/ylru/dist/commonjs/index.js +112 -0
- package/node_modules/ylru/dist/commonjs/package.json +3 -0
- package/node_modules/ylru/dist/esm/index.d.ts +21 -0
- package/node_modules/ylru/dist/esm/index.js +108 -0
- package/node_modules/ylru/dist/esm/package.json +3 -0
- package/node_modules/ylru/package.json +71 -0
- package/node_modules/ylru/src/index.ts +124 -0
- package/package.json +2 -2
- package/node_modules/@ali/cli-skills/dist/_chunks/libs/abort-controller.mjs +0 -424
- package/node_modules/@ali/cli-skills/dist/_chunks/libs/archiver.mjs +0 -19586
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var Buffer = require("safer-buffer").Buffer;
|
|
3
|
+
|
|
4
|
+
// Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js
|
|
5
|
+
|
|
6
|
+
// == UTF16-BE codec. ==========================================================
|
|
7
|
+
|
|
8
|
+
exports.utf16be = Utf16BECodec;
|
|
9
|
+
function Utf16BECodec() {
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
Utf16BECodec.prototype.encoder = Utf16BEEncoder;
|
|
13
|
+
Utf16BECodec.prototype.decoder = Utf16BEDecoder;
|
|
14
|
+
Utf16BECodec.prototype.bomAware = true;
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
// -- Encoding
|
|
18
|
+
|
|
19
|
+
function Utf16BEEncoder() {
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
Utf16BEEncoder.prototype.write = function(str) {
|
|
23
|
+
var buf = Buffer.from(str, 'ucs2');
|
|
24
|
+
for (var i = 0; i < buf.length; i += 2) {
|
|
25
|
+
var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp;
|
|
26
|
+
}
|
|
27
|
+
return buf;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
Utf16BEEncoder.prototype.end = function() {
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
// -- Decoding
|
|
35
|
+
|
|
36
|
+
function Utf16BEDecoder() {
|
|
37
|
+
this.overflowByte = -1;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
Utf16BEDecoder.prototype.write = function(buf) {
|
|
41
|
+
if (buf.length == 0)
|
|
42
|
+
return '';
|
|
43
|
+
|
|
44
|
+
var buf2 = Buffer.alloc(buf.length + 1),
|
|
45
|
+
i = 0, j = 0;
|
|
46
|
+
|
|
47
|
+
if (this.overflowByte !== -1) {
|
|
48
|
+
buf2[0] = buf[0];
|
|
49
|
+
buf2[1] = this.overflowByte;
|
|
50
|
+
i = 1; j = 2;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
for (; i < buf.length-1; i += 2, j+= 2) {
|
|
54
|
+
buf2[j] = buf[i+1];
|
|
55
|
+
buf2[j+1] = buf[i];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1;
|
|
59
|
+
|
|
60
|
+
return buf2.slice(0, j).toString('ucs2');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
Utf16BEDecoder.prototype.end = function() {
|
|
64
|
+
this.overflowByte = -1;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
// == UTF-16 codec =============================================================
|
|
69
|
+
// Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic.
|
|
70
|
+
// Defaults to UTF-16LE, as it's prevalent and default in Node.
|
|
71
|
+
// http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le
|
|
72
|
+
// Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'});
|
|
73
|
+
|
|
74
|
+
// Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false).
|
|
75
|
+
|
|
76
|
+
exports.utf16 = Utf16Codec;
|
|
77
|
+
function Utf16Codec(codecOptions, iconv) {
|
|
78
|
+
this.iconv = iconv;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
Utf16Codec.prototype.encoder = Utf16Encoder;
|
|
82
|
+
Utf16Codec.prototype.decoder = Utf16Decoder;
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
// -- Encoding (pass-through)
|
|
86
|
+
|
|
87
|
+
function Utf16Encoder(options, codec) {
|
|
88
|
+
options = options || {};
|
|
89
|
+
if (options.addBOM === undefined)
|
|
90
|
+
options.addBOM = true;
|
|
91
|
+
this.encoder = codec.iconv.getEncoder('utf-16le', options);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
Utf16Encoder.prototype.write = function(str) {
|
|
95
|
+
return this.encoder.write(str);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
Utf16Encoder.prototype.end = function() {
|
|
99
|
+
return this.encoder.end();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
// -- Decoding
|
|
104
|
+
|
|
105
|
+
function Utf16Decoder(options, codec) {
|
|
106
|
+
this.decoder = null;
|
|
107
|
+
this.initialBufs = [];
|
|
108
|
+
this.initialBufsLen = 0;
|
|
109
|
+
|
|
110
|
+
this.options = options || {};
|
|
111
|
+
this.iconv = codec.iconv;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
Utf16Decoder.prototype.write = function(buf) {
|
|
115
|
+
if (!this.decoder) {
|
|
116
|
+
// Codec is not chosen yet. Accumulate initial bytes.
|
|
117
|
+
this.initialBufs.push(buf);
|
|
118
|
+
this.initialBufsLen += buf.length;
|
|
119
|
+
|
|
120
|
+
if (this.initialBufsLen < 16) // We need more bytes to use space heuristic (see below)
|
|
121
|
+
return '';
|
|
122
|
+
|
|
123
|
+
// We have enough bytes -> detect endianness.
|
|
124
|
+
var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding);
|
|
125
|
+
this.decoder = this.iconv.getDecoder(encoding, this.options);
|
|
126
|
+
|
|
127
|
+
var resStr = '';
|
|
128
|
+
for (var i = 0; i < this.initialBufs.length; i++)
|
|
129
|
+
resStr += this.decoder.write(this.initialBufs[i]);
|
|
130
|
+
|
|
131
|
+
this.initialBufs.length = this.initialBufsLen = 0;
|
|
132
|
+
return resStr;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return this.decoder.write(buf);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
Utf16Decoder.prototype.end = function() {
|
|
139
|
+
if (!this.decoder) {
|
|
140
|
+
var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding);
|
|
141
|
+
this.decoder = this.iconv.getDecoder(encoding, this.options);
|
|
142
|
+
|
|
143
|
+
var resStr = '';
|
|
144
|
+
for (var i = 0; i < this.initialBufs.length; i++)
|
|
145
|
+
resStr += this.decoder.write(this.initialBufs[i]);
|
|
146
|
+
|
|
147
|
+
var trail = this.decoder.end();
|
|
148
|
+
if (trail)
|
|
149
|
+
resStr += trail;
|
|
150
|
+
|
|
151
|
+
this.initialBufs.length = this.initialBufsLen = 0;
|
|
152
|
+
return resStr;
|
|
153
|
+
}
|
|
154
|
+
return this.decoder.end();
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function detectEncoding(bufs, defaultEncoding) {
|
|
158
|
+
var b = [];
|
|
159
|
+
var charsProcessed = 0;
|
|
160
|
+
var asciiCharsLE = 0, asciiCharsBE = 0; // Number of ASCII chars when decoded as LE or BE.
|
|
161
|
+
|
|
162
|
+
outer_loop:
|
|
163
|
+
for (var i = 0; i < bufs.length; i++) {
|
|
164
|
+
var buf = bufs[i];
|
|
165
|
+
for (var j = 0; j < buf.length; j++) {
|
|
166
|
+
b.push(buf[j]);
|
|
167
|
+
if (b.length === 2) {
|
|
168
|
+
if (charsProcessed === 0) {
|
|
169
|
+
// Check BOM first.
|
|
170
|
+
if (b[0] === 0xFF && b[1] === 0xFE) return 'utf-16le';
|
|
171
|
+
if (b[0] === 0xFE && b[1] === 0xFF) return 'utf-16be';
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (b[0] === 0 && b[1] !== 0) asciiCharsBE++;
|
|
175
|
+
if (b[0] !== 0 && b[1] === 0) asciiCharsLE++;
|
|
176
|
+
|
|
177
|
+
b.length = 0;
|
|
178
|
+
charsProcessed++;
|
|
179
|
+
|
|
180
|
+
if (charsProcessed >= 100) {
|
|
181
|
+
break outer_loop;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Make decisions.
|
|
188
|
+
// Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon.
|
|
189
|
+
// So, we count ASCII as if it was LE or BE, and decide from that.
|
|
190
|
+
if (asciiCharsBE > asciiCharsLE) return 'utf-16be';
|
|
191
|
+
if (asciiCharsBE < asciiCharsLE) return 'utf-16le';
|
|
192
|
+
|
|
193
|
+
// Couldn't decide (likely all zeros or not enough data).
|
|
194
|
+
return defaultEncoding || 'utf-16le';
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var Buffer = require('safer-buffer').Buffer;
|
|
4
|
+
|
|
5
|
+
// == UTF32-LE/BE codec. ==========================================================
|
|
6
|
+
|
|
7
|
+
exports._utf32 = Utf32Codec;
|
|
8
|
+
|
|
9
|
+
function Utf32Codec(codecOptions, iconv) {
|
|
10
|
+
this.iconv = iconv;
|
|
11
|
+
this.bomAware = true;
|
|
12
|
+
this.isLE = codecOptions.isLE;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
exports.utf32le = { type: '_utf32', isLE: true };
|
|
16
|
+
exports.utf32be = { type: '_utf32', isLE: false };
|
|
17
|
+
|
|
18
|
+
// Aliases
|
|
19
|
+
exports.ucs4le = 'utf32le';
|
|
20
|
+
exports.ucs4be = 'utf32be';
|
|
21
|
+
|
|
22
|
+
Utf32Codec.prototype.encoder = Utf32Encoder;
|
|
23
|
+
Utf32Codec.prototype.decoder = Utf32Decoder;
|
|
24
|
+
|
|
25
|
+
// -- Encoding
|
|
26
|
+
|
|
27
|
+
function Utf32Encoder(options, codec) {
|
|
28
|
+
this.isLE = codec.isLE;
|
|
29
|
+
this.highSurrogate = 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
Utf32Encoder.prototype.write = function(str) {
|
|
33
|
+
var src = Buffer.from(str, 'ucs2');
|
|
34
|
+
var dst = Buffer.alloc(src.length * 2);
|
|
35
|
+
var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE;
|
|
36
|
+
var offset = 0;
|
|
37
|
+
|
|
38
|
+
for (var i = 0; i < src.length; i += 2) {
|
|
39
|
+
var code = src.readUInt16LE(i);
|
|
40
|
+
var isHighSurrogate = (0xD800 <= code && code < 0xDC00);
|
|
41
|
+
var isLowSurrogate = (0xDC00 <= code && code < 0xE000);
|
|
42
|
+
|
|
43
|
+
if (this.highSurrogate) {
|
|
44
|
+
if (isHighSurrogate || !isLowSurrogate) {
|
|
45
|
+
// There shouldn't be two high surrogates in a row, nor a high surrogate which isn't followed by a low
|
|
46
|
+
// surrogate. If this happens, keep the pending high surrogate as a stand-alone semi-invalid character
|
|
47
|
+
// (technically wrong, but expected by some applications, like Windows file names).
|
|
48
|
+
write32.call(dst, this.highSurrogate, offset);
|
|
49
|
+
offset += 4;
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
// Create 32-bit value from high and low surrogates;
|
|
53
|
+
var codepoint = (((this.highSurrogate - 0xD800) << 10) | (code - 0xDC00)) + 0x10000;
|
|
54
|
+
|
|
55
|
+
write32.call(dst, codepoint, offset);
|
|
56
|
+
offset += 4;
|
|
57
|
+
this.highSurrogate = 0;
|
|
58
|
+
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (isHighSurrogate)
|
|
64
|
+
this.highSurrogate = code;
|
|
65
|
+
else {
|
|
66
|
+
// Even if the current character is a low surrogate, with no previous high surrogate, we'll
|
|
67
|
+
// encode it as a semi-invalid stand-alone character for the same reasons expressed above for
|
|
68
|
+
// unpaired high surrogates.
|
|
69
|
+
write32.call(dst, code, offset);
|
|
70
|
+
offset += 4;
|
|
71
|
+
this.highSurrogate = 0;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (offset < dst.length)
|
|
76
|
+
dst = dst.slice(0, offset);
|
|
77
|
+
|
|
78
|
+
return dst;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
Utf32Encoder.prototype.end = function() {
|
|
82
|
+
// Treat any leftover high surrogate as a semi-valid independent character.
|
|
83
|
+
if (!this.highSurrogate)
|
|
84
|
+
return;
|
|
85
|
+
|
|
86
|
+
var buf = Buffer.alloc(4);
|
|
87
|
+
|
|
88
|
+
if (this.isLE)
|
|
89
|
+
buf.writeUInt32LE(this.highSurrogate, 0);
|
|
90
|
+
else
|
|
91
|
+
buf.writeUInt32BE(this.highSurrogate, 0);
|
|
92
|
+
|
|
93
|
+
this.highSurrogate = 0;
|
|
94
|
+
|
|
95
|
+
return buf;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
// -- Decoding
|
|
99
|
+
|
|
100
|
+
function Utf32Decoder(options, codec) {
|
|
101
|
+
this.isLE = codec.isLE;
|
|
102
|
+
this.badChar = codec.iconv.defaultCharUnicode.charCodeAt(0);
|
|
103
|
+
this.overflow = [];
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
Utf32Decoder.prototype.write = function(src) {
|
|
107
|
+
if (src.length === 0)
|
|
108
|
+
return '';
|
|
109
|
+
|
|
110
|
+
var i = 0;
|
|
111
|
+
var codepoint = 0;
|
|
112
|
+
var dst = Buffer.alloc(src.length + 4);
|
|
113
|
+
var offset = 0;
|
|
114
|
+
var isLE = this.isLE;
|
|
115
|
+
var overflow = this.overflow;
|
|
116
|
+
var badChar = this.badChar;
|
|
117
|
+
|
|
118
|
+
if (overflow.length > 0) {
|
|
119
|
+
for (; i < src.length && overflow.length < 4; i++)
|
|
120
|
+
overflow.push(src[i]);
|
|
121
|
+
|
|
122
|
+
if (overflow.length === 4) {
|
|
123
|
+
// NOTE: codepoint is a signed int32 and can be negative.
|
|
124
|
+
// NOTE: We copied this block from below to help V8 optimize it (it works with array, not buffer).
|
|
125
|
+
if (isLE) {
|
|
126
|
+
codepoint = overflow[i] | (overflow[i+1] << 8) | (overflow[i+2] << 16) | (overflow[i+3] << 24);
|
|
127
|
+
} else {
|
|
128
|
+
codepoint = overflow[i+3] | (overflow[i+2] << 8) | (overflow[i+1] << 16) | (overflow[i] << 24);
|
|
129
|
+
}
|
|
130
|
+
overflow.length = 0;
|
|
131
|
+
|
|
132
|
+
offset = _writeCodepoint(dst, offset, codepoint, badChar);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Main loop. Should be as optimized as possible.
|
|
137
|
+
for (; i < src.length - 3; i += 4) {
|
|
138
|
+
// NOTE: codepoint is a signed int32 and can be negative.
|
|
139
|
+
if (isLE) {
|
|
140
|
+
codepoint = src[i] | (src[i+1] << 8) | (src[i+2] << 16) | (src[i+3] << 24);
|
|
141
|
+
} else {
|
|
142
|
+
codepoint = src[i+3] | (src[i+2] << 8) | (src[i+1] << 16) | (src[i] << 24);
|
|
143
|
+
}
|
|
144
|
+
offset = _writeCodepoint(dst, offset, codepoint, badChar);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Keep overflowing bytes.
|
|
148
|
+
for (; i < src.length; i++) {
|
|
149
|
+
overflow.push(src[i]);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return dst.slice(0, offset).toString('ucs2');
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
function _writeCodepoint(dst, offset, codepoint, badChar) {
|
|
156
|
+
// NOTE: codepoint is signed int32 and can be negative. We keep it that way to help V8 with optimizations.
|
|
157
|
+
if (codepoint < 0 || codepoint > 0x10FFFF) {
|
|
158
|
+
// Not a valid Unicode codepoint
|
|
159
|
+
codepoint = badChar;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Ephemeral Planes: Write high surrogate.
|
|
163
|
+
if (codepoint >= 0x10000) {
|
|
164
|
+
codepoint -= 0x10000;
|
|
165
|
+
|
|
166
|
+
var high = 0xD800 | (codepoint >> 10);
|
|
167
|
+
dst[offset++] = high & 0xff;
|
|
168
|
+
dst[offset++] = high >> 8;
|
|
169
|
+
|
|
170
|
+
// Low surrogate is written below.
|
|
171
|
+
var codepoint = 0xDC00 | (codepoint & 0x3FF);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Write BMP char or low surrogate.
|
|
175
|
+
dst[offset++] = codepoint & 0xff;
|
|
176
|
+
dst[offset++] = codepoint >> 8;
|
|
177
|
+
|
|
178
|
+
return offset;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
Utf32Decoder.prototype.end = function() {
|
|
182
|
+
this.overflow.length = 0;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
// == UTF-32 Auto codec =============================================================
|
|
186
|
+
// Decoder chooses automatically from UTF-32LE and UTF-32BE using BOM and space-based heuristic.
|
|
187
|
+
// Defaults to UTF-32LE. http://en.wikipedia.org/wiki/UTF-32
|
|
188
|
+
// Encoder/decoder default can be changed: iconv.decode(buf, 'utf32', {defaultEncoding: 'utf-32be'});
|
|
189
|
+
|
|
190
|
+
// Encoder prepends BOM (which can be overridden with (addBOM: false}).
|
|
191
|
+
|
|
192
|
+
exports.utf32 = Utf32AutoCodec;
|
|
193
|
+
exports.ucs4 = 'utf32';
|
|
194
|
+
|
|
195
|
+
function Utf32AutoCodec(options, iconv) {
|
|
196
|
+
this.iconv = iconv;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
Utf32AutoCodec.prototype.encoder = Utf32AutoEncoder;
|
|
200
|
+
Utf32AutoCodec.prototype.decoder = Utf32AutoDecoder;
|
|
201
|
+
|
|
202
|
+
// -- Encoding
|
|
203
|
+
|
|
204
|
+
function Utf32AutoEncoder(options, codec) {
|
|
205
|
+
options = options || {};
|
|
206
|
+
|
|
207
|
+
if (options.addBOM === undefined)
|
|
208
|
+
options.addBOM = true;
|
|
209
|
+
|
|
210
|
+
this.encoder = codec.iconv.getEncoder(options.defaultEncoding || 'utf-32le', options);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
Utf32AutoEncoder.prototype.write = function(str) {
|
|
214
|
+
return this.encoder.write(str);
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
Utf32AutoEncoder.prototype.end = function() {
|
|
218
|
+
return this.encoder.end();
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
// -- Decoding
|
|
222
|
+
|
|
223
|
+
function Utf32AutoDecoder(options, codec) {
|
|
224
|
+
this.decoder = null;
|
|
225
|
+
this.initialBufs = [];
|
|
226
|
+
this.initialBufsLen = 0;
|
|
227
|
+
this.options = options || {};
|
|
228
|
+
this.iconv = codec.iconv;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
Utf32AutoDecoder.prototype.write = function(buf) {
|
|
232
|
+
if (!this.decoder) {
|
|
233
|
+
// Codec is not chosen yet. Accumulate initial bytes.
|
|
234
|
+
this.initialBufs.push(buf);
|
|
235
|
+
this.initialBufsLen += buf.length;
|
|
236
|
+
|
|
237
|
+
if (this.initialBufsLen < 32) // We need more bytes to use space heuristic (see below)
|
|
238
|
+
return '';
|
|
239
|
+
|
|
240
|
+
// We have enough bytes -> detect endianness.
|
|
241
|
+
var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding);
|
|
242
|
+
this.decoder = this.iconv.getDecoder(encoding, this.options);
|
|
243
|
+
|
|
244
|
+
var resStr = '';
|
|
245
|
+
for (var i = 0; i < this.initialBufs.length; i++)
|
|
246
|
+
resStr += this.decoder.write(this.initialBufs[i]);
|
|
247
|
+
|
|
248
|
+
this.initialBufs.length = this.initialBufsLen = 0;
|
|
249
|
+
return resStr;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
return this.decoder.write(buf);
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
Utf32AutoDecoder.prototype.end = function() {
|
|
256
|
+
if (!this.decoder) {
|
|
257
|
+
var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding);
|
|
258
|
+
this.decoder = this.iconv.getDecoder(encoding, this.options);
|
|
259
|
+
|
|
260
|
+
var resStr = '';
|
|
261
|
+
for (var i = 0; i < this.initialBufs.length; i++)
|
|
262
|
+
resStr += this.decoder.write(this.initialBufs[i]);
|
|
263
|
+
|
|
264
|
+
var trail = this.decoder.end();
|
|
265
|
+
if (trail)
|
|
266
|
+
resStr += trail;
|
|
267
|
+
|
|
268
|
+
this.initialBufs.length = this.initialBufsLen = 0;
|
|
269
|
+
return resStr;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
return this.decoder.end();
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
function detectEncoding(bufs, defaultEncoding) {
|
|
276
|
+
var b = [];
|
|
277
|
+
var charsProcessed = 0;
|
|
278
|
+
var invalidLE = 0, invalidBE = 0; // Number of invalid chars when decoded as LE or BE.
|
|
279
|
+
var bmpCharsLE = 0, bmpCharsBE = 0; // Number of BMP chars when decoded as LE or BE.
|
|
280
|
+
|
|
281
|
+
outer_loop:
|
|
282
|
+
for (var i = 0; i < bufs.length; i++) {
|
|
283
|
+
var buf = bufs[i];
|
|
284
|
+
for (var j = 0; j < buf.length; j++) {
|
|
285
|
+
b.push(buf[j]);
|
|
286
|
+
if (b.length === 4) {
|
|
287
|
+
if (charsProcessed === 0) {
|
|
288
|
+
// Check BOM first.
|
|
289
|
+
if (b[0] === 0xFF && b[1] === 0xFE && b[2] === 0 && b[3] === 0) {
|
|
290
|
+
return 'utf-32le';
|
|
291
|
+
}
|
|
292
|
+
if (b[0] === 0 && b[1] === 0 && b[2] === 0xFE && b[3] === 0xFF) {
|
|
293
|
+
return 'utf-32be';
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (b[0] !== 0 || b[1] > 0x10) invalidBE++;
|
|
298
|
+
if (b[3] !== 0 || b[2] > 0x10) invalidLE++;
|
|
299
|
+
|
|
300
|
+
if (b[0] === 0 && b[1] === 0 && (b[2] !== 0 || b[3] !== 0)) bmpCharsBE++;
|
|
301
|
+
if ((b[0] !== 0 || b[1] !== 0) && b[2] === 0 && b[3] === 0) bmpCharsLE++;
|
|
302
|
+
|
|
303
|
+
b.length = 0;
|
|
304
|
+
charsProcessed++;
|
|
305
|
+
|
|
306
|
+
if (charsProcessed >= 100) {
|
|
307
|
+
break outer_loop;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// Make decisions.
|
|
314
|
+
if (bmpCharsBE - invalidBE > bmpCharsLE - invalidLE) return 'utf-32be';
|
|
315
|
+
if (bmpCharsBE - invalidBE < bmpCharsLE - invalidLE) return 'utf-32le';
|
|
316
|
+
|
|
317
|
+
// Couldn't decide (likely all zeros or not enough data).
|
|
318
|
+
return defaultEncoding || 'utf-32le';
|
|
319
|
+
}
|