appium-mac2-driver 4.5.0 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/build/lib/session-claim-handler.d.ts.map +1 -1
- package/build/lib/session-claim-handler.js +1 -2
- package/build/lib/session-claim-handler.js.map +1 -1
- package/build/lib/wda-mac.d.ts +0 -1
- package/build/lib/wda-mac.d.ts.map +1 -1
- package/build/lib/wda-mac.js +1 -1
- package/lib/session-claim-handler.ts +1 -2
- package/lib/wda-mac.ts +1 -2
- package/node_modules/@appium/support/build/lib/npm.d.ts.map +1 -1
- package/node_modules/@appium/support/build/lib/npm.js +2 -1
- package/node_modules/@appium/support/build/lib/npm.js.map +1 -1
- package/node_modules/@appium/support/build/lib/util.d.ts.map +1 -1
- package/node_modules/@appium/support/build/lib/util.js +13 -1
- package/node_modules/@appium/support/build/lib/util.js.map +1 -1
- package/node_modules/@appium/support/build/lib/zip.d.ts +2 -1
- package/node_modules/@appium/support/build/lib/zip.d.ts.map +1 -1
- package/node_modules/@appium/support/build/lib/zip.js +193 -64
- package/node_modules/@appium/support/build/lib/zip.js.map +1 -1
- package/node_modules/@appium/support/lib/npm.ts +2 -1
- package/node_modules/@appium/support/lib/util.ts +13 -1
- package/node_modules/@appium/support/lib/zip.ts +231 -71
- package/node_modules/@appium/support/node_modules/axios/CHANGELOG.md +1934 -0
- package/node_modules/@appium/support/node_modules/axios/LICENSE +7 -0
- package/node_modules/@appium/support/node_modules/axios/MIGRATION_GUIDE.md +877 -0
- package/node_modules/@appium/support/node_modules/axios/README.md +2851 -0
- package/node_modules/@appium/support/node_modules/axios/dist/axios.js +5807 -0
- package/node_modules/@appium/support/node_modules/axios/dist/axios.min.js +5 -0
- package/node_modules/@appium/support/node_modules/axios/dist/axios.min.js.map +1 -0
- package/node_modules/@appium/support/node_modules/axios/dist/browser/axios.cjs +5829 -0
- package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.js +5850 -0
- package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.min.js +3 -0
- package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.min.js.map +1 -0
- package/node_modules/@appium/support/node_modules/axios/dist/node/axios.cjs +6808 -0
- package/node_modules/@appium/support/node_modules/axios/index.d.cts +766 -0
- package/node_modules/@appium/support/node_modules/axios/index.d.ts +787 -0
- package/node_modules/@appium/support/node_modules/axios/index.js +45 -0
- package/node_modules/@appium/support/node_modules/axios/lib/adapters/README.md +36 -0
- package/node_modules/@appium/support/node_modules/axios/lib/adapters/adapters.js +132 -0
- package/node_modules/@appium/support/node_modules/axios/lib/adapters/fetch.js +696 -0
- package/node_modules/@appium/support/node_modules/axios/lib/adapters/http.js +1490 -0
- package/node_modules/@appium/support/node_modules/axios/lib/adapters/xhr.js +277 -0
- package/node_modules/@appium/support/node_modules/axios/lib/axios.js +89 -0
- package/node_modules/@appium/support/node_modules/axios/lib/cancel/CancelToken.js +135 -0
- package/node_modules/@appium/support/node_modules/axios/lib/cancel/CanceledError.js +22 -0
- package/node_modules/@appium/support/node_modules/axios/lib/cancel/isCancel.js +5 -0
- package/node_modules/@appium/support/node_modules/axios/lib/core/Axios.js +306 -0
- package/node_modules/@appium/support/node_modules/axios/lib/core/AxiosError.js +219 -0
- package/node_modules/@appium/support/node_modules/axios/lib/core/AxiosHeaders.js +474 -0
- package/node_modules/@appium/support/node_modules/axios/lib/core/InterceptorManager.js +171 -0
- package/node_modules/@appium/support/node_modules/axios/lib/core/README.md +8 -0
- package/node_modules/@appium/support/node_modules/axios/lib/core/buildFullPath.js +76 -0
- package/node_modules/@appium/support/node_modules/axios/lib/core/dispatchRequest.js +95 -0
- package/node_modules/@appium/support/node_modules/axios/lib/core/mergeConfig.js +174 -0
- package/node_modules/@appium/support/node_modules/axios/lib/core/methodList.js +17 -0
- package/node_modules/@appium/support/node_modules/axios/lib/core/setFormDataHeaders.js +27 -0
- package/node_modules/@appium/support/node_modules/axios/lib/core/settle.js +27 -0
- package/node_modules/@appium/support/node_modules/axios/lib/core/transformData.js +28 -0
- package/node_modules/@appium/support/node_modules/axios/lib/defaults/index.js +178 -0
- package/node_modules/@appium/support/node_modules/axios/lib/defaults/transitional.js +10 -0
- package/node_modules/@appium/support/node_modules/axios/lib/env/README.md +3 -0
- package/node_modules/@appium/support/node_modules/axios/lib/env/classes/FormData.js +2 -0
- package/node_modules/@appium/support/node_modules/axios/lib/env/data.js +1 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/AxiosTransformStream.js +156 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +59 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/Http2Sessions.js +121 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/HttpStatusCode.js +88 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/README.md +7 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +29 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/bind.js +14 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/buildURL.js +69 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/callbackify.js +18 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/combineURLs.js +23 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/composeSignals.js +68 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/cookies.js +64 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/deprecatedMethod.js +31 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +166 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/formDataToJSON.js +125 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/formDataToStream.js +119 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/fromDataURI.js +69 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/isAbsoluteURL.js +19 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/isAxiosError.js +14 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/isURLSameOrigin.js +16 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +24 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/null.js +2 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/parseHeaders.js +71 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/parseProtocol.js +6 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/progressEventReducer.js +54 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/readBlob.js +15 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/resolveConfig.js +107 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/sanitizeHeaderValue.js +60 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/shouldBypassProxy.js +505 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/speedometer.js +55 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/spread.js +28 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/throttle.js +45 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/toFormData.js +279 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/toURLEncodedForm.js +19 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/trackStream.js +89 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/validator.js +112 -0
- package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/Blob.js +3 -0
- package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/FormData.js +3 -0
- package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +4 -0
- package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/index.js +13 -0
- package/node_modules/@appium/support/node_modules/axios/lib/platform/common/utils.js +52 -0
- package/node_modules/@appium/support/node_modules/axios/lib/platform/index.js +7 -0
- package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/Buffer.js +11 -0
- package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/FormData.js +3 -0
- package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +4 -0
- package/node_modules/@appium/support/node_modules/axios/lib/platform/node/index.js +37 -0
- package/node_modules/@appium/support/node_modules/axios/lib/utils.js +1150 -0
- package/node_modules/@appium/support/node_modules/axios/package.json +203 -0
- package/node_modules/@appium/support/package.json +6 -6
- package/node_modules/@appium/types/build/lib/commands/basedriver.d.ts +6 -4
- package/node_modules/@appium/types/build/lib/commands/basedriver.d.ts.map +1 -1
- package/node_modules/@appium/types/lib/commands/basedriver.ts +4 -4
- package/node_modules/@appium/types/package.json +2 -2
- package/node_modules/appium-xcode/CHANGELOG.md +7 -0
- package/node_modules/appium-xcode/package.json +4 -4
- package/node_modules/asyncbox/README.md +43 -0
- package/node_modules/asyncbox/build/cjs/lib/asyncfilter.d.ts +9 -0
- package/node_modules/asyncbox/build/cjs/lib/asyncfilter.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/asyncfilter.js +35 -0
- package/node_modules/asyncbox/build/cjs/lib/asyncfilter.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/asyncmap.d.ts +9 -0
- package/node_modules/asyncbox/build/cjs/lib/asyncmap.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/asyncmap.js +23 -0
- package/node_modules/asyncbox/build/cjs/lib/asyncmap.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/errors.d.ts +9 -0
- package/node_modules/asyncbox/build/cjs/lib/errors.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/errors.js +20 -0
- package/node_modules/asyncbox/build/cjs/lib/errors.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/index.d.ts +12 -0
- package/node_modules/asyncbox/build/cjs/lib/index.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/index.js +24 -0
- package/node_modules/asyncbox/build/cjs/lib/index.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/limit-function.d.ts +3 -0
- package/node_modules/asyncbox/build/cjs/lib/limit-function.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/limit-function.js +15 -0
- package/node_modules/asyncbox/build/cjs/lib/limit-function.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/lock.d.ts +74 -0
- package/node_modules/asyncbox/build/cjs/lib/lock.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/lock.js +295 -0
- package/node_modules/asyncbox/build/cjs/lib/lock.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/long-sleep.d.ts +15 -0
- package/node_modules/asyncbox/build/cjs/lib/long-sleep.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/long-sleep.js +36 -0
- package/node_modules/asyncbox/build/cjs/lib/long-sleep.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/retry.d.ts +17 -0
- package/node_modules/asyncbox/build/cjs/lib/retry.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/retry.js +57 -0
- package/node_modules/asyncbox/build/cjs/lib/retry.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/sleep.d.ts +20 -0
- package/node_modules/asyncbox/build/cjs/lib/sleep.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/sleep.js +61 -0
- package/node_modules/asyncbox/build/cjs/lib/sleep.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.d.ts +18 -0
- package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.js +51 -0
- package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/with-timeout.d.ts +16 -0
- package/node_modules/asyncbox/build/cjs/lib/with-timeout.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/with-timeout.js +45 -0
- package/node_modules/asyncbox/build/cjs/lib/with-timeout.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/asyncfilter.d.ts +9 -0
- package/node_modules/asyncbox/build/esm/lib/asyncfilter.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/asyncfilter.js +32 -0
- package/node_modules/asyncbox/build/esm/lib/asyncfilter.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/asyncmap.d.ts +9 -0
- package/node_modules/asyncbox/build/esm/lib/asyncmap.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/asyncmap.js +20 -0
- package/node_modules/asyncbox/build/esm/lib/asyncmap.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/errors.d.ts +9 -0
- package/node_modules/asyncbox/build/esm/lib/errors.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/errors.js +15 -0
- package/node_modules/asyncbox/build/esm/lib/errors.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/index.d.ts +12 -0
- package/node_modules/asyncbox/build/esm/lib/index.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/index.js +10 -0
- package/node_modules/asyncbox/build/esm/lib/index.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/limit-function.d.ts +3 -0
- package/node_modules/asyncbox/build/esm/lib/limit-function.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/limit-function.js +12 -0
- package/node_modules/asyncbox/build/esm/lib/limit-function.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/lock.d.ts +74 -0
- package/node_modules/asyncbox/build/esm/lib/lock.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/lock.js +291 -0
- package/node_modules/asyncbox/build/esm/lib/lock.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/long-sleep.d.ts +15 -0
- package/node_modules/asyncbox/build/esm/lib/long-sleep.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/long-sleep.js +33 -0
- package/node_modules/asyncbox/build/esm/lib/long-sleep.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/retry.d.ts +17 -0
- package/node_modules/asyncbox/build/esm/lib/retry.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/retry.js +53 -0
- package/node_modules/asyncbox/build/esm/lib/retry.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/sleep.d.ts +20 -0
- package/node_modules/asyncbox/build/esm/lib/sleep.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/sleep.js +58 -0
- package/node_modules/asyncbox/build/esm/lib/sleep.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/wait-for-condition.d.ts +18 -0
- package/node_modules/asyncbox/build/esm/lib/wait-for-condition.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/wait-for-condition.js +48 -0
- package/node_modules/asyncbox/build/esm/lib/wait-for-condition.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/with-timeout.d.ts +16 -0
- package/node_modules/asyncbox/build/esm/lib/with-timeout.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/with-timeout.js +42 -0
- package/node_modules/asyncbox/build/esm/lib/with-timeout.js.map +1 -0
- package/node_modules/asyncbox/lib/asyncfilter.ts +38 -0
- package/node_modules/asyncbox/lib/asyncmap.ts +29 -0
- package/node_modules/asyncbox/lib/errors.ts +15 -0
- package/node_modules/asyncbox/lib/index.ts +21 -0
- package/node_modules/asyncbox/lib/limit-function.ts +18 -0
- package/node_modules/asyncbox/lib/lock.ts +360 -0
- package/node_modules/asyncbox/lib/long-sleep.ts +38 -0
- package/node_modules/asyncbox/lib/retry.ts +61 -0
- package/node_modules/asyncbox/lib/sleep.ts +79 -0
- package/node_modules/asyncbox/lib/wait-for-condition.ts +52 -0
- package/node_modules/asyncbox/lib/with-timeout.ts +43 -0
- package/node_modules/asyncbox/package.json +8 -8
- package/node_modules/axios/README.md +41 -106
- package/node_modules/axios/dist/axios.js +931 -278
- package/node_modules/axios/dist/axios.min.js +2 -2
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +948 -268
- package/node_modules/axios/dist/esm/axios.js +948 -268
- package/node_modules/axios/dist/esm/axios.min.js +2 -2
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +925 -242
- package/node_modules/axios/index.d.cts +20 -1
- package/node_modules/axios/index.d.ts +18 -1
- package/node_modules/axios/lib/adapters/fetch.js +73 -20
- package/node_modules/axios/lib/adapters/http.js +145 -26
- package/node_modules/axios/lib/adapters/xhr.js +120 -13
- package/node_modules/axios/lib/core/Axios.js +67 -12
- package/node_modules/axios/lib/core/AxiosError.js +59 -0
- package/node_modules/axios/lib/core/AxiosHeaders.js +17 -4
- package/node_modules/axios/lib/core/InterceptorManager.js +13 -2
- package/node_modules/axios/lib/core/assertParamsAcyclic.js +49 -0
- package/node_modules/axios/lib/core/createMultipartBody.js +37 -0
- package/node_modules/axios/lib/core/dispatchRequest.js +20 -0
- package/node_modules/axios/lib/core/mergeConfig.js +183 -120
- package/node_modules/axios/lib/defaults/transitional.js +1 -0
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/AxiosTransformStream.js +11 -2
- package/node_modules/axios/lib/helpers/Http2Sessions.js +2 -1
- package/node_modules/axios/lib/helpers/composeSignals.js +6 -3
- package/node_modules/axios/lib/helpers/cookies.js +30 -6
- package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +34 -7
- package/node_modules/axios/lib/helpers/formDataToBlob.js +113 -0
- package/node_modules/axios/lib/helpers/formDataToJSON.js +25 -1
- package/node_modules/axios/lib/helpers/fromDataURI.js +8 -2
- package/node_modules/axios/lib/helpers/isURLSameOrigin.js +4 -9
- package/node_modules/axios/lib/helpers/parseHeaders.js +2 -1
- package/node_modules/axios/lib/helpers/parseProtocol.js +1 -1
- package/node_modules/axios/lib/helpers/resolveConfig.js +16 -3
- package/node_modules/axios/lib/helpers/shouldBypassProxy.js +16 -1
- package/node_modules/axios/lib/utils.js +61 -10
- package/node_modules/axios/package.json +1 -2
- package/node_modules/follow-redirects/README.md +27 -1
- package/node_modules/follow-redirects/index.js +1 -5
- package/node_modules/follow-redirects/package.json +1 -1
- package/node_modules/shell-quote/README.md +37 -4
- package/node_modules/shell-quote/package.json +10 -6
- package/node_modules/shell-quote/parse.d.ts +1 -1
- package/node_modules/shell-quote/parse.js +63 -11
- package/node_modules/shell-quote/quote.d.ts +2 -1
- package/node_modules/shell-quote/quote.js +23 -3
- package/node_modules/uuid/package.json +17 -17
- package/package.json +4 -6
- package/node_modules/async-lock/AUTHORS +0 -21
- package/node_modules/async-lock/History.md +0 -132
- package/node_modules/async-lock/LICENSE +0 -22
- package/node_modules/async-lock/README.md +0 -177
- package/node_modules/async-lock/index.js +0 -2
- package/node_modules/async-lock/lib/index.js +0 -312
- package/node_modules/async-lock/package.json +0 -48
- package/node_modules/asyncbox/build/cjs/lib/asyncbox.d.ts +0 -103
- package/node_modules/asyncbox/build/cjs/lib/asyncbox.d.ts.map +0 -1
- package/node_modules/asyncbox/build/cjs/lib/asyncbox.js +0 -311
- package/node_modules/asyncbox/build/cjs/lib/asyncbox.js.map +0 -1
- package/node_modules/asyncbox/build/esm/lib/asyncbox.d.ts +0 -103
- package/node_modules/asyncbox/build/esm/lib/asyncbox.d.ts.map +0 -1
- package/node_modules/asyncbox/build/esm/lib/asyncbox.js +0 -298
- package/node_modules/asyncbox/build/esm/lib/asyncbox.js.map +0 -1
- package/node_modules/asyncbox/lib/asyncbox.ts +0 -382
- package/node_modules/shell-quote/.nycrc +0 -14
- package/node_modules/shell-quote/eslint.config.mjs +0 -29
- package/node_modules/shell-quote/security.md +0 -11
- package/node_modules/shell-quote/test/comment.js +0 -16
- package/node_modules/shell-quote/test/env.js +0 -52
- package/node_modules/shell-quote/test/env_fn.js +0 -21
- package/node_modules/shell-quote/test/op.js +0 -102
- package/node_modules/shell-quote/test/parse.js +0 -149
- package/node_modules/shell-quote/test/quote.js +0 -145
- package/node_modules/shell-quote/test/set.js +0 -31
|
@@ -65,6 +65,29 @@ function arrayToObject(arr) {
|
|
|
65
65
|
return obj;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
+
function normalizeArray(value) {
|
|
69
|
+
if (!utils.isArray(value)) return value;
|
|
70
|
+
|
|
71
|
+
const keys = Object.keys(value);
|
|
72
|
+
return keys.length !== value.length || keys.some((key, index) => key !== String(index))
|
|
73
|
+
? arrayToObject(value)
|
|
74
|
+
: value;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function normalizeArrays(obj) {
|
|
78
|
+
const pending = [obj];
|
|
79
|
+
while (pending.length) {
|
|
80
|
+
const target = pending.pop();
|
|
81
|
+
Object.keys(target).forEach((key) => {
|
|
82
|
+
const value = (target[key] = normalizeArray(target[key]));
|
|
83
|
+
if (utils.isArray(value) || utils.isPlainObject(value)) {
|
|
84
|
+
pending.push(value);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
return obj;
|
|
89
|
+
}
|
|
90
|
+
|
|
68
91
|
/**
|
|
69
92
|
* It takes a FormData object and returns a JavaScript object
|
|
70
93
|
*
|
|
@@ -86,6 +109,7 @@ function formDataToJSON(formData) {
|
|
|
86
109
|
|
|
87
110
|
if (isLast) {
|
|
88
111
|
if (utils.hasOwnProp(target, name)) {
|
|
112
|
+
target[name] = normalizeArray(target[name]);
|
|
89
113
|
target[name] = utils.isArray(target[name])
|
|
90
114
|
? target[name].concat(value)
|
|
91
115
|
: [target[name], value];
|
|
@@ -116,7 +140,7 @@ function formDataToJSON(formData) {
|
|
|
116
140
|
buildPath(parsePropPath(name), value, obj, 0);
|
|
117
141
|
});
|
|
118
142
|
|
|
119
|
-
return obj;
|
|
143
|
+
return normalizeArrays(obj);
|
|
120
144
|
}
|
|
121
145
|
|
|
122
146
|
return null;
|
|
@@ -6,7 +6,10 @@ import platform from '../platform/index.js';
|
|
|
6
6
|
|
|
7
7
|
// RFC 2397: data:[<mediatype>][;base64],<data>
|
|
8
8
|
// mediatype = type/subtype followed by optional ;name=value parameters
|
|
9
|
-
|
|
9
|
+
// The `i` flag makes the `;base64` token case-insensitive, matching the WHATWG
|
|
10
|
+
// URL/Fetch data URL processor (and therefore the fetch adapter and browsers).
|
|
11
|
+
// The remaining character classes do not depend on letter case.
|
|
12
|
+
const DATA_URL_PATTERN = /^([^,;/]+\/[^,;/]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/i;
|
|
10
13
|
|
|
11
14
|
/**
|
|
12
15
|
* Parse data uri to a Buffer or Blob
|
|
@@ -51,7 +54,10 @@ export default function fromDataURI(uri, asBlob, options) {
|
|
|
51
54
|
|
|
52
55
|
const buffer =
|
|
53
56
|
encoding === 'base64'
|
|
54
|
-
? Buffer.from(
|
|
57
|
+
? Buffer.from(
|
|
58
|
+
body.replace(/%([\da-f]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16))),
|
|
59
|
+
'base64'
|
|
60
|
+
)
|
|
55
61
|
: Buffer.from(decodeURIComponent(body), encoding);
|
|
56
62
|
|
|
57
63
|
if (asBlob) {
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import platform from '../platform/index.js';
|
|
2
2
|
|
|
3
3
|
export default platform.hasStandardBrowserEnv
|
|
4
|
-
? ((origin
|
|
5
|
-
url = new URL(url, platform.origin);
|
|
4
|
+
? ((origin) => (url) => {
|
|
5
|
+
url = new URL(url, document.baseURI || platform.origin);
|
|
6
6
|
|
|
7
7
|
return (
|
|
8
|
-
origin.protocol === url.protocol &&
|
|
9
|
-
origin.host === url.host &&
|
|
10
|
-
(isMSIE || origin.port === url.port)
|
|
8
|
+
origin.protocol === url.protocol && origin.host === url.host && origin.port === url.port
|
|
11
9
|
);
|
|
12
|
-
})(
|
|
13
|
-
new URL(platform.origin),
|
|
14
|
-
platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
|
|
15
|
-
)
|
|
10
|
+
})(new URL(platform.origin))
|
|
16
11
|
: () => true;
|
|
@@ -39,7 +39,8 @@ const ignoreDuplicateOf = utils.toObjectSet([
|
|
|
39
39
|
* @returns {Object} Headers parsed into an object
|
|
40
40
|
*/
|
|
41
41
|
export default (rawHeaders) => {
|
|
42
|
-
|
|
42
|
+
// Header names are data, including __proto__; avoid inherited setters.
|
|
43
|
+
const parsed = Object.create(null);
|
|
43
44
|
let key;
|
|
44
45
|
let val;
|
|
45
46
|
let i;
|
|
@@ -22,7 +22,9 @@ const encodeUTF8 = (str) =>
|
|
|
22
22
|
String.fromCharCode(parseInt(hex, 16))
|
|
23
23
|
);
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
const readCookie = (name) => cookies.read(name);
|
|
26
|
+
|
|
27
|
+
function resolveConfig(config, readXsrfCookie = readCookie) {
|
|
26
28
|
const newConfig = mergeConfig({}, config);
|
|
27
29
|
|
|
28
30
|
// Read only own properties to prevent prototype pollution gadgets
|
|
@@ -51,11 +53,22 @@ function resolveConfig(config) {
|
|
|
51
53
|
if (auth) {
|
|
52
54
|
const username = utils.getSafeProp(auth, 'username') || '';
|
|
53
55
|
const password = utils.getSafeProp(auth, 'password') || '';
|
|
56
|
+
const transitional = own('transitional');
|
|
57
|
+
const encodeUsername =
|
|
58
|
+
transitional &&
|
|
59
|
+
utils.hasOwnProp(transitional, 'encodeBasicAuthUsername') &&
|
|
60
|
+
transitional.encodeBasicAuthUsername === true;
|
|
54
61
|
|
|
55
62
|
try {
|
|
56
63
|
headers.set(
|
|
57
64
|
'Authorization',
|
|
58
|
-
|
|
65
|
+
// Preserve legacy username bytes unless the caller opts in to UTF-8.
|
|
66
|
+
'Basic ' +
|
|
67
|
+
btoa(
|
|
68
|
+
(encodeUsername ? encodeUTF8(username) : username) +
|
|
69
|
+
':' +
|
|
70
|
+
(password ? encodeUTF8(password) : '')
|
|
71
|
+
)
|
|
59
72
|
);
|
|
60
73
|
} catch (e) {
|
|
61
74
|
throw AxiosError.from(e, AxiosError.ERR_BAD_OPTION_VALUE, config);
|
|
@@ -93,7 +106,7 @@ function resolveConfig(config) {
|
|
|
93
106
|
withXSRFToken === true || (withXSRFToken == null && isURLSameOrigin(newConfig.url));
|
|
94
107
|
|
|
95
108
|
if (shouldSendXSRF) {
|
|
96
|
-
const xsrfValue = xsrfHeaderName && xsrfCookieName &&
|
|
109
|
+
const xsrfValue = xsrfHeaderName && xsrfCookieName && readXsrfCookie(xsrfCookieName);
|
|
97
110
|
|
|
98
111
|
if (xsrfValue) {
|
|
99
112
|
headers.set(xsrfHeaderName, xsrfValue);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { domainToASCII } from 'url';
|
|
2
|
+
|
|
1
3
|
const LOOPBACK_HOSTNAMES = new Set(['localhost', '0.0.0.0']);
|
|
2
4
|
|
|
3
5
|
const trimTrailingDots = (value) => {
|
|
@@ -319,7 +321,20 @@ const normalizeNoProxyHost = (hostname) => {
|
|
|
319
321
|
hostname = hostname.slice(1, -1);
|
|
320
322
|
}
|
|
321
323
|
|
|
322
|
-
|
|
324
|
+
let trimmed = trimTrailingDots(hostname);
|
|
325
|
+
if (trimmed.indexOf(':') !== -1) {
|
|
326
|
+
try {
|
|
327
|
+
trimmed = new URL('http://[' + trimmed + ']/').hostname.slice(1, -1);
|
|
328
|
+
} catch (_err) {
|
|
329
|
+
return trimmed;
|
|
330
|
+
}
|
|
331
|
+
} else if (/[\u0080-\uffff]/.test(trimmed)) {
|
|
332
|
+
const prefix = /^[*.]+/.exec(trimmed);
|
|
333
|
+
const start = prefix ? prefix[0] : '';
|
|
334
|
+
const ascii = domainToASCII(trimmed.slice(start.length));
|
|
335
|
+
if (!ascii) return '';
|
|
336
|
+
trimmed = start + trimTrailingDots(ascii);
|
|
337
|
+
}
|
|
323
338
|
|
|
324
339
|
// IPv4 shorthand/octal/hex → dotted-decimal; helper is a no-op for inputs
|
|
325
340
|
// containing ':' (IPv6 and IPv4-mapped IPv6) so we fall through to unmap.
|
|
@@ -313,11 +313,17 @@ const isPlainObject = (val) => {
|
|
|
313
313
|
const prototype = getPrototypeOf(val);
|
|
314
314
|
return (
|
|
315
315
|
(prototype === null || prototype === Object.prototype || getPrototypeOf(prototype) === null) &&
|
|
316
|
-
// Treat
|
|
317
|
-
//
|
|
318
|
-
//
|
|
319
|
-
|
|
320
|
-
|
|
316
|
+
// Treat own Symbol.toStringTag or Symbol.iterator members as evidence the
|
|
317
|
+
// value is tagged/iterable, ignoring members reachable only through shared
|
|
318
|
+
// or terminal prototype boundaries. This is exactly what
|
|
319
|
+
// hasOwnInPrototypeChain(val, prop) computes here: every prototype admitted
|
|
320
|
+
// above (null, Object.prototype, or a terminal null-prototype template) is
|
|
321
|
+
// a boundary, so the walk never inspects anything but `val`'s own members,
|
|
322
|
+
// and stops before even those when `val` is itself the boundary
|
|
323
|
+
// Object.prototype. Checking that inline avoids allocating the walker's
|
|
324
|
+
// `seen` list twice per call on the mergeConfig / merge hot path.
|
|
325
|
+
(isPrototypeBoundary(val, prototype, true) ||
|
|
326
|
+
(!hasOwnProperty(val, toStringTag) && !hasOwnProperty(val, iterator)))
|
|
321
327
|
);
|
|
322
328
|
};
|
|
323
329
|
|
|
@@ -581,15 +587,30 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob
|
|
|
581
587
|
function merge(...objs) {
|
|
582
588
|
const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};
|
|
583
589
|
const result = {};
|
|
590
|
+
// Caseless lookup only applies to string keys — symbol keys are
|
|
591
|
+
// identity-matched. Every string key that reaches `result` passes through
|
|
592
|
+
// this index first, so it can never hold two case variants of one key and a
|
|
593
|
+
// lowercase -> key map is exactly what findKey(result, key) would rescan
|
|
594
|
+
// Object.keys(result) for on each assignment.
|
|
595
|
+
const lowerCaseKeys = caseless ? Object.create(null) : null;
|
|
584
596
|
const assignValue = (val, key) => {
|
|
585
597
|
// Skip dangerous property names to prevent prototype pollution
|
|
586
598
|
if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
|
|
587
599
|
return;
|
|
588
600
|
}
|
|
589
601
|
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
602
|
+
let targetKey = key;
|
|
603
|
+
if (lowerCaseKeys && typeof key === 'string') {
|
|
604
|
+
const lowerKey = key.toLowerCase();
|
|
605
|
+
const knownKey = lowerCaseKeys[lowerKey];
|
|
606
|
+
// A key recorded but absent from `result` was skipped by skipUndefined;
|
|
607
|
+
// the later spelling wins then, as it does for findKey.
|
|
608
|
+
if (knownKey !== undefined && hasOwnProperty(result, knownKey)) {
|
|
609
|
+
targetKey = knownKey;
|
|
610
|
+
} else {
|
|
611
|
+
lowerCaseKeys[lowerKey] = key;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
593
614
|
// Read via own-prop only — a bare `result[targetKey]` walks the prototype
|
|
594
615
|
// chain, so a polluted Object.prototype value could surface here and get
|
|
595
616
|
// copied into the merged result.
|
|
@@ -613,7 +634,7 @@ function merge(...objs) {
|
|
|
613
634
|
|
|
614
635
|
forEach(source, assignValue);
|
|
615
636
|
|
|
616
|
-
if (typeof source !== 'object' || isArray(source)) {
|
|
637
|
+
if (typeof source !== 'object' || isArray(source) || !Object.getOwnPropertySymbols) {
|
|
617
638
|
continue;
|
|
618
639
|
}
|
|
619
640
|
|
|
@@ -772,7 +793,37 @@ const toArray = (thing) => {
|
|
|
772
793
|
if (!thing) return null;
|
|
773
794
|
if (isArray(thing)) return thing;
|
|
774
795
|
let i = thing.length;
|
|
775
|
-
if (!
|
|
796
|
+
if (!Number.isSafeInteger(i) || i < 0 || i > 0xffffffff) return null;
|
|
797
|
+
|
|
798
|
+
// Bound the copy by actual indexed properties, including hidden and inherited
|
|
799
|
+
// members of array-like collections, rather than by the declared length alone.
|
|
800
|
+
const indexes = new Set();
|
|
801
|
+
const seen = new Set();
|
|
802
|
+
let source = thing;
|
|
803
|
+
|
|
804
|
+
while (source != null && indexes.size < i) {
|
|
805
|
+
if (seen.has(source)) return null;
|
|
806
|
+
seen.add(source);
|
|
807
|
+
|
|
808
|
+
const prototype = getPrototypeOf(source);
|
|
809
|
+
if (isPrototypeBoundary(source, prototype, source === thing)) break;
|
|
810
|
+
|
|
811
|
+
Object.getOwnPropertyNames(source).forEach((key) => {
|
|
812
|
+
const index = +key;
|
|
813
|
+
if (
|
|
814
|
+
Number.isInteger(index) &&
|
|
815
|
+
index >= 0 &&
|
|
816
|
+
index < i &&
|
|
817
|
+
String(index) === key &&
|
|
818
|
+
hasOwnProperty(source, key)
|
|
819
|
+
) {
|
|
820
|
+
indexes.add(index);
|
|
821
|
+
}
|
|
822
|
+
});
|
|
823
|
+
source = prototype;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
if (indexes.size !== i) return null;
|
|
776
827
|
const arr = new Array(i);
|
|
777
828
|
while (i-- > 0) {
|
|
778
829
|
arr[i] = thing[i];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "axios",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.0",
|
|
4
4
|
"description": "Promise based HTTP client for the browser and node.js",
|
|
5
5
|
"main": "./dist/node/axios.cjs",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -161,7 +161,6 @@
|
|
|
161
161
|
"abortcontroller-polyfill": "^1.7.8",
|
|
162
162
|
"acorn": "^8.17.0",
|
|
163
163
|
"body-parser": "^2.3.0",
|
|
164
|
-
"chalk": "^5.6.2",
|
|
165
164
|
"cross-env": "^10.1.0",
|
|
166
165
|
"dev-null": "^0.1.1",
|
|
167
166
|
"eslint": "^10.6.0",
|
|
@@ -1,4 +1,30 @@
|
|
|
1
|
-
##
|
|
1
|
+
## _Follow Redirects_ is in need of funding
|
|
2
|
+
|
|
3
|
+
> [!IMPORTANT]
|
|
4
|
+
> **Maintenance paused until funding found.**
|
|
5
|
+
>
|
|
6
|
+
> follow-redirects is downloaded over 400 million times per month,
|
|
7
|
+
> It has been maintained for over ten years by one volunteer,
|
|
8
|
+
> who has no funds to provide update and security guarantees.
|
|
9
|
+
>
|
|
10
|
+
> **What this means for you:**
|
|
11
|
+
> the package stays published and keeps working as it does today,
|
|
12
|
+
> but there are no guarantees of bug fixes, security fixes,
|
|
13
|
+
> or replies to issues and pull requests.
|
|
14
|
+
> Security reports are handled best-effort only; see [SECURITY.md](SECURITY.md).
|
|
15
|
+
>
|
|
16
|
+
> **What can restart maintenance:**
|
|
17
|
+
> Even if only 0.1% of downloads paid $0.01, we'd be fully funded
|
|
18
|
+
> with $4000 per month.
|
|
19
|
+
> That's not the case, and that's okay,
|
|
20
|
+
> but unfortunately also insufficient to continue.
|
|
21
|
+
> We need to cover security triage, CVE handling, fixes, and releases.
|
|
22
|
+
> Progress toward that goal will be posted here.
|
|
23
|
+
>
|
|
24
|
+
> **If your company depends on follow-redirects,**
|
|
25
|
+
> directly or another library,
|
|
26
|
+
> please [sponsor on GitHub](https://github.com/sponsors/RubenVerborgh)
|
|
27
|
+
> or email us for invoice-based funding or a security support agreement.
|
|
2
28
|
|
|
3
29
|
Drop-in replacement for Node's `http` and `https` modules that automatically follows redirects.
|
|
4
30
|
|
|
@@ -311,7 +311,7 @@ RedirectableRequest.prototype._sanitizeOptions = function (options) {
|
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
313
|
// Ensure sensitive headers are always present
|
|
314
|
-
if (!isArray(options.sensitiveHeaders)) {
|
|
314
|
+
if (!Array.isArray(options.sensitiveHeaders)) {
|
|
315
315
|
options.sensitiveHeaders = [];
|
|
316
316
|
}
|
|
317
317
|
|
|
@@ -689,10 +689,6 @@ function isSubdomain(subdomain, domain) {
|
|
|
689
689
|
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
|
|
690
690
|
}
|
|
691
691
|
|
|
692
|
-
function isArray(value) {
|
|
693
|
-
return value instanceof Array;
|
|
694
|
-
}
|
|
695
|
-
|
|
696
692
|
function isString(value) {
|
|
697
693
|
return typeof value === "string" || value instanceof String;
|
|
698
694
|
}
|
|
@@ -39,6 +39,20 @@ output
|
|
|
39
39
|
[ 'a', 'b c', '$def', "it's great" ]
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
+
## parse with ANSI-C quoting
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
var parse = require('shell-quote/parse');
|
|
46
|
+
var xs = parse("echo $'it\\'s a \\n test'");
|
|
47
|
+
console.dir(xs);
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
output
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
[ 'echo', "it's a \n test" ]
|
|
54
|
+
```
|
|
55
|
+
|
|
42
56
|
## parse with an environment variable
|
|
43
57
|
|
|
44
58
|
```js
|
|
@@ -123,10 +137,13 @@ commands.
|
|
|
123
137
|
|
|
124
138
|
Each entry of `args` may be a string, or one of the object shapes that
|
|
125
139
|
`parse` emits: `{ op }` (where `op` is one of the control operators
|
|
126
|
-
`||`, `&&`, `;;`, `|&`, `<(`, `<<<`,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
140
|
+
`||`, `&&`, `;;&`, `;;`, `;&`, `|&`, `<(`, `>(`, `<<<`, `<<-`,
|
|
141
|
+
`<<`, `>>`, `>&`, `>|`, `&>>`, `&>`, `<&`, `<>`, `&`, `;`, `(`,
|
|
142
|
+
`)`, `|`, `<`, `>`),
|
|
143
|
+
`{ op: 'glob', pattern }`, or `{ comment }`. Any
|
|
144
|
+
other object shape, an unrecognized `op`, a `pattern`/`comment`
|
|
145
|
+
containing line terminators, or a string containing line terminators
|
|
146
|
+
anywhere after a `{ comment }` throws a `TypeError`.
|
|
130
147
|
|
|
131
148
|
The output is POSIX shell (`sh`/`bash`) quoting.
|
|
132
149
|
It is not valid for Windows `cmd.exe` or PowerShell,
|
|
@@ -158,6 +175,15 @@ Pass a string to use its characters as the `IFS` instead
|
|
|
158
175
|
(for example `{ splitUnquoted: ':' }`).
|
|
159
176
|
A quoted expansion (`"$VAR"`) is never split.
|
|
160
177
|
|
|
178
|
+
Bash [ANSI-C quoting](https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html)
|
|
179
|
+
(`$'...'`) is supported: escape sequences (such as `\n`, `\t`, `\\`, `\'`, `\"`,
|
|
180
|
+
`\xHH`, `\uHHHH`, `\UHHHHHHHH`, `\nnn`, and `\cx`) are decoded, an unrecognized
|
|
181
|
+
escape keeps its backslash, and the contents are never word-split and never
|
|
182
|
+
variable-expanded, so `${VAR}` inside `$'...'` stays literal. As in bash,
|
|
183
|
+
`$'...'` is not special inside double or single quotes, and a NUL ends the string.
|
|
184
|
+
Since the result is a JavaScript string, `\xHH` and `\nnn` produce the character
|
|
185
|
+
with that code (U+0000 to U+00FF), not a raw byte.
|
|
186
|
+
|
|
161
187
|
Only simple `$VARNAME` and `${VARNAME}` interpolation is supported.
|
|
162
188
|
Bash parameter expansion beyond a plain variable name is not evaluated:
|
|
163
189
|
forms such as array subscripts (`${arr[i]}`), length (`${#arr[@]}`),
|
|
@@ -186,6 +212,13 @@ parses as:
|
|
|
186
212
|
[ 'beep', { op: '||' }, 'boop', { op: '>' }, '/byte' ]
|
|
187
213
|
```
|
|
188
214
|
|
|
215
|
+
The here-document operators (`<<` and `<<-`) are emitted like any other operator,
|
|
216
|
+
followed by the delimiter word.
|
|
217
|
+
The here-document body is not recognized:
|
|
218
|
+
a newline is whitespace to `parse`,
|
|
219
|
+
so the lines after the command are parsed as ordinary tokens,
|
|
220
|
+
subject to quoting, comments, globs, and variable expansion.
|
|
221
|
+
|
|
189
222
|
# install
|
|
190
223
|
|
|
191
224
|
With [npm](http://npmjs.org) do:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shell-quote",
|
|
3
3
|
"description": "quote and parse shell commands",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.12.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "James Halliday",
|
|
7
7
|
"email": "mail@substack.net",
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
44
|
-
"@ljharb/eslint-config": "^22.2.
|
|
44
|
+
"@ljharb/eslint-config": "^22.2.5",
|
|
45
45
|
"@ljharb/tsconfig": "^0.3.2",
|
|
46
|
-
"auto-changelog": "^2.
|
|
47
|
-
"eslint": "^10.
|
|
48
|
-
"evalmd": "^0.0.
|
|
46
|
+
"auto-changelog": "^2.7.0",
|
|
47
|
+
"eslint": "^10.11.0",
|
|
48
|
+
"evalmd": "^0.0.22",
|
|
49
49
|
"in-publish": "^2.0.1",
|
|
50
50
|
"jiti": "^0.0.0",
|
|
51
51
|
"npmignore": "^0.3.5",
|
|
@@ -66,8 +66,12 @@
|
|
|
66
66
|
"publishConfig": {
|
|
67
67
|
"ignore": [
|
|
68
68
|
".github/workflows",
|
|
69
|
+
".nycrc",
|
|
70
|
+
"eslint.config.mjs",
|
|
69
71
|
"example",
|
|
70
|
-
"CHANGELOG.md"
|
|
72
|
+
"CHANGELOG.md",
|
|
73
|
+
"security.md",
|
|
74
|
+
"test"
|
|
71
75
|
]
|
|
72
76
|
},
|
|
73
77
|
"engines": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare namespace parse {
|
|
2
2
|
/** A shell control operator. */
|
|
3
3
|
export interface ControlOperator {
|
|
4
|
-
op: '||' | '&&' | ';;' | '|&' | '<(' | '<<<' | '>>' | '>&' | '<&' | '&' | ';' | '(' | ')' | '|' | '<' | '>';
|
|
4
|
+
op: '||' | '&&' | ';;&' | ';;' | ';&' | '|&' | '<(' | '>(' | '<<<' | '<<-' | '<<' | '>>' | '>&' | '>|' | '&>>' | '&>' | '<&' | '<>' | '&' | ';' | '(' | ')' | '|' | '<' | '>';
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
/** A glob pattern parsed from the shell command. */
|
|
@@ -8,24 +8,31 @@
|
|
|
8
8
|
* ParseEntry,
|
|
9
9
|
* } from './parse' */
|
|
10
10
|
|
|
11
|
-
// '<('
|
|
11
|
+
// '<(' and '>(' are process substitution operators and
|
|
12
12
|
// can be parsed the same as control operator
|
|
13
13
|
var CONTROL = /** @type {const} */ ('(?:') + /** @type {const} */ ([
|
|
14
14
|
'\\|\\|',
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'
|
|
15
|
+
'\\&(?:\\&|>>?)', // `&&`, `&>`, and `&>>`
|
|
16
|
+
';;\\&?', // `;;` and `;;&`
|
|
17
|
+
'[;|]\\&', // `;&` and `|&`
|
|
18
18
|
'\\<\\(',
|
|
19
19
|
'\\<\\<\\<',
|
|
20
|
+
'\\<\\<-',
|
|
21
|
+
'\\<\\<(?!\\()', // `<<(` stays `<` and `<(`, as zsh reads it; other shells reject it
|
|
20
22
|
'>>',
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
+
'>[&|(]', // `>&`, `>|`, and `>(`
|
|
24
|
+
'<[&>]', // `<&` and `<>`
|
|
23
25
|
'[&;()|<>]'
|
|
24
26
|
]).join(/** @type {const} */ ('|')) + /** @type {const} */ (')');
|
|
25
27
|
var controlRE = new RegExp('^' + CONTROL + '$');
|
|
26
28
|
var META = /** @type {const} */ ('|&;()<> \\t');
|
|
27
29
|
var SINGLE_QUOTE = /** @type {const} */ ('\'([^\']*?)\'');
|
|
28
|
-
|
|
30
|
+
// bash ANSI-C quoting, `$'...'`: a backslash escapes the next character, including `'`
|
|
31
|
+
var ANSI_C_BODY = '(?:\\\\[\\s\\S]|[^\\\\\'])*?';
|
|
32
|
+
var ANSI_C_QUOTE = '\\$\'' + ANSI_C_BODY + '\'';
|
|
33
|
+
var ansiCAt = new RegExp('\\$\'' + ANSI_C_BODY + '(?:(\')|\\\\?$)', 'g');
|
|
34
|
+
var ANSI_C_LETTERS = 'abeEfnrtv';
|
|
35
|
+
var ANSI_C_CHARS = '\x07\b\x1B\x1B\f\n\r\t\v';
|
|
29
36
|
var hash = /^#$/;
|
|
30
37
|
|
|
31
38
|
var SQ = /** @type {const} */ ("'");
|
|
@@ -80,6 +87,46 @@ function getVar(env, pre, key) {
|
|
|
80
87
|
return pre + r;
|
|
81
88
|
}
|
|
82
89
|
|
|
90
|
+
var ansiCEscape = /\\([0-7]{1,3}|x[\dA-Fa-f]{1,2}|u[\dA-Fa-f]{1,4}|U[\dA-Fa-f]{1,8}|c(?:\\\\|[\s\S])|[abeEfnrtv\\'"?])/g;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @param {string} m
|
|
94
|
+
* @param {string} escape
|
|
95
|
+
*/
|
|
96
|
+
function expandAnsiCEscape(m, escape) {
|
|
97
|
+
var kind = escape.charAt(0);
|
|
98
|
+
if (kind === 'c') {
|
|
99
|
+
var ctrl = escape.charAt(1);
|
|
100
|
+
return ctrl === '?' ? '\x7F' : String.fromCharCode(ctrl.charCodeAt(0) & 0x1F);
|
|
101
|
+
}
|
|
102
|
+
if (kind === 'x' || kind === 'u' || kind === 'U') {
|
|
103
|
+
var cp = parseInt(escape.slice(1), 16);
|
|
104
|
+
if (cp > 0x10FFFF) {
|
|
105
|
+
return m;
|
|
106
|
+
}
|
|
107
|
+
return String.fromCharCode.apply(null, cp > 0xFFFF ? [0xD7C0 + (cp >> 10), 0xDC00 + (cp & 0x3FF)] : [cp]);
|
|
108
|
+
}
|
|
109
|
+
if (kind >= '0' && kind <= '7') {
|
|
110
|
+
return String.fromCharCode(parseInt(escape, 8) & 0xFF);
|
|
111
|
+
}
|
|
112
|
+
var letter = ANSI_C_LETTERS.indexOf(escape);
|
|
113
|
+
return letter < 0 ? escape : ANSI_C_CHARS.charAt(letter);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** @param {string} body */
|
|
117
|
+
function expandAnsiC(body) {
|
|
118
|
+
return body.replace(ansiCEscape, expandAnsiCEscape).split('\0')[0]; // like bash, a NUL ends the string
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* @param {string} s
|
|
123
|
+
* @param {number} i
|
|
124
|
+
*/
|
|
125
|
+
function closesAnsiC(s, i) {
|
|
126
|
+
ansiCAt.lastIndex = i;
|
|
127
|
+
return !!(/** @type {RegExpExecArray} */ (ansiCAt.exec(s)))[1];
|
|
128
|
+
}
|
|
129
|
+
|
|
83
130
|
/**
|
|
84
131
|
* @param {string} string
|
|
85
132
|
* @param {Env} [env]
|
|
@@ -92,11 +139,12 @@ function parseInternal(string, env, opts) {
|
|
|
92
139
|
}
|
|
93
140
|
var BS = opts.escape || '\\';
|
|
94
141
|
var ifs = opts.splitUnquoted === true ? ' \t\n' : (typeof opts.splitUnquoted === 'string' ? opts.splitUnquoted : '');
|
|
95
|
-
var BAREWORD = '(\\' + BS + '[\'"' + META + ']|[^\\s\'"' + META + '])+';
|
|
142
|
+
var BAREWORD = '(\\' + BS + '[\'"$\\' + BS + META + ']|\\$\\$|\\$(?!' + ANSI_C_QUOTE.slice(2) + ')|[^\\s\'"$' + META + '])+';
|
|
143
|
+
var DOUBLE_QUOTE = '"(?:\\' + BS + '[\\s\\S]|[^"\\' + BS + '])*"';
|
|
96
144
|
|
|
97
145
|
var chunker = new RegExp([
|
|
98
146
|
'(' + CONTROL + ')', // control chars
|
|
99
|
-
'(' + BAREWORD + '|' + DOUBLE_QUOTE + '|' + SINGLE_QUOTE + ')+'
|
|
147
|
+
'(' + ANSI_C_QUOTE + '|' + BAREWORD + '|' + DOUBLE_QUOTE + '|' + SINGLE_QUOTE + ')+'
|
|
100
148
|
].join('|'), 'g');
|
|
101
149
|
|
|
102
150
|
var matches = matchAll(string, chunker);
|
|
@@ -173,9 +221,8 @@ function parseInternal(string, env, opts) {
|
|
|
173
221
|
varend -= 1;
|
|
174
222
|
varname = s.slice(i, varend);
|
|
175
223
|
i = varend;
|
|
176
|
-
} else if ((/[
|
|
224
|
+
} else if ((/[*@#?$!-]/).test(char)) {
|
|
177
225
|
varname = char;
|
|
178
|
-
i += 1;
|
|
179
226
|
} else {
|
|
180
227
|
var slicedFromI = s.slice(i);
|
|
181
228
|
varend = slicedFromI.match(/[^\w\d_]/);
|
|
@@ -252,6 +299,11 @@ function parseInternal(string, env, opts) {
|
|
|
252
299
|
return /** @type {const} */ ([commentObj]);
|
|
253
300
|
} else if (c === BS) {
|
|
254
301
|
esc = true;
|
|
302
|
+
} else if (c === DS && s.charAt(i + 1) === SQ && closesAnsiC(s, i)) {
|
|
303
|
+
flushRun();
|
|
304
|
+
sawQuote = true;
|
|
305
|
+
out += expandAnsiC(s.slice(i + 2, ansiCAt.lastIndex - 1));
|
|
306
|
+
i = ansiCAt.lastIndex - 1;
|
|
255
307
|
} else if (c === DS) {
|
|
256
308
|
var value = parseEnvVar();
|
|
257
309
|
if (!ifs) {
|
|
@@ -5,7 +5,8 @@ import parse = require('./parse');
|
|
|
5
5
|
*
|
|
6
6
|
* Accepts strings and the object shapes that {@link parse} emits. Throws a
|
|
7
7
|
* `TypeError` for unrecognized object shapes, `op` values outside the
|
|
8
|
-
* allowlist,
|
|
8
|
+
* allowlist, `pattern`/`comment` values containing line terminators, or
|
|
9
|
+
* strings containing line terminators anywhere after a `comment`.
|
|
9
10
|
*
|
|
10
11
|
* @param args - Array of tokens to quote.
|
|
11
12
|
* @returns A shell-safe quoted string.
|