@corellium/corellium-cli 1.3.8 → 1.5.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/.eslintrc.js +12 -16
- package/.gitlab-ci.yml +13 -13
- package/.nvmrc +1 -1
- package/.nycrc +14 -14
- package/.prettierrc.js +8 -7
- package/README.md +13 -6
- package/docs/OVERVIEW.md +57 -27
- package/index.js +8 -8
- package/lint-staged.config.js +3 -6
- package/node_modules/@babel/cli/README.md +1 -1
- package/node_modules/@babel/cli/bin/babel-external-helpers.mjs +3 -0
- package/node_modules/@babel/cli/bin/babel.mjs +3 -0
- package/node_modules/@babel/cli/lib/babel/dir.js +23 -73
- package/node_modules/@babel/cli/lib/babel/dir.js.map +1 -0
- package/node_modules/@babel/cli/lib/babel/file.js +27 -72
- package/node_modules/@babel/cli/lib/babel/file.js.map +1 -0
- package/node_modules/@babel/cli/lib/babel/index.js +6 -8
- package/node_modules/@babel/cli/lib/babel/index.js.map +1 -0
- package/node_modules/@babel/cli/lib/babel/options.js +70 -143
- package/node_modules/@babel/cli/lib/babel/options.js.map +1 -0
- package/node_modules/@babel/cli/lib/babel/util.js +39 -59
- package/node_modules/@babel/cli/lib/babel/util.js.map +1 -0
- package/node_modules/@babel/cli/lib/babel/watcher.js +19 -52
- package/node_modules/@babel/cli/lib/babel/watcher.js.map +1 -0
- package/node_modules/@babel/cli/lib/babel-external-helpers.js +14 -21
- package/node_modules/@babel/cli/lib/babel-external-helpers.js.map +1 -0
- package/node_modules/@babel/cli/package.json +11 -9
- package/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs +19 -29
- package/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map +1 -1
- package/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js +19 -29
- package/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map +1 -1
- package/node_modules/@jridgewell/resolve-uri/package.json +2 -2
- package/node_modules/@jridgewell/sourcemap-codec/README.md +147 -83
- package/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +351 -91
- package/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +1 -1
- package/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js +354 -90
- package/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map +1 -1
- package/node_modules/@jridgewell/sourcemap-codec/dist/types/scopes.d.ts +49 -0
- package/node_modules/@jridgewell/sourcemap-codec/dist/types/sourcemap-codec.d.ts +2 -0
- package/node_modules/@jridgewell/sourcemap-codec/dist/types/strings.d.ts +15 -0
- package/node_modules/@jridgewell/sourcemap-codec/dist/types/vlq.d.ts +6 -0
- package/node_modules/@jridgewell/sourcemap-codec/package.json +7 -7
- package/node_modules/@jridgewell/trace-mapping/README.md +5 -0
- package/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs +202 -174
- package/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map +1 -1
- package/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js +216 -182
- package/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map +1 -1
- package/node_modules/@jridgewell/trace-mapping/dist/types/any-map.d.ts +1 -1
- package/node_modules/@jridgewell/trace-mapping/dist/types/binary-search.d.ts +1 -1
- package/node_modules/@jridgewell/trace-mapping/dist/types/by-source.d.ts +1 -1
- package/node_modules/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts +8 -8
- package/node_modules/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts +33 -28
- package/node_modules/@jridgewell/trace-mapping/dist/types/types.d.ts +23 -16
- package/node_modules/@jridgewell/trace-mapping/package.json +20 -18
- package/node_modules/anymatch/index.d.ts +1 -0
- package/node_modules/anymatch/index.js +1 -1
- package/node_modules/anymatch/package.json +1 -1
- package/node_modules/{form-data/README.md.bak → axios/node_modules/form-data/Readme.md} +4 -4
- package/node_modules/{superagent → axios}/node_modules/form-data/lib/form_data.js +8 -5
- package/node_modules/{superagent → axios}/node_modules/form-data/package.json +9 -6
- package/node_modules/binary-extensions/binary-extensions.json +3 -0
- package/node_modules/binary-extensions/license +2 -1
- package/node_modules/binary-extensions/package.json +4 -2
- package/node_modules/binary-extensions/readme.md +2 -18
- package/node_modules/braces/LICENSE +1 -1
- package/node_modules/braces/README.md +91 -98
- package/node_modules/braces/index.js +3 -3
- package/node_modules/braces/lib/compile.js +14 -11
- package/node_modules/braces/lib/constants.js +1 -1
- package/node_modules/braces/lib/expand.js +9 -9
- package/node_modules/braces/lib/parse.js +14 -16
- package/node_modules/braces/lib/stringify.js +4 -4
- package/node_modules/braces/lib/utils.js +13 -3
- package/node_modules/braces/package.json +2 -2
- package/node_modules/{call-bind → call-bind-apply-helpers}/.eslintrc +0 -1
- package/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
- package/node_modules/call-bind-apply-helpers/.nycrc +9 -0
- package/node_modules/call-bind-apply-helpers/CHANGELOG.md +23 -0
- package/node_modules/{call-bind → call-bind-apply-helpers}/LICENSE +1 -1
- package/node_modules/call-bind-apply-helpers/README.md +62 -0
- package/node_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
- package/node_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
- package/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
- package/node_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
- package/node_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
- package/node_modules/call-bind-apply-helpers/index.d.ts +46 -0
- package/node_modules/call-bind-apply-helpers/index.js +15 -0
- package/node_modules/call-bind-apply-helpers/package.json +85 -0
- package/node_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
- package/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
- package/node_modules/call-bind-apply-helpers/test/index.js +63 -0
- package/node_modules/call-bind-apply-helpers/tsconfig.json +9 -0
- package/node_modules/call-bound/.eslintrc +13 -0
- package/node_modules/call-bound/.github/FUNDING.yml +12 -0
- package/node_modules/call-bound/.nycrc +9 -0
- package/node_modules/call-bound/CHANGELOG.md +34 -0
- package/node_modules/call-bound/LICENSE +21 -0
- package/node_modules/call-bound/README.md +53 -0
- package/node_modules/call-bound/index.d.ts +13 -0
- package/node_modules/call-bound/index.js +18 -0
- package/node_modules/call-bound/package.json +99 -0
- package/node_modules/{call-bind/test/callBound.js → call-bound/test/index.js} +1 -2
- package/node_modules/call-bound/tsconfig.json +9 -0
- package/node_modules/chokidar/README.md +1 -1
- package/node_modules/chokidar/index.js +1 -1
- package/node_modules/chokidar/lib/constants.js +1 -0
- package/node_modules/chokidar/lib/fsevents-handler.js +2 -0
- package/node_modules/chokidar/package.json +5 -20
- package/node_modules/chokidar/types/index.d.ts +4 -0
- package/node_modules/cliui/CHANGELOG.md +18 -0
- package/node_modules/cliui/build/index.d.cts +43 -0
- package/node_modules/cliui/package.json +6 -6
- package/node_modules/commander/CHANGELOG.md +361 -0
- package/node_modules/{@babel/cli/node_modules/commander → commander}/Readme.md +243 -165
- package/node_modules/commander/index.js +1881 -0
- package/node_modules/{@babel/cli/node_modules/commander → commander}/package.json +19 -9
- package/node_modules/commander/typings/index.d.ts +410 -0
- package/node_modules/component-emitter/LICENSE +24 -24
- package/node_modules/component-emitter/Readme.md +74 -74
- package/node_modules/component-emitter/index.js +175 -175
- package/node_modules/component-emitter/package.json +3 -2
- package/node_modules/convert-source-map/README.md +97 -11
- package/node_modules/convert-source-map/index.js +127 -30
- package/node_modules/convert-source-map/package.json +3 -9
- package/node_modules/cookiejar/cookiejar.js +5 -0
- package/node_modules/cookiejar/package.json +1 -1
- package/node_modules/debug/README.md +1 -1
- package/node_modules/debug/package.json +10 -4
- package/node_modules/debug/src/browser.js +4 -1
- package/node_modules/debug/src/common.js +57 -39
- package/node_modules/debug/src/node.js +2 -2
- package/node_modules/dotenv/CHANGELOG.md +133 -1
- package/node_modules/dotenv/README-es.md +448 -0
- package/node_modules/dotenv/README.md +309 -66
- package/node_modules/dotenv/lib/cli-options.js +1 -1
- package/node_modules/dotenv/lib/env-options.js +4 -0
- package/node_modules/dotenv/lib/main.d.ts +85 -5
- package/node_modules/dotenv/lib/main.js +287 -35
- package/node_modules/dotenv/package.json +19 -14
- package/node_modules/dunder-proto/.eslintrc +5 -0
- package/node_modules/dunder-proto/.github/FUNDING.yml +12 -0
- package/node_modules/dunder-proto/CHANGELOG.md +24 -0
- package/node_modules/dunder-proto/LICENSE +21 -0
- package/node_modules/dunder-proto/README.md +54 -0
- package/node_modules/dunder-proto/get.d.ts +5 -0
- package/node_modules/dunder-proto/get.js +30 -0
- package/node_modules/dunder-proto/package.json +76 -0
- package/node_modules/dunder-proto/set.d.ts +5 -0
- package/node_modules/dunder-proto/set.js +35 -0
- package/node_modules/dunder-proto/test/get.js +34 -0
- package/node_modules/dunder-proto/test/index.js +4 -0
- package/node_modules/dunder-proto/test/set.js +50 -0
- package/node_modules/dunder-proto/tsconfig.json +9 -0
- package/node_modules/es-define-property/.eslintrc +13 -0
- package/node_modules/es-define-property/.github/FUNDING.yml +12 -0
- package/node_modules/es-define-property/.nycrc +9 -0
- package/node_modules/es-define-property/CHANGELOG.md +29 -0
- package/node_modules/es-define-property/LICENSE +21 -0
- package/node_modules/es-define-property/README.md +49 -0
- package/node_modules/es-define-property/index.d.ts +3 -0
- package/node_modules/es-define-property/index.js +14 -0
- package/node_modules/es-define-property/package.json +81 -0
- package/node_modules/es-define-property/test/index.js +56 -0
- package/node_modules/es-define-property/tsconfig.json +10 -0
- package/node_modules/es-errors/.eslintrc +5 -0
- package/node_modules/es-errors/.github/FUNDING.yml +12 -0
- package/node_modules/es-errors/CHANGELOG.md +40 -0
- package/node_modules/es-errors/LICENSE +21 -0
- package/node_modules/es-errors/README.md +55 -0
- package/node_modules/es-errors/eval.d.ts +3 -0
- package/node_modules/es-errors/eval.js +4 -0
- package/node_modules/es-errors/index.d.ts +3 -0
- package/node_modules/es-errors/index.js +4 -0
- package/node_modules/es-errors/package.json +80 -0
- package/node_modules/es-errors/range.d.ts +3 -0
- package/node_modules/es-errors/range.js +4 -0
- package/node_modules/es-errors/ref.d.ts +3 -0
- package/node_modules/es-errors/ref.js +4 -0
- package/node_modules/es-errors/syntax.d.ts +3 -0
- package/node_modules/es-errors/syntax.js +4 -0
- package/node_modules/es-errors/test/index.js +19 -0
- package/node_modules/es-errors/tsconfig.json +49 -0
- package/node_modules/es-errors/type.d.ts +3 -0
- package/node_modules/es-errors/type.js +4 -0
- package/node_modules/es-errors/uri.d.ts +3 -0
- package/node_modules/es-errors/uri.js +4 -0
- package/node_modules/es-object-atoms/.eslintrc +16 -0
- package/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
- package/node_modules/es-object-atoms/CHANGELOG.md +37 -0
- package/node_modules/es-object-atoms/LICENSE +21 -0
- package/node_modules/es-object-atoms/README.md +63 -0
- package/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
- package/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
- package/node_modules/es-object-atoms/ToObject.d.ts +7 -0
- package/node_modules/es-object-atoms/ToObject.js +10 -0
- package/node_modules/es-object-atoms/index.d.ts +3 -0
- package/node_modules/es-object-atoms/index.js +4 -0
- package/node_modules/es-object-atoms/isObject.d.ts +3 -0
- package/node_modules/es-object-atoms/isObject.js +6 -0
- package/node_modules/es-object-atoms/package.json +80 -0
- package/node_modules/es-object-atoms/test/index.js +38 -0
- package/node_modules/es-object-atoms/tsconfig.json +6 -0
- package/node_modules/escalade/index.d.mts +11 -0
- package/node_modules/escalade/index.d.ts +14 -2
- package/node_modules/escalade/package.json +18 -5
- package/node_modules/escalade/readme.md +1 -1
- package/node_modules/escalade/sync/index.d.mts +9 -0
- package/node_modules/escalade/sync/index.d.ts +13 -2
- package/node_modules/fill-range/index.js +4 -5
- package/node_modules/fill-range/package.json +8 -3
- package/node_modules/follow-redirects/index.js +186 -98
- package/node_modules/follow-redirects/package.json +3 -4
- package/node_modules/form-data/Readme.md +5 -7
- package/node_modules/form-data/lib/form_data.js +5 -8
- package/node_modules/form-data/package.json +9 -6
- package/node_modules/function-bind/.eslintrc +11 -5
- package/node_modules/function-bind/.github/FUNDING.yml +12 -0
- package/node_modules/function-bind/.github/SECURITY.md +3 -0
- package/node_modules/function-bind/.nycrc +13 -0
- package/node_modules/function-bind/CHANGELOG.md +136 -0
- package/node_modules/function-bind/README.md +25 -27
- package/node_modules/function-bind/implementation.js +44 -12
- package/node_modules/function-bind/package.json +38 -14
- package/node_modules/get-intrinsic/.eslintrc +1 -0
- package/node_modules/get-intrinsic/CHANGELOG.md +87 -0
- package/node_modules/get-intrinsic/index.js +75 -32
- package/node_modules/get-intrinsic/package.json +31 -22
- package/node_modules/get-intrinsic/test/GetIntrinsic.js +3 -3
- package/node_modules/get-proto/.eslintrc +10 -0
- package/node_modules/{call-bind → get-proto}/.github/FUNDING.yml +1 -1
- package/node_modules/get-proto/.nycrc +9 -0
- package/node_modules/get-proto/CHANGELOG.md +21 -0
- package/node_modules/get-proto/LICENSE +21 -0
- package/node_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
- package/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
- package/node_modules/get-proto/README.md +50 -0
- package/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
- package/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
- package/node_modules/get-proto/index.d.ts +5 -0
- package/node_modules/get-proto/index.js +27 -0
- package/node_modules/get-proto/package.json +81 -0
- package/node_modules/get-proto/test/index.js +68 -0
- package/node_modules/get-proto/tsconfig.json +9 -0
- package/node_modules/gopd/.eslintrc +16 -0
- package/node_modules/gopd/.github/FUNDING.yml +12 -0
- package/node_modules/gopd/CHANGELOG.md +45 -0
- package/node_modules/gopd/LICENSE +21 -0
- package/node_modules/gopd/README.md +40 -0
- package/node_modules/gopd/gOPD.d.ts +1 -0
- package/node_modules/gopd/gOPD.js +4 -0
- package/node_modules/gopd/index.d.ts +5 -0
- package/node_modules/gopd/index.js +15 -0
- package/node_modules/gopd/package.json +77 -0
- package/node_modules/gopd/test/index.js +36 -0
- package/node_modules/gopd/tsconfig.json +9 -0
- package/node_modules/has-symbols/CHANGELOG.md +16 -0
- package/node_modules/has-symbols/index.d.ts +3 -0
- package/node_modules/has-symbols/index.js +1 -0
- package/node_modules/has-symbols/package.json +19 -9
- package/node_modules/has-symbols/shams.d.ts +3 -0
- package/node_modules/has-symbols/shams.js +5 -2
- package/node_modules/has-symbols/test/shams/core-js.js +1 -0
- package/node_modules/has-symbols/test/shams/get-own-property-symbols.js +1 -0
- package/node_modules/has-symbols/test/tests.js +4 -2
- package/node_modules/has-symbols/tsconfig.json +10 -0
- package/node_modules/hasown/.eslintrc +5 -0
- package/node_modules/hasown/.github/FUNDING.yml +12 -0
- package/node_modules/hasown/.nycrc +13 -0
- package/node_modules/hasown/CHANGELOG.md +40 -0
- package/node_modules/hasown/LICENSE +21 -0
- package/node_modules/hasown/README.md +40 -0
- package/node_modules/hasown/index.d.ts +3 -0
- package/node_modules/hasown/index.js +8 -0
- package/node_modules/hasown/package.json +92 -0
- package/node_modules/hasown/tsconfig.json +6 -0
- package/node_modules/make-dir/node_modules/semver/package.json +38 -0
- package/node_modules/{@babel/cli → make-dir}/node_modules/semver/semver.js +68 -26
- package/node_modules/math-intrinsics/.eslintrc +16 -0
- package/node_modules/math-intrinsics/.github/FUNDING.yml +12 -0
- package/node_modules/math-intrinsics/CHANGELOG.md +24 -0
- package/node_modules/math-intrinsics/LICENSE +21 -0
- package/node_modules/math-intrinsics/README.md +50 -0
- package/node_modules/math-intrinsics/abs.d.ts +1 -0
- package/node_modules/math-intrinsics/abs.js +4 -0
- package/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
- package/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
- package/node_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxValue.js +5 -0
- package/node_modules/math-intrinsics/floor.d.ts +1 -0
- package/node_modules/math-intrinsics/floor.js +4 -0
- package/node_modules/math-intrinsics/isFinite.d.ts +3 -0
- package/node_modules/math-intrinsics/isFinite.js +12 -0
- package/node_modules/math-intrinsics/isInteger.d.ts +3 -0
- package/node_modules/math-intrinsics/isInteger.js +16 -0
- package/node_modules/math-intrinsics/isNaN.d.ts +1 -0
- package/node_modules/math-intrinsics/isNaN.js +6 -0
- package/node_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
- package/node_modules/math-intrinsics/isNegativeZero.js +6 -0
- package/node_modules/math-intrinsics/max.d.ts +1 -0
- package/node_modules/math-intrinsics/max.js +4 -0
- package/node_modules/math-intrinsics/min.d.ts +1 -0
- package/node_modules/math-intrinsics/min.js +4 -0
- package/node_modules/math-intrinsics/mod.d.ts +3 -0
- package/node_modules/math-intrinsics/mod.js +9 -0
- package/node_modules/math-intrinsics/package.json +86 -0
- package/node_modules/math-intrinsics/pow.d.ts +1 -0
- package/node_modules/math-intrinsics/pow.js +4 -0
- package/node_modules/math-intrinsics/round.d.ts +1 -0
- package/node_modules/math-intrinsics/round.js +4 -0
- package/node_modules/math-intrinsics/sign.d.ts +3 -0
- package/node_modules/math-intrinsics/sign.js +11 -0
- package/node_modules/math-intrinsics/test/index.js +192 -0
- package/node_modules/math-intrinsics/tsconfig.json +3 -0
- package/node_modules/ms/index.js +1 -1
- package/node_modules/ms/license.md +1 -1
- package/node_modules/ms/package.json +5 -4
- package/node_modules/ms/readme.md +1 -2
- package/node_modules/object-inspect/CHANGELOG.md +56 -0
- package/node_modules/object-inspect/index.js +38 -9
- package/node_modules/object-inspect/package.json +23 -13
- package/node_modules/object-inspect/readme.markdown +9 -11
- package/node_modules/object-inspect/test/global.js +17 -0
- package/node_modules/object-inspect/test/quoteStyle.js +9 -0
- package/node_modules/qs/.editorconfig +3 -0
- package/node_modules/qs/.eslintrc +3 -2
- package/node_modules/qs/CHANGELOG.md +81 -5
- package/node_modules/qs/README.md +158 -50
- package/node_modules/qs/dist/qs.js +90 -2003
- package/node_modules/qs/lib/parse.js +89 -24
- package/node_modules/qs/lib/stringify.js +61 -31
- package/node_modules/qs/lib/utils.js +54 -38
- package/node_modules/qs/package.json +29 -13
- package/node_modules/qs/test/empty-keys-cases.js +267 -0
- package/node_modules/qs/test/parse.js +468 -47
- package/node_modules/qs/test/stringify.js +454 -57
- package/node_modules/qs/test/utils.js +126 -0
- package/node_modules/side-channel/.editorconfig +9 -0
- package/node_modules/side-channel/.eslintrc +2 -1
- package/node_modules/side-channel/CHANGELOG.md +45 -0
- package/node_modules/side-channel/README.md +60 -1
- package/node_modules/side-channel/index.d.ts +14 -0
- package/node_modules/side-channel/index.js +21 -102
- package/node_modules/side-channel/package.json +40 -22
- package/node_modules/side-channel/test/index.js +78 -52
- package/node_modules/side-channel/tsconfig.json +9 -0
- package/node_modules/{function-bind → side-channel-list}/.editorconfig +3 -14
- package/node_modules/side-channel-list/.eslintrc +11 -0
- package/node_modules/side-channel-list/.github/FUNDING.yml +12 -0
- package/node_modules/side-channel-list/.nycrc +13 -0
- package/node_modules/side-channel-list/CHANGELOG.md +15 -0
- package/node_modules/side-channel-list/LICENSE +21 -0
- package/node_modules/side-channel-list/README.md +62 -0
- package/node_modules/side-channel-list/index.d.ts +13 -0
- package/node_modules/side-channel-list/index.js +113 -0
- package/node_modules/side-channel-list/list.d.ts +14 -0
- package/node_modules/side-channel-list/package.json +77 -0
- package/node_modules/side-channel-list/test/index.js +104 -0
- package/node_modules/side-channel-list/tsconfig.json +9 -0
- package/node_modules/side-channel-map/.editorconfig +9 -0
- package/node_modules/side-channel-map/.eslintrc +11 -0
- package/node_modules/side-channel-map/.github/FUNDING.yml +12 -0
- package/node_modules/side-channel-map/.nycrc +13 -0
- package/node_modules/side-channel-map/CHANGELOG.md +22 -0
- package/node_modules/side-channel-map/LICENSE +21 -0
- package/node_modules/side-channel-map/README.md +62 -0
- package/node_modules/side-channel-map/index.d.ts +15 -0
- package/node_modules/side-channel-map/index.js +68 -0
- package/node_modules/side-channel-map/package.json +80 -0
- package/node_modules/side-channel-map/test/index.js +114 -0
- package/node_modules/side-channel-map/tsconfig.json +9 -0
- package/node_modules/side-channel-weakmap/.editorconfig +9 -0
- package/node_modules/side-channel-weakmap/.eslintrc +12 -0
- package/node_modules/side-channel-weakmap/.github/FUNDING.yml +12 -0
- package/node_modules/side-channel-weakmap/.nycrc +13 -0
- package/node_modules/side-channel-weakmap/CHANGELOG.md +28 -0
- package/node_modules/side-channel-weakmap/LICENSE +21 -0
- package/node_modules/side-channel-weakmap/README.md +62 -0
- package/node_modules/side-channel-weakmap/index.d.ts +15 -0
- package/node_modules/side-channel-weakmap/index.js +84 -0
- package/node_modules/side-channel-weakmap/package.json +87 -0
- package/node_modules/side-channel-weakmap/test/index.js +114 -0
- package/node_modules/side-channel-weakmap/tsconfig.json +9 -0
- package/node_modules/superagent/node_modules/readable-stream/README.md +1 -1
- package/node_modules/superagent/node_modules/readable-stream/lib/_stream_duplex.js +12 -25
- package/node_modules/superagent/node_modules/readable-stream/lib/_stream_passthrough.js +2 -4
- package/node_modules/superagent/node_modules/readable-stream/lib/_stream_readable.js +176 -273
- package/node_modules/superagent/node_modules/readable-stream/lib/_stream_transform.js +26 -37
- package/node_modules/superagent/node_modules/readable-stream/lib/_stream_writable.js +118 -174
- package/node_modules/superagent/node_modules/readable-stream/lib/internal/streams/async_iterator.js +10 -37
- package/node_modules/superagent/node_modules/readable-stream/lib/internal/streams/buffer_list.js +20 -47
- package/node_modules/superagent/node_modules/readable-stream/lib/internal/streams/destroy.js +8 -17
- package/node_modules/superagent/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +1 -19
- package/node_modules/superagent/node_modules/readable-stream/lib/internal/streams/from.js +12 -24
- package/node_modules/superagent/node_modules/readable-stream/lib/internal/streams/pipeline.js +5 -16
- package/node_modules/superagent/node_modules/readable-stream/lib/internal/streams/state.js +2 -7
- package/node_modules/superagent/node_modules/readable-stream/package.json +1 -1
- package/node_modules/{semver → superagent/node_modules/semver}/README.md +132 -36
- package/node_modules/{semver → superagent/node_modules/semver}/bin/semver.js +22 -16
- package/node_modules/{semver → superagent/node_modules/semver}/classes/comparator.js +39 -34
- package/node_modules/{semver → superagent/node_modules/semver}/classes/range.js +72 -37
- package/node_modules/{semver → superagent/node_modules/semver}/classes/semver.js +49 -19
- package/node_modules/{semver → superagent/node_modules/semver}/functions/coerce.js +14 -6
- package/node_modules/superagent/node_modules/semver/functions/diff.js +58 -0
- package/node_modules/{semver → superagent/node_modules/semver}/functions/inc.js +3 -2
- package/node_modules/superagent/node_modules/semver/functions/parse.js +16 -0
- package/node_modules/superagent/node_modules/semver/index.js +89 -0
- package/node_modules/{semver → superagent/node_modules/semver}/internal/constants.js +20 -2
- package/node_modules/superagent/node_modules/semver/internal/lrucache.js +40 -0
- package/node_modules/superagent/node_modules/semver/internal/parse-options.js +15 -0
- package/node_modules/{semver → superagent/node_modules/semver}/internal/re.js +41 -6
- package/node_modules/{semver → superagent/node_modules/semver}/package.json +29 -26
- package/node_modules/{semver → superagent/node_modules/semver}/ranges/intersects.js +1 -1
- package/node_modules/{semver → superagent/node_modules/semver}/ranges/subset.js +6 -3
- package/node_modules/yargs/browser.d.ts +5 -0
- package/node_modules/yargs/build/index.cjs +1 -1
- package/node_modules/yargs/build/lib/command.js +2 -0
- package/node_modules/yargs/build/lib/completion.js +19 -12
- package/node_modules/yargs/build/lib/usage.js +9 -4
- package/node_modules/yargs/build/lib/yargs-factory.js +18 -3
- package/node_modules/yargs/locales/cs.json +51 -0
- package/node_modules/yargs/locales/en.json +4 -0
- package/node_modules/yargs/locales/fi.json +1 -1
- package/node_modules/yargs/package.json +4 -4
- package/node_modules/yargs-parser/CHANGELOG.md +21 -0
- package/node_modules/yargs-parser/build/index.cjs +6 -4
- package/node_modules/yargs-parser/build/lib/index.js +4 -2
- package/node_modules/yargs-parser/build/lib/yargs-parser.js +2 -2
- package/node_modules/yargs-parser/package.json +10 -6
- package/output/e3e8277b426d4bc636a8ed30e66dd056e6cc9691-corellium-cli-build.tar.gz +0 -0
- package/package.json +1 -1
- package/renovate.json +11 -58
- package/src/clients/Agent.js +40 -37
- package/src/clients/Client.js +42 -40
- package/src/clients/Instance.js +24 -24
- package/src/clients/Webplayer.js +23 -24
- package/src/commands/extensions/delete.js +26 -26
- package/src/commands/extensions/index.js +6 -11
- package/src/commands/extensions/list.js +25 -25
- package/src/commands/extensions/load.js +51 -50
- package/src/commands/extensions/validate.js +33 -38
- package/src/commands/firmware/index.js +6 -9
- package/src/commands/firmware/list.js +49 -38
- package/src/commands/firmware/load.js +45 -42
- package/src/commands/images/create.js +30 -29
- package/src/commands/images/delete.js +21 -21
- package/src/commands/images/index.js +6 -10
- package/src/commands/images/list.js +21 -20
- package/src/commands/index.js +2 -2
- package/src/commands/instances/apps/index.js +26 -23
- package/src/commands/instances/apps/install.js +14 -14
- package/src/commands/instances/apps/open.js +17 -17
- package/src/commands/instances/create.js +65 -26
- package/src/commands/instances/delete.js +24 -25
- package/src/commands/instances/file.js +36 -32
- package/src/commands/instances/get.js +23 -16
- package/src/commands/instances/index.js +8 -8
- package/src/commands/instances/input.js +16 -17
- package/src/commands/instances/list.js +38 -28
- package/src/commands/instances/netmon/disable.js +17 -15
- package/src/commands/instances/netmon/download.js +18 -16
- package/src/commands/instances/netmon/enable.js +30 -23
- package/src/commands/instances/netmon/index.js +6 -11
- package/src/commands/instances/netmon/stream.js +18 -16
- package/src/commands/instances/ready.js +30 -27
- package/src/commands/instances/restoreBackup.js +39 -36
- package/src/commands/instances/rotate.js +20 -21
- package/src/commands/instances/start.js +23 -24
- package/src/commands/instances/stop.js +20 -21
- package/src/commands/instances/unlock.js +17 -19
- package/src/commands/instances/upgrade.js +38 -34
- package/src/commands/login.js +67 -67
- package/src/commands/logout.js +10 -12
- package/src/commands/mast/constants.js +2 -2
- package/src/commands/mast/create-assessment.js +16 -16
- package/src/commands/mast/delete-assessment.js +15 -15
- package/src/commands/mast/download-report.js +18 -15
- package/src/commands/mast/get-assessment.js +14 -14
- package/src/commands/mast/get-assessments.js +13 -13
- package/src/commands/mast/index.js +7 -7
- package/src/commands/mast/start-monitor.js +15 -15
- package/src/commands/mast/stop-monitor.js +15 -15
- package/src/commands/mast/test.js +19 -16
- package/src/commands/projects/create.js +33 -32
- package/src/commands/projects/delete.js +26 -26
- package/src/commands/projects/index.js +6 -10
- package/src/commands/projects/list.js +21 -19
- package/src/commands/projects/vpnConfig.js +43 -0
- package/src/commands/webplayer/create.js +57 -50
- package/src/commands/webplayer/destroy.js +31 -28
- package/src/commands/webplayer/index.js +6 -11
- package/src/commands/webplayer/list.js +41 -42
- package/src/commands/webplayer/login.js +31 -28
- package/src/corellium-api.js +11 -11
- package/src/error.js +20 -18
- package/src/logging.js +15 -15
- package/src/profile.js +22 -22
- package/src/progress.js +6 -6
- package/src/resumable.js +606 -664
- package/src/table.js +20 -22
- package/src/upload.js +38 -38
- package/src/utils.js +63 -64
- package/test/test.js +53 -38
- package/coverage/cobertura-coverage.xml +0 -9
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -101
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov.info +0 -0
- package/node_modules/@babel/cli/node_modules/commander/CHANGELOG.md +0 -436
- package/node_modules/@babel/cli/node_modules/commander/index.js +0 -1649
- package/node_modules/@babel/cli/node_modules/commander/typings/index.d.ts +0 -311
- package/node_modules/@babel/cli/node_modules/semver/CHANGELOG.md +0 -39
- package/node_modules/@babel/cli/node_modules/semver/package.json +0 -28
- package/node_modules/@jridgewell/sourcemap-codec/src/sourcemap-codec.ts +0 -198
- package/node_modules/braces/CHANGELOG.md +0 -184
- package/node_modules/call-bind/.eslintignore +0 -1
- package/node_modules/call-bind/CHANGELOG.md +0 -42
- package/node_modules/call-bind/README.md +0 -2
- package/node_modules/call-bind/callBound.js +0 -15
- package/node_modules/call-bind/index.js +0 -47
- package/node_modules/call-bind/package.json +0 -80
- package/node_modules/call-bind/test/index.js +0 -66
- package/node_modules/component-emitter/History.md +0 -75
- package/node_modules/function-bind/.jscs.json +0 -176
- package/node_modules/function-bind/.npmignore +0 -22
- package/node_modules/function-bind/.travis.yml +0 -168
- package/node_modules/has/LICENSE-MIT +0 -22
- package/node_modules/has/README.md +0 -18
- package/node_modules/has/package.json +0 -48
- package/node_modules/has/src/index.js +0 -5
- package/node_modules/has/test/index.js +0 -10
- package/node_modules/lru-cache/README.md +0 -166
- package/node_modules/lru-cache/index.js +0 -334
- package/node_modules/lru-cache/package.json +0 -34
- package/node_modules/semver/LICENSE +0 -15
- package/node_modules/semver/functions/diff.js +0 -23
- package/node_modules/semver/functions/parse.js +0 -33
- package/node_modules/semver/index.js +0 -48
- package/node_modules/semver/internal/parse-options.js +0 -11
- package/node_modules/side-channel/.eslintignore +0 -1
- package/node_modules/superagent/node_modules/form-data/README.md.bak +0 -356
- package/node_modules/superagent/node_modules/form-data/Readme.md +0 -356
- package/node_modules/yallist/LICENSE +0 -15
- package/node_modules/yallist/README.md +0 -204
- package/node_modules/yallist/iterator.js +0 -8
- package/node_modules/yallist/package.json +0 -29
- package/node_modules/yallist/yallist.js +0 -426
- /package/node_modules/{superagent → axios}/node_modules/form-data/License +0 -0
- /package/node_modules/{superagent → axios}/node_modules/form-data/index.d.ts +0 -0
- /package/node_modules/{superagent → axios}/node_modules/form-data/lib/browser.js +0 -0
- /package/node_modules/{superagent → axios}/node_modules/form-data/lib/populate.js +0 -0
- /package/node_modules/{@babel/cli/node_modules/commander → commander}/LICENSE +0 -0
- /package/node_modules/{call-bind → dunder-proto}/.nycrc +0 -0
- /package/node_modules/{@babel/cli/node_modules/make-dir → make-dir}/index.d.ts +0 -0
- /package/node_modules/{@babel/cli/node_modules/make-dir → make-dir}/index.js +0 -0
- /package/node_modules/{@babel/cli/node_modules/make-dir → make-dir}/license +0 -0
- /package/node_modules/{@babel/cli → make-dir}/node_modules/semver/LICENSE +0 -0
- /package/node_modules/{@babel/cli → make-dir}/node_modules/semver/README.md +0 -0
- /package/node_modules/{@babel/cli → make-dir}/node_modules/semver/bin/semver +0 -0
- /package/node_modules/{@babel/cli → make-dir}/node_modules/semver/range.bnf +0 -0
- /package/node_modules/{@babel/cli/node_modules/make-dir → make-dir}/package.json +0 -0
- /package/node_modules/{@babel/cli/node_modules/make-dir → make-dir}/readme.md +0 -0
- /package/node_modules/{@babel/cli/node_modules/pify → pify}/index.js +0 -0
- /package/node_modules/{@babel/cli/node_modules/pify → pify}/license +0 -0
- /package/node_modules/{@babel/cli/node_modules/pify → pify}/package.json +0 -0
- /package/node_modules/{@babel/cli/node_modules/pify → pify}/readme.md +0 -0
- /package/node_modules/{@babel/cli/node_modules/slash → slash}/index.js +0 -0
- /package/node_modules/{@babel/cli/node_modules/slash → slash}/license +0 -0
- /package/node_modules/{@babel/cli/node_modules/slash → slash}/package.json +0 -0
- /package/node_modules/{@babel/cli/node_modules/slash → slash}/readme.md +0 -0
- /package/node_modules/{lru-cache → superagent/node_modules/semver}/LICENSE +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/classes/index.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/functions/clean.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/functions/cmp.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/functions/compare-build.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/functions/compare-loose.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/functions/compare.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/functions/eq.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/functions/gt.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/functions/gte.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/functions/lt.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/functions/lte.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/functions/major.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/functions/minor.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/functions/neq.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/functions/patch.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/functions/prerelease.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/functions/rcompare.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/functions/rsort.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/functions/satisfies.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/functions/sort.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/functions/valid.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/internal/debug.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/internal/identifiers.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/preload.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/range.bnf +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/ranges/gtr.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/ranges/ltr.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/ranges/max-satisfying.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/ranges/min-satisfying.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/ranges/min-version.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/ranges/outside.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/ranges/simplify.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/ranges/to-comparators.js +0 -0
- /package/node_modules/{semver → superagent/node_modules/semver}/ranges/valid.js +0 -0
@@ -18,49 +18,40 @@
|
|
18
18
|
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
19
19
|
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
20
20
|
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
21
22
|
'use strict';
|
22
23
|
|
23
24
|
module.exports = Readable;
|
24
|
-
/*<replacement>*/
|
25
25
|
|
26
|
+
/*<replacement>*/
|
26
27
|
var Duplex;
|
27
28
|
/*</replacement>*/
|
28
29
|
|
29
30
|
Readable.ReadableState = ReadableState;
|
30
|
-
/*<replacement>*/
|
31
31
|
|
32
|
+
/*<replacement>*/
|
32
33
|
var EE = require('events').EventEmitter;
|
33
|
-
|
34
34
|
var EElistenerCount = function EElistenerCount(emitter, type) {
|
35
35
|
return emitter.listeners(type).length;
|
36
36
|
};
|
37
37
|
/*</replacement>*/
|
38
38
|
|
39
39
|
/*<replacement>*/
|
40
|
-
|
41
|
-
|
42
40
|
var Stream = require('./internal/streams/stream');
|
43
41
|
/*</replacement>*/
|
44
42
|
|
45
|
-
|
46
43
|
var Buffer = require('buffer').Buffer;
|
47
|
-
|
48
|
-
var OurUint8Array = global.Uint8Array || function () {};
|
49
|
-
|
44
|
+
var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {};
|
50
45
|
function _uint8ArrayToBuffer(chunk) {
|
51
46
|
return Buffer.from(chunk);
|
52
47
|
}
|
53
|
-
|
54
48
|
function _isUint8Array(obj) {
|
55
49
|
return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
|
56
50
|
}
|
57
|
-
/*<replacement>*/
|
58
|
-
|
59
51
|
|
52
|
+
/*<replacement>*/
|
60
53
|
var debugUtil = require('util');
|
61
|
-
|
62
54
|
var debug;
|
63
|
-
|
64
55
|
if (debugUtil && debugUtil.debuglog) {
|
65
56
|
debug = debugUtil.debuglog('stream');
|
66
57
|
} else {
|
@@ -68,60 +59,57 @@ if (debugUtil && debugUtil.debuglog) {
|
|
68
59
|
}
|
69
60
|
/*</replacement>*/
|
70
61
|
|
71
|
-
|
72
62
|
var BufferList = require('./internal/streams/buffer_list');
|
73
|
-
|
74
63
|
var destroyImpl = require('./internal/streams/destroy');
|
75
|
-
|
76
64
|
var _require = require('./internal/streams/state'),
|
77
|
-
|
78
|
-
|
65
|
+
getHighWaterMark = _require.getHighWaterMark;
|
79
66
|
var _require$codes = require('../errors').codes,
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
67
|
+
ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
|
68
|
+
ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF,
|
69
|
+
ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
|
70
|
+
ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;
|
85
71
|
|
72
|
+
// Lazy loaded to improve the startup performance.
|
86
73
|
var StringDecoder;
|
87
74
|
var createReadableStreamAsyncIterator;
|
88
75
|
var from;
|
89
|
-
|
90
76
|
require('inherits')(Readable, Stream);
|
91
|
-
|
92
77
|
var errorOrDestroy = destroyImpl.errorOrDestroy;
|
93
78
|
var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
|
94
|
-
|
95
79
|
function prependListener(emitter, event, fn) {
|
96
80
|
// Sadly this is not cacheable as some libraries bundle their own
|
97
81
|
// event emitter implementation with them.
|
98
|
-
if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
|
82
|
+
if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
|
83
|
+
|
84
|
+
// This is a hack to make sure that our error handler is attached before any
|
99
85
|
// userland ones. NEVER DO THIS. This is here only because this code needs
|
100
86
|
// to continue to work with older versions of Node.js that do not include
|
101
87
|
// the prependListener() method. The goal is to eventually remove this hack.
|
102
|
-
|
103
88
|
if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
|
104
89
|
}
|
105
|
-
|
106
90
|
function ReadableState(options, stream, isDuplex) {
|
107
91
|
Duplex = Duplex || require('./_stream_duplex');
|
108
|
-
options = options || {};
|
92
|
+
options = options || {};
|
93
|
+
|
94
|
+
// Duplex streams are both readable and writable, but share
|
109
95
|
// the same options object.
|
110
96
|
// However, some cases require setting options to different
|
111
97
|
// values for the readable and the writable sides of the duplex stream.
|
112
98
|
// These options can be provided separately as readableXXX and writableXXX.
|
99
|
+
if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex;
|
113
100
|
|
114
|
-
|
101
|
+
// object stream flag. Used to make read(n) ignore n and to
|
115
102
|
// make all the buffer merging and length checks go away
|
116
|
-
|
117
103
|
this.objectMode = !!options.objectMode;
|
118
|
-
if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
|
104
|
+
if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
|
105
|
+
|
106
|
+
// the point at which it stops calling _read() to fill the buffer
|
119
107
|
// Note: 0 is a valid value, means "don't call _read preemptively ever"
|
108
|
+
this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex);
|
120
109
|
|
121
|
-
|
110
|
+
// A linked list is used to store data chunks instead of an array because the
|
122
111
|
// linked list can remove elements from the beginning faster than
|
123
112
|
// array.shift()
|
124
|
-
|
125
113
|
this.buffer = new BufferList();
|
126
114
|
this.length = 0;
|
127
115
|
this.pipes = null;
|
@@ -129,61 +117,66 @@ function ReadableState(options, stream, isDuplex) {
|
|
129
117
|
this.flowing = null;
|
130
118
|
this.ended = false;
|
131
119
|
this.endEmitted = false;
|
132
|
-
this.reading = false;
|
120
|
+
this.reading = false;
|
121
|
+
|
122
|
+
// a flag to be able to tell if the event 'readable'/'data' is emitted
|
133
123
|
// immediately, or on a later tick. We set this to true at first, because
|
134
124
|
// any actions that shouldn't happen until "later" should generally also
|
135
125
|
// not happen before the first read call.
|
126
|
+
this.sync = true;
|
136
127
|
|
137
|
-
|
128
|
+
// whenever we return null, then we set a flag to say
|
138
129
|
// that we're awaiting a 'readable' event emission.
|
139
|
-
|
140
130
|
this.needReadable = false;
|
141
131
|
this.emittedReadable = false;
|
142
132
|
this.readableListening = false;
|
143
133
|
this.resumeScheduled = false;
|
144
|
-
this.paused = true;
|
134
|
+
this.paused = true;
|
145
135
|
|
146
|
-
|
136
|
+
// Should close be emitted on destroy. Defaults to true.
|
137
|
+
this.emitClose = options.emitClose !== false;
|
147
138
|
|
148
|
-
|
139
|
+
// Should .destroy() be called after 'end' (and potentially 'finish')
|
140
|
+
this.autoDestroy = !!options.autoDestroy;
|
149
141
|
|
150
|
-
|
142
|
+
// has it been destroyed
|
143
|
+
this.destroyed = false;
|
144
|
+
|
145
|
+
// Crypto is kind of old and crusty. Historically, its default string
|
151
146
|
// encoding is 'binary' so we have to make this configurable.
|
152
147
|
// Everything else in the universe uses 'utf8', though.
|
148
|
+
this.defaultEncoding = options.defaultEncoding || 'utf8';
|
153
149
|
|
154
|
-
|
155
|
-
|
156
|
-
this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled
|
150
|
+
// the number of writers that are awaiting a drain event in .pipe()s
|
151
|
+
this.awaitDrain = 0;
|
157
152
|
|
153
|
+
// if true, a maybeReadMore has been scheduled
|
158
154
|
this.readingMore = false;
|
159
155
|
this.decoder = null;
|
160
156
|
this.encoding = null;
|
161
|
-
|
162
157
|
if (options.encoding) {
|
163
158
|
if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
|
164
159
|
this.decoder = new StringDecoder(options.encoding);
|
165
160
|
this.encoding = options.encoding;
|
166
161
|
}
|
167
162
|
}
|
168
|
-
|
169
163
|
function Readable(options) {
|
170
164
|
Duplex = Duplex || require('./_stream_duplex');
|
171
|
-
if (!(this instanceof Readable)) return new Readable(options);
|
172
|
-
// the ReadableState constructor, at least with V8 6.5
|
165
|
+
if (!(this instanceof Readable)) return new Readable(options);
|
173
166
|
|
167
|
+
// Checking for a Stream.Duplex instance is faster here instead of inside
|
168
|
+
// the ReadableState constructor, at least with V8 6.5
|
174
169
|
var isDuplex = this instanceof Duplex;
|
175
|
-
this._readableState = new ReadableState(options, this, isDuplex);
|
170
|
+
this._readableState = new ReadableState(options, this, isDuplex);
|
176
171
|
|
172
|
+
// legacy
|
177
173
|
this.readable = true;
|
178
|
-
|
179
174
|
if (options) {
|
180
175
|
if (typeof options.read === 'function') this._read = options.read;
|
181
176
|
if (typeof options.destroy === 'function') this._destroy = options.destroy;
|
182
177
|
}
|
183
|
-
|
184
178
|
Stream.call(this);
|
185
179
|
}
|
186
|
-
|
187
180
|
Object.defineProperty(Readable.prototype, 'destroyed', {
|
188
181
|
// making it explicit this property is not enumerable
|
189
182
|
// because otherwise some prototype manipulation in
|
@@ -193,7 +186,6 @@ Object.defineProperty(Readable.prototype, 'destroyed', {
|
|
193
186
|
if (this._readableState === undefined) {
|
194
187
|
return false;
|
195
188
|
}
|
196
|
-
|
197
189
|
return this._readableState.destroyed;
|
198
190
|
},
|
199
191
|
set: function set(value) {
|
@@ -201,69 +193,60 @@ Object.defineProperty(Readable.prototype, 'destroyed', {
|
|
201
193
|
// has not been initialized yet
|
202
194
|
if (!this._readableState) {
|
203
195
|
return;
|
204
|
-
}
|
205
|
-
// managing destroyed
|
206
|
-
|
196
|
+
}
|
207
197
|
|
198
|
+
// backward compatibility, the user is explicitly
|
199
|
+
// managing destroyed
|
208
200
|
this._readableState.destroyed = value;
|
209
201
|
}
|
210
202
|
});
|
211
203
|
Readable.prototype.destroy = destroyImpl.destroy;
|
212
204
|
Readable.prototype._undestroy = destroyImpl.undestroy;
|
213
|
-
|
214
205
|
Readable.prototype._destroy = function (err, cb) {
|
215
206
|
cb(err);
|
216
|
-
};
|
207
|
+
};
|
208
|
+
|
209
|
+
// Manually shove something into the read() buffer.
|
217
210
|
// This returns true if the highWaterMark has not been hit yet,
|
218
211
|
// similar to how Writable.write() returns true if you should
|
219
212
|
// write() some more.
|
220
|
-
|
221
|
-
|
222
213
|
Readable.prototype.push = function (chunk, encoding) {
|
223
214
|
var state = this._readableState;
|
224
215
|
var skipChunkCheck;
|
225
|
-
|
226
216
|
if (!state.objectMode) {
|
227
217
|
if (typeof chunk === 'string') {
|
228
218
|
encoding = encoding || state.defaultEncoding;
|
229
|
-
|
230
219
|
if (encoding !== state.encoding) {
|
231
220
|
chunk = Buffer.from(chunk, encoding);
|
232
221
|
encoding = '';
|
233
222
|
}
|
234
|
-
|
235
223
|
skipChunkCheck = true;
|
236
224
|
}
|
237
225
|
} else {
|
238
226
|
skipChunkCheck = true;
|
239
227
|
}
|
240
|
-
|
241
228
|
return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
|
242
|
-
};
|
243
|
-
|
229
|
+
};
|
244
230
|
|
231
|
+
// Unshift should *always* be something directly out of read()
|
245
232
|
Readable.prototype.unshift = function (chunk) {
|
246
233
|
return readableAddChunk(this, chunk, null, true, false);
|
247
234
|
};
|
248
|
-
|
249
235
|
function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
|
250
236
|
debug('readableAddChunk', chunk);
|
251
237
|
var state = stream._readableState;
|
252
|
-
|
253
238
|
if (chunk === null) {
|
254
239
|
state.reading = false;
|
255
240
|
onEofChunk(stream, state);
|
256
241
|
} else {
|
257
242
|
var er;
|
258
243
|
if (!skipChunkCheck) er = chunkInvalid(state, chunk);
|
259
|
-
|
260
244
|
if (er) {
|
261
245
|
errorOrDestroy(stream, er);
|
262
246
|
} else if (state.objectMode || chunk && chunk.length > 0) {
|
263
247
|
if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
|
264
248
|
chunk = _uint8ArrayToBuffer(chunk);
|
265
249
|
}
|
266
|
-
|
267
250
|
if (addToFront) {
|
268
251
|
if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true);
|
269
252
|
} else if (state.ended) {
|
@@ -272,7 +255,6 @@ function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
|
|
272
255
|
return false;
|
273
256
|
} else {
|
274
257
|
state.reading = false;
|
275
|
-
|
276
258
|
if (state.decoder && !encoding) {
|
277
259
|
chunk = state.decoder.write(chunk);
|
278
260
|
if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
|
@@ -284,14 +266,13 @@ function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
|
|
284
266
|
state.reading = false;
|
285
267
|
maybeReadMore(stream, state);
|
286
268
|
}
|
287
|
-
}
|
269
|
+
}
|
270
|
+
|
271
|
+
// We can push more data if we are below the highWaterMark.
|
288
272
|
// Also, if we have no data yet, we can stand some more bytes.
|
289
273
|
// This is to work around cases where hwm=0, such as the repl.
|
290
|
-
|
291
|
-
|
292
274
|
return !state.ended && (state.length < state.highWaterMark || state.length === 0);
|
293
275
|
}
|
294
|
-
|
295
276
|
function addChunk(stream, state, chunk, addToFront) {
|
296
277
|
if (state.flowing && state.length === 0 && !state.sync) {
|
297
278
|
state.awaitDrain = 0;
|
@@ -302,50 +283,42 @@ function addChunk(stream, state, chunk, addToFront) {
|
|
302
283
|
if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
|
303
284
|
if (state.needReadable) emitReadable(stream);
|
304
285
|
}
|
305
|
-
|
306
286
|
maybeReadMore(stream, state);
|
307
287
|
}
|
308
|
-
|
309
288
|
function chunkInvalid(state, chunk) {
|
310
289
|
var er;
|
311
|
-
|
312
290
|
if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
|
313
291
|
er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk);
|
314
292
|
}
|
315
|
-
|
316
293
|
return er;
|
317
294
|
}
|
318
|
-
|
319
295
|
Readable.prototype.isPaused = function () {
|
320
296
|
return this._readableState.flowing === false;
|
321
|
-
};
|
322
|
-
|
297
|
+
};
|
323
298
|
|
299
|
+
// backwards compatibility.
|
324
300
|
Readable.prototype.setEncoding = function (enc) {
|
325
301
|
if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
|
326
302
|
var decoder = new StringDecoder(enc);
|
327
|
-
this._readableState.decoder = decoder;
|
328
|
-
|
329
|
-
this._readableState.encoding = this._readableState.decoder.encoding;
|
303
|
+
this._readableState.decoder = decoder;
|
304
|
+
// If setEncoding(null), decoder.encoding equals utf8
|
305
|
+
this._readableState.encoding = this._readableState.decoder.encoding;
|
330
306
|
|
307
|
+
// Iterate over current buffer to convert already stored Buffers:
|
331
308
|
var p = this._readableState.buffer.head;
|
332
309
|
var content = '';
|
333
|
-
|
334
310
|
while (p !== null) {
|
335
311
|
content += decoder.write(p.data);
|
336
312
|
p = p.next;
|
337
313
|
}
|
338
|
-
|
339
314
|
this._readableState.buffer.clear();
|
340
|
-
|
341
315
|
if (content !== '') this._readableState.buffer.push(content);
|
342
316
|
this._readableState.length = content.length;
|
343
317
|
return this;
|
344
|
-
};
|
345
|
-
|
318
|
+
};
|
346
319
|
|
320
|
+
// Don't raise the hwm > 1GB
|
347
321
|
var MAX_HWM = 0x40000000;
|
348
|
-
|
349
322
|
function computeNewHighWaterMark(n) {
|
350
323
|
if (n >= MAX_HWM) {
|
351
324
|
// TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE.
|
@@ -361,55 +334,54 @@ function computeNewHighWaterMark(n) {
|
|
361
334
|
n |= n >>> 16;
|
362
335
|
n++;
|
363
336
|
}
|
364
|
-
|
365
337
|
return n;
|
366
|
-
}
|
367
|
-
// changes to the function body.
|
368
|
-
|
338
|
+
}
|
369
339
|
|
340
|
+
// This function is designed to be inlinable, so please take care when making
|
341
|
+
// changes to the function body.
|
370
342
|
function howMuchToRead(n, state) {
|
371
343
|
if (n <= 0 || state.length === 0 && state.ended) return 0;
|
372
344
|
if (state.objectMode) return 1;
|
373
|
-
|
374
345
|
if (n !== n) {
|
375
346
|
// Only flow one buffer at a time
|
376
347
|
if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
|
377
|
-
}
|
378
|
-
|
379
|
-
|
348
|
+
}
|
349
|
+
// If we're asking for more than the current hwm, then raise the hwm.
|
380
350
|
if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
|
381
|
-
if (n <= state.length) return n;
|
382
|
-
|
351
|
+
if (n <= state.length) return n;
|
352
|
+
// Don't have enough
|
383
353
|
if (!state.ended) {
|
384
354
|
state.needReadable = true;
|
385
355
|
return 0;
|
386
356
|
}
|
387
|
-
|
388
357
|
return state.length;
|
389
|
-
}
|
390
|
-
|
358
|
+
}
|
391
359
|
|
360
|
+
// you can override either this method, or the async _read(n) below.
|
392
361
|
Readable.prototype.read = function (n) {
|
393
362
|
debug('read', n);
|
394
363
|
n = parseInt(n, 10);
|
395
364
|
var state = this._readableState;
|
396
365
|
var nOrig = n;
|
397
|
-
if (n !== 0) state.emittedReadable = false;
|
366
|
+
if (n !== 0) state.emittedReadable = false;
|
367
|
+
|
368
|
+
// if we're doing read(0) to trigger a readable event, but we
|
398
369
|
// already have a bunch of data in the buffer, then just trigger
|
399
370
|
// the 'readable' event and move on.
|
400
|
-
|
401
371
|
if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {
|
402
372
|
debug('read: emitReadable', state.length, state.ended);
|
403
373
|
if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
|
404
374
|
return null;
|
405
375
|
}
|
376
|
+
n = howMuchToRead(n, state);
|
406
377
|
|
407
|
-
|
408
|
-
|
378
|
+
// if we've ended, and we're now clear, then finish it up.
|
409
379
|
if (n === 0 && state.ended) {
|
410
380
|
if (state.length === 0) endReadable(this);
|
411
381
|
return null;
|
412
|
-
}
|
382
|
+
}
|
383
|
+
|
384
|
+
// All the actual chunk generation logic needs to be
|
413
385
|
// *below* the call to _read. The reason is that in certain
|
414
386
|
// synthetic stream cases, such as passthrough streams, _read
|
415
387
|
// may be a completely synchronous operation which may change
|
@@ -430,40 +402,37 @@ Readable.prototype.read = function (n) {
|
|
430
402
|
// 'readable' etc.
|
431
403
|
//
|
432
404
|
// 3. Actually pull the requested chunks out of the buffer and return.
|
433
|
-
// if we need a readable event, then we need to do some reading.
|
434
|
-
|
435
405
|
|
406
|
+
// if we need a readable event, then we need to do some reading.
|
436
407
|
var doRead = state.needReadable;
|
437
|
-
debug('need readable', doRead);
|
408
|
+
debug('need readable', doRead);
|
438
409
|
|
410
|
+
// if we currently have less than the highWaterMark, then also read some
|
439
411
|
if (state.length === 0 || state.length - n < state.highWaterMark) {
|
440
412
|
doRead = true;
|
441
413
|
debug('length less than watermark', doRead);
|
442
|
-
}
|
443
|
-
// reading, then it's unnecessary.
|
444
|
-
|
414
|
+
}
|
445
415
|
|
416
|
+
// however, if we've ended, then there's no point, and if we're already
|
417
|
+
// reading, then it's unnecessary.
|
446
418
|
if (state.ended || state.reading) {
|
447
419
|
doRead = false;
|
448
420
|
debug('reading or ended', doRead);
|
449
421
|
} else if (doRead) {
|
450
422
|
debug('do read');
|
451
423
|
state.reading = true;
|
452
|
-
state.sync = true;
|
453
|
-
|
454
|
-
if (state.length === 0) state.needReadable = true;
|
455
|
-
|
424
|
+
state.sync = true;
|
425
|
+
// if the length is currently zero, then we *need* a readable event.
|
426
|
+
if (state.length === 0) state.needReadable = true;
|
427
|
+
// call internal read method
|
456
428
|
this._read(state.highWaterMark);
|
457
|
-
|
458
|
-
|
429
|
+
state.sync = false;
|
430
|
+
// If _read pushed data synchronously, then `reading` will be false,
|
459
431
|
// and we need to re-evaluate how much data we can return to the user.
|
460
|
-
|
461
432
|
if (!state.reading) n = howMuchToRead(nOrig, state);
|
462
433
|
}
|
463
|
-
|
464
434
|
var ret;
|
465
435
|
if (n > 0) ret = fromList(n, state);else ret = null;
|
466
|
-
|
467
436
|
if (ret === null) {
|
468
437
|
state.needReadable = state.length <= state.highWaterMark;
|
469
438
|
n = 0;
|
@@ -471,34 +440,28 @@ Readable.prototype.read = function (n) {
|
|
471
440
|
state.length -= n;
|
472
441
|
state.awaitDrain = 0;
|
473
442
|
}
|
474
|
-
|
475
443
|
if (state.length === 0) {
|
476
444
|
// If we have nothing in the buffer, then we want to know
|
477
445
|
// as soon as we *do* get something into the buffer.
|
478
|
-
if (!state.ended) state.needReadable = true;
|
446
|
+
if (!state.ended) state.needReadable = true;
|
479
447
|
|
448
|
+
// If we tried to read() past the EOF, then emit end on the next tick.
|
480
449
|
if (nOrig !== n && state.ended) endReadable(this);
|
481
450
|
}
|
482
|
-
|
483
451
|
if (ret !== null) this.emit('data', ret);
|
484
452
|
return ret;
|
485
453
|
};
|
486
|
-
|
487
454
|
function onEofChunk(stream, state) {
|
488
455
|
debug('onEofChunk');
|
489
456
|
if (state.ended) return;
|
490
|
-
|
491
457
|
if (state.decoder) {
|
492
458
|
var chunk = state.decoder.end();
|
493
|
-
|
494
459
|
if (chunk && chunk.length) {
|
495
460
|
state.buffer.push(chunk);
|
496
461
|
state.length += state.objectMode ? 1 : chunk.length;
|
497
462
|
}
|
498
463
|
}
|
499
|
-
|
500
464
|
state.ended = true;
|
501
|
-
|
502
465
|
if (state.sync) {
|
503
466
|
// if we are sync, wait until next tick to emit the data.
|
504
467
|
// Otherwise we risk emitting data in the flow()
|
@@ -507,61 +470,56 @@ function onEofChunk(stream, state) {
|
|
507
470
|
} else {
|
508
471
|
// emit 'readable' now to make sure it gets picked up.
|
509
472
|
state.needReadable = false;
|
510
|
-
|
511
473
|
if (!state.emittedReadable) {
|
512
474
|
state.emittedReadable = true;
|
513
475
|
emitReadable_(stream);
|
514
476
|
}
|
515
477
|
}
|
516
|
-
}
|
478
|
+
}
|
479
|
+
|
480
|
+
// Don't emit readable right away in sync mode, because this can trigger
|
517
481
|
// another read() call => stack overflow. This way, it might trigger
|
518
482
|
// a nextTick recursion warning, but that's not so bad.
|
519
|
-
|
520
|
-
|
521
483
|
function emitReadable(stream) {
|
522
484
|
var state = stream._readableState;
|
523
485
|
debug('emitReadable', state.needReadable, state.emittedReadable);
|
524
486
|
state.needReadable = false;
|
525
|
-
|
526
487
|
if (!state.emittedReadable) {
|
527
488
|
debug('emitReadable', state.flowing);
|
528
489
|
state.emittedReadable = true;
|
529
490
|
process.nextTick(emitReadable_, stream);
|
530
491
|
}
|
531
492
|
}
|
532
|
-
|
533
493
|
function emitReadable_(stream) {
|
534
494
|
var state = stream._readableState;
|
535
495
|
debug('emitReadable_', state.destroyed, state.length, state.ended);
|
536
|
-
|
537
496
|
if (!state.destroyed && (state.length || state.ended)) {
|
538
497
|
stream.emit('readable');
|
539
498
|
state.emittedReadable = false;
|
540
|
-
}
|
499
|
+
}
|
500
|
+
|
501
|
+
// The stream needs another readable event if
|
541
502
|
// 1. It is not flowing, as the flow mechanism will take
|
542
503
|
// care of it.
|
543
504
|
// 2. It is not ended.
|
544
505
|
// 3. It is below the highWaterMark, so we can schedule
|
545
506
|
// another readable later.
|
546
|
-
|
547
|
-
|
548
507
|
state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;
|
549
508
|
flow(stream);
|
550
|
-
}
|
509
|
+
}
|
510
|
+
|
511
|
+
// at this point, the user has presumably seen the 'readable' event,
|
551
512
|
// and called read() to consume some data. that may have triggered
|
552
513
|
// in turn another _read(n) call, in which case reading = true if
|
553
514
|
// it's in progress.
|
554
515
|
// However, if we're not ended, or reading, and the length < hwm,
|
555
516
|
// then go ahead and try to read some more preemptively.
|
556
|
-
|
557
|
-
|
558
517
|
function maybeReadMore(stream, state) {
|
559
518
|
if (!state.readingMore) {
|
560
519
|
state.readingMore = true;
|
561
520
|
process.nextTick(maybeReadMore_, stream, state);
|
562
521
|
}
|
563
522
|
}
|
564
|
-
|
565
523
|
function maybeReadMore_(stream, state) {
|
566
524
|
// Attempt to read more data if we should.
|
567
525
|
//
|
@@ -590,49 +548,42 @@ function maybeReadMore_(stream, state) {
|
|
590
548
|
var len = state.length;
|
591
549
|
debug('maybeReadMore read 0');
|
592
550
|
stream.read(0);
|
593
|
-
if (len === state.length)
|
551
|
+
if (len === state.length)
|
552
|
+
// didn't get any data, stop spinning.
|
594
553
|
break;
|
595
554
|
}
|
596
|
-
|
597
555
|
state.readingMore = false;
|
598
|
-
}
|
556
|
+
}
|
557
|
+
|
558
|
+
// abstract method. to be overridden in specific implementation classes.
|
599
559
|
// call cb(er, data) where data is <= n in length.
|
600
560
|
// for virtual (non-string, non-buffer) streams, "length" is somewhat
|
601
561
|
// arbitrary, and perhaps not very meaningful.
|
602
|
-
|
603
|
-
|
604
562
|
Readable.prototype._read = function (n) {
|
605
563
|
errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()'));
|
606
564
|
};
|
607
|
-
|
608
565
|
Readable.prototype.pipe = function (dest, pipeOpts) {
|
609
566
|
var src = this;
|
610
567
|
var state = this._readableState;
|
611
|
-
|
612
568
|
switch (state.pipesCount) {
|
613
569
|
case 0:
|
614
570
|
state.pipes = dest;
|
615
571
|
break;
|
616
|
-
|
617
572
|
case 1:
|
618
573
|
state.pipes = [state.pipes, dest];
|
619
574
|
break;
|
620
|
-
|
621
575
|
default:
|
622
576
|
state.pipes.push(dest);
|
623
577
|
break;
|
624
578
|
}
|
625
|
-
|
626
579
|
state.pipesCount += 1;
|
627
580
|
debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
|
628
581
|
var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
|
629
582
|
var endFn = doEnd ? onend : unpipe;
|
630
583
|
if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn);
|
631
584
|
dest.on('unpipe', onunpipe);
|
632
|
-
|
633
585
|
function onunpipe(readable, unpipeInfo) {
|
634
586
|
debug('onunpipe');
|
635
|
-
|
636
587
|
if (readable === src) {
|
637
588
|
if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
|
638
589
|
unpipeInfo.hasUnpiped = true;
|
@@ -640,23 +591,21 @@ Readable.prototype.pipe = function (dest, pipeOpts) {
|
|
640
591
|
}
|
641
592
|
}
|
642
593
|
}
|
643
|
-
|
644
594
|
function onend() {
|
645
595
|
debug('onend');
|
646
596
|
dest.end();
|
647
|
-
}
|
597
|
+
}
|
598
|
+
|
599
|
+
// when the dest drains, it reduces the awaitDrain counter
|
648
600
|
// on the source. This would be more elegant with a .once()
|
649
601
|
// handler in flow(), but adding and removing repeatedly is
|
650
602
|
// too slow.
|
651
|
-
|
652
|
-
|
653
603
|
var ondrain = pipeOnDrain(src);
|
654
604
|
dest.on('drain', ondrain);
|
655
605
|
var cleanedUp = false;
|
656
|
-
|
657
606
|
function cleanup() {
|
658
|
-
debug('cleanup');
|
659
|
-
|
607
|
+
debug('cleanup');
|
608
|
+
// cleanup event handlers once the pipe is broken
|
660
609
|
dest.removeListener('close', onclose);
|
661
610
|
dest.removeListener('finish', onfinish);
|
662
611
|
dest.removeListener('drain', ondrain);
|
@@ -665,22 +614,20 @@ Readable.prototype.pipe = function (dest, pipeOpts) {
|
|
665
614
|
src.removeListener('end', onend);
|
666
615
|
src.removeListener('end', unpipe);
|
667
616
|
src.removeListener('data', ondata);
|
668
|
-
cleanedUp = true;
|
617
|
+
cleanedUp = true;
|
618
|
+
|
619
|
+
// if the reader is waiting for a drain event from this
|
669
620
|
// specific writer, then it would cause it to never start
|
670
621
|
// flowing again.
|
671
622
|
// So, if this is awaiting a drain, then we just call it now.
|
672
623
|
// If we don't know, then assume that we are waiting for one.
|
673
|
-
|
674
624
|
if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
|
675
625
|
}
|
676
|
-
|
677
626
|
src.on('data', ondata);
|
678
|
-
|
679
627
|
function ondata(chunk) {
|
680
628
|
debug('ondata');
|
681
629
|
var ret = dest.write(chunk);
|
682
630
|
debug('dest.write', ret);
|
683
|
-
|
684
631
|
if (ret === false) {
|
685
632
|
// If the user unpiped during `dest.write()`, it is possible
|
686
633
|
// to get stuck in a permanently paused state if that write
|
@@ -690,87 +637,84 @@ Readable.prototype.pipe = function (dest, pipeOpts) {
|
|
690
637
|
debug('false write response, pause', state.awaitDrain);
|
691
638
|
state.awaitDrain++;
|
692
639
|
}
|
693
|
-
|
694
640
|
src.pause();
|
695
641
|
}
|
696
|
-
}
|
697
|
-
// however, don't suppress the throwing behavior for this.
|
698
|
-
|
642
|
+
}
|
699
643
|
|
644
|
+
// if the dest has an error, then stop piping into it.
|
645
|
+
// however, don't suppress the throwing behavior for this.
|
700
646
|
function onerror(er) {
|
701
647
|
debug('onerror', er);
|
702
648
|
unpipe();
|
703
649
|
dest.removeListener('error', onerror);
|
704
650
|
if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);
|
705
|
-
}
|
706
|
-
|
651
|
+
}
|
707
652
|
|
708
|
-
|
653
|
+
// Make sure our error handler is attached before userland ones.
|
654
|
+
prependListener(dest, 'error', onerror);
|
709
655
|
|
656
|
+
// Both close and finish should trigger unpipe, but only once.
|
710
657
|
function onclose() {
|
711
658
|
dest.removeListener('finish', onfinish);
|
712
659
|
unpipe();
|
713
660
|
}
|
714
|
-
|
715
661
|
dest.once('close', onclose);
|
716
|
-
|
717
662
|
function onfinish() {
|
718
663
|
debug('onfinish');
|
719
664
|
dest.removeListener('close', onclose);
|
720
665
|
unpipe();
|
721
666
|
}
|
722
|
-
|
723
667
|
dest.once('finish', onfinish);
|
724
|
-
|
725
668
|
function unpipe() {
|
726
669
|
debug('unpipe');
|
727
670
|
src.unpipe(dest);
|
728
|
-
}
|
729
|
-
|
671
|
+
}
|
730
672
|
|
731
|
-
|
673
|
+
// tell the dest that it's being piped to
|
674
|
+
dest.emit('pipe', src);
|
732
675
|
|
676
|
+
// start the flow if it hasn't been started already.
|
733
677
|
if (!state.flowing) {
|
734
678
|
debug('pipe resume');
|
735
679
|
src.resume();
|
736
680
|
}
|
737
|
-
|
738
681
|
return dest;
|
739
682
|
};
|
740
|
-
|
741
683
|
function pipeOnDrain(src) {
|
742
684
|
return function pipeOnDrainFunctionResult() {
|
743
685
|
var state = src._readableState;
|
744
686
|
debug('pipeOnDrain', state.awaitDrain);
|
745
687
|
if (state.awaitDrain) state.awaitDrain--;
|
746
|
-
|
747
688
|
if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
|
748
689
|
state.flowing = true;
|
749
690
|
flow(src);
|
750
691
|
}
|
751
692
|
};
|
752
693
|
}
|
753
|
-
|
754
694
|
Readable.prototype.unpipe = function (dest) {
|
755
695
|
var state = this._readableState;
|
756
696
|
var unpipeInfo = {
|
757
697
|
hasUnpiped: false
|
758
|
-
};
|
698
|
+
};
|
759
699
|
|
760
|
-
if
|
700
|
+
// if we're not piping anywhere, then do nothing.
|
701
|
+
if (state.pipesCount === 0) return this;
|
761
702
|
|
703
|
+
// just one destination. most common case.
|
762
704
|
if (state.pipesCount === 1) {
|
763
705
|
// passed in one, but it's not the right one.
|
764
706
|
if (dest && dest !== state.pipes) return this;
|
765
|
-
if (!dest) dest = state.pipes;
|
707
|
+
if (!dest) dest = state.pipes;
|
766
708
|
|
709
|
+
// got a match.
|
767
710
|
state.pipes = null;
|
768
711
|
state.pipesCount = 0;
|
769
712
|
state.flowing = false;
|
770
713
|
if (dest) dest.emit('unpipe', this, unpipeInfo);
|
771
714
|
return this;
|
772
|
-
}
|
715
|
+
}
|
773
716
|
|
717
|
+
// slow case. multiple pipe destinations.
|
774
718
|
|
775
719
|
if (!dest) {
|
776
720
|
// remove all.
|
@@ -779,17 +723,13 @@ Readable.prototype.unpipe = function (dest) {
|
|
779
723
|
state.pipes = null;
|
780
724
|
state.pipesCount = 0;
|
781
725
|
state.flowing = false;
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
hasUnpiped: false
|
786
|
-
});
|
787
|
-
}
|
788
|
-
|
726
|
+
for (var i = 0; i < len; i++) dests[i].emit('unpipe', this, {
|
727
|
+
hasUnpiped: false
|
728
|
+
});
|
789
729
|
return this;
|
790
|
-
}
|
791
|
-
|
730
|
+
}
|
792
731
|
|
732
|
+
// try to find the right one.
|
793
733
|
var index = indexOf(state.pipes, dest);
|
794
734
|
if (index === -1) return this;
|
795
735
|
state.pipes.splice(index, 1);
|
@@ -797,19 +737,19 @@ Readable.prototype.unpipe = function (dest) {
|
|
797
737
|
if (state.pipesCount === 1) state.pipes = state.pipes[0];
|
798
738
|
dest.emit('unpipe', this, unpipeInfo);
|
799
739
|
return this;
|
800
|
-
};
|
801
|
-
// Ensure readable listeners eventually get something
|
802
|
-
|
740
|
+
};
|
803
741
|
|
742
|
+
// set up data events if they are asked for
|
743
|
+
// Ensure readable listeners eventually get something
|
804
744
|
Readable.prototype.on = function (ev, fn) {
|
805
745
|
var res = Stream.prototype.on.call(this, ev, fn);
|
806
746
|
var state = this._readableState;
|
807
|
-
|
808
747
|
if (ev === 'data') {
|
809
748
|
// update readableListening so that resume() may be a no-op
|
810
749
|
// a few lines down. This is needed to support once('readable').
|
811
|
-
state.readableListening = this.listenerCount('readable') > 0;
|
750
|
+
state.readableListening = this.listenerCount('readable') > 0;
|
812
751
|
|
752
|
+
// Try start flowing on next tick if stream isn't explicitly paused
|
813
753
|
if (state.flowing !== false) this.resume();
|
814
754
|
} else if (ev === 'readable') {
|
815
755
|
if (!state.endEmitted && !state.readableListening) {
|
@@ -817,7 +757,6 @@ Readable.prototype.on = function (ev, fn) {
|
|
817
757
|
state.flowing = false;
|
818
758
|
state.emittedReadable = false;
|
819
759
|
debug('on readable', state.length, state.reading);
|
820
|
-
|
821
760
|
if (state.length) {
|
822
761
|
emitReadable(this);
|
823
762
|
} else if (!state.reading) {
|
@@ -825,15 +764,11 @@ Readable.prototype.on = function (ev, fn) {
|
|
825
764
|
}
|
826
765
|
}
|
827
766
|
}
|
828
|
-
|
829
767
|
return res;
|
830
768
|
};
|
831
|
-
|
832
769
|
Readable.prototype.addListener = Readable.prototype.on;
|
833
|
-
|
834
770
|
Readable.prototype.removeListener = function (ev, fn) {
|
835
771
|
var res = Stream.prototype.removeListener.call(this, ev, fn);
|
836
|
-
|
837
772
|
if (ev === 'readable') {
|
838
773
|
// We need to check if there is someone still listening to
|
839
774
|
// readable and reset the state. However this needs to happen
|
@@ -843,13 +778,10 @@ Readable.prototype.removeListener = function (ev, fn) {
|
|
843
778
|
// effect.
|
844
779
|
process.nextTick(updateReadableListening, this);
|
845
780
|
}
|
846
|
-
|
847
781
|
return res;
|
848
782
|
};
|
849
|
-
|
850
783
|
Readable.prototype.removeAllListeners = function (ev) {
|
851
784
|
var res = Stream.prototype.removeAllListeners.apply(this, arguments);
|
852
|
-
|
853
785
|
if (ev === 'readable' || ev === undefined) {
|
854
786
|
// We need to check if there is someone still listening to
|
855
787
|
// readable and reset the state. However this needs to happen
|
@@ -859,121 +791,103 @@ Readable.prototype.removeAllListeners = function (ev) {
|
|
859
791
|
// effect.
|
860
792
|
process.nextTick(updateReadableListening, this);
|
861
793
|
}
|
862
|
-
|
863
794
|
return res;
|
864
795
|
};
|
865
|
-
|
866
796
|
function updateReadableListening(self) {
|
867
797
|
var state = self._readableState;
|
868
798
|
state.readableListening = self.listenerCount('readable') > 0;
|
869
|
-
|
870
799
|
if (state.resumeScheduled && !state.paused) {
|
871
800
|
// flowing needs to be set to true now, otherwise
|
872
801
|
// the upcoming resume will not flow.
|
873
|
-
state.flowing = true;
|
802
|
+
state.flowing = true;
|
803
|
+
|
804
|
+
// crude way to check if we should resume
|
874
805
|
} else if (self.listenerCount('data') > 0) {
|
875
806
|
self.resume();
|
876
807
|
}
|
877
808
|
}
|
878
|
-
|
879
809
|
function nReadingNextTick(self) {
|
880
810
|
debug('readable nexttick read 0');
|
881
811
|
self.read(0);
|
882
|
-
}
|
883
|
-
// If the user uses them, then switch into old mode.
|
884
|
-
|
812
|
+
}
|
885
813
|
|
814
|
+
// pause() and resume() are remnants of the legacy readable stream API
|
815
|
+
// If the user uses them, then switch into old mode.
|
886
816
|
Readable.prototype.resume = function () {
|
887
817
|
var state = this._readableState;
|
888
|
-
|
889
818
|
if (!state.flowing) {
|
890
|
-
debug('resume');
|
819
|
+
debug('resume');
|
820
|
+
// we flow only if there is no one listening
|
891
821
|
// for readable, but we still have to call
|
892
822
|
// resume()
|
893
|
-
|
894
823
|
state.flowing = !state.readableListening;
|
895
824
|
resume(this, state);
|
896
825
|
}
|
897
|
-
|
898
826
|
state.paused = false;
|
899
827
|
return this;
|
900
828
|
};
|
901
|
-
|
902
829
|
function resume(stream, state) {
|
903
830
|
if (!state.resumeScheduled) {
|
904
831
|
state.resumeScheduled = true;
|
905
832
|
process.nextTick(resume_, stream, state);
|
906
833
|
}
|
907
834
|
}
|
908
|
-
|
909
835
|
function resume_(stream, state) {
|
910
836
|
debug('resume', state.reading);
|
911
|
-
|
912
837
|
if (!state.reading) {
|
913
838
|
stream.read(0);
|
914
839
|
}
|
915
|
-
|
916
840
|
state.resumeScheduled = false;
|
917
841
|
stream.emit('resume');
|
918
842
|
flow(stream);
|
919
843
|
if (state.flowing && !state.reading) stream.read(0);
|
920
844
|
}
|
921
|
-
|
922
845
|
Readable.prototype.pause = function () {
|
923
846
|
debug('call pause flowing=%j', this._readableState.flowing);
|
924
|
-
|
925
847
|
if (this._readableState.flowing !== false) {
|
926
848
|
debug('pause');
|
927
849
|
this._readableState.flowing = false;
|
928
850
|
this.emit('pause');
|
929
851
|
}
|
930
|
-
|
931
852
|
this._readableState.paused = true;
|
932
853
|
return this;
|
933
854
|
};
|
934
|
-
|
935
855
|
function flow(stream) {
|
936
856
|
var state = stream._readableState;
|
937
857
|
debug('flow', state.flowing);
|
858
|
+
while (state.flowing && stream.read() !== null);
|
859
|
+
}
|
938
860
|
|
939
|
-
|
940
|
-
;
|
941
|
-
}
|
942
|
-
} // wrap an old-style stream as the async data source.
|
861
|
+
// wrap an old-style stream as the async data source.
|
943
862
|
// This is *not* part of the readable stream interface.
|
944
863
|
// It is an ugly unfortunate mess of history.
|
945
|
-
|
946
|
-
|
947
864
|
Readable.prototype.wrap = function (stream) {
|
948
865
|
var _this = this;
|
949
|
-
|
950
866
|
var state = this._readableState;
|
951
867
|
var paused = false;
|
952
868
|
stream.on('end', function () {
|
953
869
|
debug('wrapped end');
|
954
|
-
|
955
870
|
if (state.decoder && !state.ended) {
|
956
871
|
var chunk = state.decoder.end();
|
957
872
|
if (chunk && chunk.length) _this.push(chunk);
|
958
873
|
}
|
959
|
-
|
960
874
|
_this.push(null);
|
961
875
|
});
|
962
876
|
stream.on('data', function (chunk) {
|
963
877
|
debug('wrapped data');
|
964
|
-
if (state.decoder) chunk = state.decoder.write(chunk);
|
878
|
+
if (state.decoder) chunk = state.decoder.write(chunk);
|
965
879
|
|
880
|
+
// don't skip over falsy values in objectMode
|
966
881
|
if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
|
967
|
-
|
968
882
|
var ret = _this.push(chunk);
|
969
|
-
|
970
883
|
if (!ret) {
|
971
884
|
paused = true;
|
972
885
|
stream.pause();
|
973
886
|
}
|
974
|
-
});
|
975
|
-
// important when wrapping filters and duplexes.
|
887
|
+
});
|
976
888
|
|
889
|
+
// proxy all the other methods.
|
890
|
+
// important when wrapping filters and duplexes.
|
977
891
|
for (var i in stream) {
|
978
892
|
if (this[i] === undefined && typeof stream[i] === 'function') {
|
979
893
|
this[i] = function methodWrap(method) {
|
@@ -982,37 +896,32 @@ Readable.prototype.wrap = function (stream) {
|
|
982
896
|
};
|
983
897
|
}(i);
|
984
898
|
}
|
985
|
-
}
|
986
|
-
|
899
|
+
}
|
987
900
|
|
901
|
+
// proxy certain important events.
|
988
902
|
for (var n = 0; n < kProxyEvents.length; n++) {
|
989
903
|
stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
|
990
|
-
}
|
991
|
-
// underlying stream.
|
992
|
-
|
904
|
+
}
|
993
905
|
|
906
|
+
// when we try to consume some more bytes, simply unpause the
|
907
|
+
// underlying stream.
|
994
908
|
this._read = function (n) {
|
995
909
|
debug('wrapped _read', n);
|
996
|
-
|
997
910
|
if (paused) {
|
998
911
|
paused = false;
|
999
912
|
stream.resume();
|
1000
913
|
}
|
1001
914
|
};
|
1002
|
-
|
1003
915
|
return this;
|
1004
916
|
};
|
1005
|
-
|
1006
917
|
if (typeof Symbol === 'function') {
|
1007
918
|
Readable.prototype[Symbol.asyncIterator] = function () {
|
1008
919
|
if (createReadableStreamAsyncIterator === undefined) {
|
1009
920
|
createReadableStreamAsyncIterator = require('./internal/streams/async_iterator');
|
1010
921
|
}
|
1011
|
-
|
1012
922
|
return createReadableStreamAsyncIterator(this);
|
1013
923
|
};
|
1014
924
|
}
|
1015
|
-
|
1016
925
|
Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
|
1017
926
|
// making it explicit this property is not enumerable
|
1018
927
|
// because otherwise some prototype manipulation in
|
@@ -1044,8 +953,9 @@ Object.defineProperty(Readable.prototype, 'readableFlowing', {
|
|
1044
953
|
this._readableState.flowing = state;
|
1045
954
|
}
|
1046
955
|
}
|
1047
|
-
});
|
956
|
+
});
|
1048
957
|
|
958
|
+
// exposed for testing purposes only.
|
1049
959
|
Readable._fromList = fromList;
|
1050
960
|
Object.defineProperty(Readable.prototype, 'readableLength', {
|
1051
961
|
// making it explicit this property is not enumerable
|
@@ -1055,11 +965,12 @@ Object.defineProperty(Readable.prototype, 'readableLength', {
|
|
1055
965
|
get: function get() {
|
1056
966
|
return this._readableState.length;
|
1057
967
|
}
|
1058
|
-
});
|
968
|
+
});
|
969
|
+
|
970
|
+
// Pluck off n bytes from an array of buffers.
|
1059
971
|
// Length is the combined lengths of all the buffers in the list.
|
1060
972
|
// This function is designed to be inlinable, so please take care when making
|
1061
973
|
// changes to the function body.
|
1062
|
-
|
1063
974
|
function fromList(n, state) {
|
1064
975
|
// nothing buffered
|
1065
976
|
if (state.length === 0) return null;
|
@@ -1074,51 +985,43 @@ function fromList(n, state) {
|
|
1074
985
|
}
|
1075
986
|
return ret;
|
1076
987
|
}
|
1077
|
-
|
1078
988
|
function endReadable(stream) {
|
1079
989
|
var state = stream._readableState;
|
1080
990
|
debug('endReadable', state.endEmitted);
|
1081
|
-
|
1082
991
|
if (!state.endEmitted) {
|
1083
992
|
state.ended = true;
|
1084
993
|
process.nextTick(endReadableNT, state, stream);
|
1085
994
|
}
|
1086
995
|
}
|
1087
|
-
|
1088
996
|
function endReadableNT(state, stream) {
|
1089
|
-
debug('endReadableNT', state.endEmitted, state.length);
|
997
|
+
debug('endReadableNT', state.endEmitted, state.length);
|
1090
998
|
|
999
|
+
// Check that we didn't get one last unshift.
|
1091
1000
|
if (!state.endEmitted && state.length === 0) {
|
1092
1001
|
state.endEmitted = true;
|
1093
1002
|
stream.readable = false;
|
1094
1003
|
stream.emit('end');
|
1095
|
-
|
1096
1004
|
if (state.autoDestroy) {
|
1097
1005
|
// In case of duplex streams we need a way to detect
|
1098
1006
|
// if the writable side is ready for autoDestroy as well
|
1099
1007
|
var wState = stream._writableState;
|
1100
|
-
|
1101
1008
|
if (!wState || wState.autoDestroy && wState.finished) {
|
1102
1009
|
stream.destroy();
|
1103
1010
|
}
|
1104
1011
|
}
|
1105
1012
|
}
|
1106
1013
|
}
|
1107
|
-
|
1108
1014
|
if (typeof Symbol === 'function') {
|
1109
1015
|
Readable.from = function (iterable, opts) {
|
1110
1016
|
if (from === undefined) {
|
1111
1017
|
from = require('./internal/streams/from');
|
1112
1018
|
}
|
1113
|
-
|
1114
1019
|
return from(Readable, iterable, opts);
|
1115
1020
|
};
|
1116
1021
|
}
|
1117
|
-
|
1118
1022
|
function indexOf(xs, x) {
|
1119
1023
|
for (var i = 0, l = xs.length; i < l; i++) {
|
1120
1024
|
if (xs[i] === x) return i;
|
1121
1025
|
}
|
1122
|
-
|
1123
1026
|
return -1;
|
1124
1027
|
}
|