appium-mac2-driver 4.4.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 +16 -0
- package/WebDriverAgentMac/IntegrationTests/AMWindowTests.m +427 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Commands/AMWindowCommands.m +63 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Commands/FBDebugCommands.m +2 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Routing/FBCommandStatus.h +3 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Routing/FBCommandStatus.m +13 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Utilities/AMScreenUtils.h +4 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Utilities/AMScreenUtils.m +23 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Utilities/AMSnapshotUtils.h +18 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Utilities/AMSnapshotUtils.m +43 -28
- package/WebDriverAgentMac/WebDriverAgentLib/Utilities/AMWindowUtils.h +111 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Utilities/AMWindowUtils.m +780 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Utilities/AMXCTAccessibility.h +61 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Utilities/AMXCTAccessibility.m +108 -0
- package/WebDriverAgentMac/WebDriverAgentMac.xcodeproj/project.pbxproj +20 -0
- package/build/lib/commands/native-record-screen.d.ts +2 -0
- package/build/lib/commands/native-record-screen.d.ts.map +1 -1
- package/build/lib/commands/native-record-screen.js.map +1 -1
- package/build/lib/commands/windows.d.ts +22 -0
- package/build/lib/commands/windows.d.ts.map +1 -0
- package/build/lib/commands/windows.js +32 -0
- package/build/lib/commands/windows.js.map +1 -0
- package/build/lib/driver.d.ts +12 -0
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +3 -0
- package/build/lib/driver.js.map +1 -1
- package/build/lib/execute-method-map.d.ts +9 -0
- package/build/lib/execute-method-map.d.ts.map +1 -1
- package/build/lib/execute-method-map.js +9 -0
- package/build/lib/execute-method-map.js.map +1 -1
- 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/types.d.ts +26 -0
- package/build/lib/types.d.ts.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/commands/native-record-screen.ts +2 -0
- package/lib/commands/windows.ts +44 -0
- package/lib/driver.ts +4 -0
- package/lib/execute-method-map.ts +9 -0
- package/lib/session-claim-handler.ts +1 -2
- package/lib/types.ts +28 -0
- 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/bare-url/README.md +4 -0
- package/node_modules/bare-url/index.d.ts +3 -0
- package/node_modules/bare-url/index.js +42 -18
- package/node_modules/bare-url/lib/errors.js +4 -0
- package/node_modules/bare-url/package.json +1 -1
- package/node_modules/bare-url/prebuilds/android-arm/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/android-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/android-ia32/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/android-x64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/darwin-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/darwin-x64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/ios-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/ios-arm64-simulator/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/ios-x64-simulator/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/linux-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/linux-x64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/win32-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/win32-x64/bare-url.bare +0 -0
- 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 +6 -7
- package/scripts/setup-accessibility.mjs +175 -0
- 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
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import ljharb from '@ljharb/eslint-config/flat';
|
|
2
|
-
|
|
3
|
-
export default [
|
|
4
|
-
...ljharb,
|
|
5
|
-
{
|
|
6
|
-
rules: {
|
|
7
|
-
'array-bracket-newline': 'off',
|
|
8
|
-
complexity: 'off',
|
|
9
|
-
eqeqeq: 'warn',
|
|
10
|
-
'func-style': ['error', 'declaration'],
|
|
11
|
-
'max-depth': 'off',
|
|
12
|
-
'max-lines-per-function': 'off',
|
|
13
|
-
'max-statements': 'off',
|
|
14
|
-
'multiline-comment-style': 'off',
|
|
15
|
-
'no-extra-parens': 'off',
|
|
16
|
-
'no-lonely-if': 'warn',
|
|
17
|
-
'no-negated-condition': 'warn',
|
|
18
|
-
'no-param-reassign': 'warn',
|
|
19
|
-
'no-shadow': 'warn',
|
|
20
|
-
'no-template-curly-in-string': 'off',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
files: ['example/**'],
|
|
25
|
-
rules: {
|
|
26
|
-
'no-console': 'off',
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
];
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# Security Policy
|
|
2
|
-
|
|
3
|
-
## Supported Versions
|
|
4
|
-
|
|
5
|
-
Only the latest major version is supported at any given time.
|
|
6
|
-
|
|
7
|
-
## Reporting a Vulnerability
|
|
8
|
-
|
|
9
|
-
To report a security vulnerability, please use the
|
|
10
|
-
[Tidelift security contact](https://tidelift.com/security).
|
|
11
|
-
Tidelift will coordinate the fix and disclosure.
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var test = require('tape');
|
|
4
|
-
var parse = require('../').parse;
|
|
5
|
-
|
|
6
|
-
test('comment', function (t) {
|
|
7
|
-
t.same(parse('beep#boop'), ['beep', { comment: 'boop' }]);
|
|
8
|
-
t.same(parse('beep #boop'), ['beep', { comment: 'boop' }]);
|
|
9
|
-
t.same(parse('beep # boop'), ['beep', { comment: ' boop' }]);
|
|
10
|
-
t.same(parse('beep # > boop'), ['beep', { comment: ' > boop' }]);
|
|
11
|
-
t.same(parse('beep # "> boop"'), ['beep', { comment: ' "> boop"' }]);
|
|
12
|
-
t.same(parse('beep "#"'), ['beep', '#']);
|
|
13
|
-
t.same(parse('beep #"#"#'), ['beep', { comment: '"#"#' }]);
|
|
14
|
-
t.same(parse('beep > boop # > foo'), ['beep', { op: '>' }, 'boop', { comment: ' > foo' }]);
|
|
15
|
-
t.end();
|
|
16
|
-
});
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var test = require('tape');
|
|
4
|
-
var parse = require('../').parse;
|
|
5
|
-
|
|
6
|
-
test('expand environment variables', function (t) {
|
|
7
|
-
t.same(parse('a $XYZ c', { XYZ: 'b' }), ['a', 'b', 'c']);
|
|
8
|
-
t.same(parse('a${XYZ}c', { XYZ: 'b' }), ['abc']);
|
|
9
|
-
t.same(parse('a${XYZ}c $XYZ', { XYZ: 'b' }), ['abc', 'b']);
|
|
10
|
-
t.same(parse('"-$X-$Y-"', { X: 'a', Y: 'b' }), ['-a-b-']);
|
|
11
|
-
t.same(parse("'-$X-$Y-'", { X: 'a', Y: 'b' }), ['-$X-$Y-']);
|
|
12
|
-
t.same(parse('qrs"$zzz"wxy', { zzz: 'tuv' }), ['qrstuvwxy']);
|
|
13
|
-
t.same(parse("qrs'$zzz'wxy", { zzz: 'tuv' }), ['qrs$zzzwxy']);
|
|
14
|
-
t.same(parse('qrs${zzz}wxy'), ['qrswxy']);
|
|
15
|
-
t.same(parse('qrs$wxy $'), ['qrs', '$']);
|
|
16
|
-
t.same(parse('grep "xy$"'), ['grep', 'xy$']);
|
|
17
|
-
t.same(parse('ab$x', { x: 'c' }), ['abc']);
|
|
18
|
-
t.same(parse('ab\\$x', { x: 'c' }), ['ab$x']);
|
|
19
|
-
t.same(parse('ab${x}def', { x: 'c' }), ['abcdef']);
|
|
20
|
-
t.same(parse('ab\\${x}def', { x: 'c' }), ['ab${x}def']);
|
|
21
|
-
t.same(parse('"ab\\${x}def"', { x: 'c' }), ['ab${x}def']);
|
|
22
|
-
|
|
23
|
-
t.end();
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
test('expand environment variables within here-strings', function (t) {
|
|
27
|
-
t.same(parse('a <<< $x', { x: 'Joe' }), ['a', { op: '<<<' }, 'Joe']);
|
|
28
|
-
t.same(parse('a <<< ${x}', { x: 'Joe' }), ['a', { op: '<<<' }, 'Joe']);
|
|
29
|
-
t.same(parse('a <<< "$x"', { x: 'Joe' }), ['a', { op: '<<<' }, 'Joe']);
|
|
30
|
-
t.same(parse('a <<< "${x}"', { x: 'Joe' }), ['a', { op: '<<<' }, 'Joe']);
|
|
31
|
-
|
|
32
|
-
t.end();
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
test('environment variables with metacharacters', function (t) {
|
|
36
|
-
t.same(parse('a $XYZ c', { XYZ: '"b"' }), ['a', '"b"', 'c']);
|
|
37
|
-
t.same(parse('a $XYZ c', { XYZ: '$X', X: 5 }), ['a', '$X', 'c']);
|
|
38
|
-
t.same(parse('a"$XYZ"c', { XYZ: "'xyz'" }), ["a'xyz'c"]);
|
|
39
|
-
|
|
40
|
-
t.end();
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
test('special shell parameters', function (t) {
|
|
44
|
-
var chars = '*@#?-$!0_'.split('');
|
|
45
|
-
t.plan(chars.length);
|
|
46
|
-
|
|
47
|
-
chars.forEach(function (c) {
|
|
48
|
-
var env = {};
|
|
49
|
-
env[c] = 'xxx';
|
|
50
|
-
t.same(parse('a $' + c + ' c', env), ['a', 'xxx', 'c']);
|
|
51
|
-
});
|
|
52
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var test = require('tape');
|
|
4
|
-
var parse = require('../').parse;
|
|
5
|
-
|
|
6
|
-
function getEnv() {
|
|
7
|
-
return 'xxx';
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function getEnvObj() {
|
|
11
|
-
return { op: '@@' };
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
test('functional env expansion', function (t) {
|
|
15
|
-
t.plan(4);
|
|
16
|
-
|
|
17
|
-
t.same(parse('a $XYZ c', getEnv), ['a', 'xxx', 'c']);
|
|
18
|
-
t.same(parse('a $XYZ c', getEnvObj), ['a', { op: '@@' }, 'c']);
|
|
19
|
-
t.same(parse('a${XYZ}c', getEnvObj), ['a', { op: '@@' }, 'c']);
|
|
20
|
-
t.same(parse('"a $XYZ c"', getEnvObj), ['a ', { op: '@@' }, ' c']);
|
|
21
|
-
});
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var test = require('tape');
|
|
4
|
-
var parse = require('../').parse;
|
|
5
|
-
|
|
6
|
-
test('single operators', function (t) {
|
|
7
|
-
t.same(parse('beep | boop'), ['beep', { op: '|' }, 'boop']);
|
|
8
|
-
t.same(parse('beep|boop'), ['beep', { op: '|' }, 'boop']);
|
|
9
|
-
t.same(parse('beep \\| boop'), ['beep', '|', 'boop']);
|
|
10
|
-
t.same(parse('beep "|boop"'), ['beep', '|boop']);
|
|
11
|
-
|
|
12
|
-
t.same(parse('echo zing &'), ['echo', 'zing', { op: '&' }]);
|
|
13
|
-
t.same(parse('echo zing&'), ['echo', 'zing', { op: '&' }]);
|
|
14
|
-
t.same(parse('echo zing\\&'), ['echo', 'zing&']);
|
|
15
|
-
t.same(parse('echo "zing\\&"'), ['echo', 'zing\\&']);
|
|
16
|
-
|
|
17
|
-
t.same(parse('beep;boop'), ['beep', { op: ';' }, 'boop']);
|
|
18
|
-
t.same(parse('(beep;boop)'), [
|
|
19
|
-
{ op: '(' }, 'beep', { op: ';' }, 'boop', { op: ')' }
|
|
20
|
-
]);
|
|
21
|
-
|
|
22
|
-
t.same(parse('beep>boop'), ['beep', { op: '>' }, 'boop']);
|
|
23
|
-
t.same(parse('beep 2>boop'), ['beep', '2', { op: '>' }, 'boop']);
|
|
24
|
-
t.same(parse('beep<boop'), ['beep', { op: '<' }, 'boop']);
|
|
25
|
-
|
|
26
|
-
t.end();
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
test('double operators', function (t) {
|
|
30
|
-
t.same(parse('beep || boop'), ['beep', { op: '||' }, 'boop']);
|
|
31
|
-
t.same(parse('beep||boop'), ['beep', { op: '||' }, 'boop']);
|
|
32
|
-
t.same(parse('beep ||boop'), ['beep', { op: '||' }, 'boop']);
|
|
33
|
-
t.same(parse('beep|| boop'), ['beep', { op: '||' }, 'boop']);
|
|
34
|
-
t.same(parse('beep || boop'), ['beep', { op: '||' }, 'boop']);
|
|
35
|
-
|
|
36
|
-
t.same(parse('beep && boop'), ['beep', { op: '&&' }, 'boop']);
|
|
37
|
-
t.same(
|
|
38
|
-
parse('beep && boop || byte'),
|
|
39
|
-
['beep', { op: '&&' }, 'boop', { op: '||' }, 'byte']
|
|
40
|
-
);
|
|
41
|
-
t.same(
|
|
42
|
-
parse('beep&&boop||byte'),
|
|
43
|
-
['beep', { op: '&&' }, 'boop', { op: '||' }, 'byte']
|
|
44
|
-
);
|
|
45
|
-
t.same(
|
|
46
|
-
parse('beep\\&\\&boop||byte'),
|
|
47
|
-
['beep&&boop', { op: '||' }, 'byte']
|
|
48
|
-
);
|
|
49
|
-
t.same(
|
|
50
|
-
parse('beep\\&&boop||byte'),
|
|
51
|
-
['beep&', { op: '&' }, 'boop', { op: '||' }, 'byte']
|
|
52
|
-
);
|
|
53
|
-
t.same(
|
|
54
|
-
parse('beep;;boop|&byte>>blip'),
|
|
55
|
-
['beep', { op: ';;' }, 'boop', { op: '|&' }, 'byte', { op: '>>' }, 'blip']
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
t.same(parse('beep 2>&1'), ['beep', '2', { op: '>&' }, '1']);
|
|
59
|
-
|
|
60
|
-
t.same(
|
|
61
|
-
parse('beep<(boop)'),
|
|
62
|
-
['beep', { op: '<(' }, 'boop', { op: ')' }]
|
|
63
|
-
);
|
|
64
|
-
t.same(
|
|
65
|
-
parse('beep<<(boop)'),
|
|
66
|
-
['beep', { op: '<' }, { op: '<(' }, 'boop', { op: ')' }]
|
|
67
|
-
);
|
|
68
|
-
|
|
69
|
-
t.end();
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
test('duplicating input file descriptors', function (t) {
|
|
73
|
-
// duplicating stdout to file descriptor 3
|
|
74
|
-
t.same(parse('beep 3<&1'), ['beep', '3', { op: '<&' }, '1']);
|
|
75
|
-
|
|
76
|
-
// duplicating stdout to file descriptor 0, i.e. stdin
|
|
77
|
-
t.same(parse('beep <&1'), ['beep', { op: '<&' }, '1']);
|
|
78
|
-
|
|
79
|
-
// closes stdin
|
|
80
|
-
t.same(parse('beep <&-'), ['beep', { op: '<&' }, '-']);
|
|
81
|
-
|
|
82
|
-
t.end();
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
test('here strings', function (t) {
|
|
86
|
-
t.same(parse('cat <<< "hello world"'), ['cat', { op: '<<<' }, 'hello world']);
|
|
87
|
-
t.same(parse('cat <<< hello'), ['cat', { op: '<<<' }, 'hello']);
|
|
88
|
-
t.same(parse('cat<<<hello'), ['cat', { op: '<<<' }, 'hello']);
|
|
89
|
-
t.same(parse('cat<<<"hello world"'), ['cat', { op: '<<<' }, 'hello world']);
|
|
90
|
-
|
|
91
|
-
t.end();
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
test('glob patterns', function (t) {
|
|
95
|
-
t.same(
|
|
96
|
-
parse('tap test/*.test.js'),
|
|
97
|
-
['tap', { op: 'glob', pattern: 'test/*.test.js' }]
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
t.same(parse('tap "test/*.test.js"'), ['tap', 'test/*.test.js']);
|
|
101
|
-
t.end();
|
|
102
|
-
});
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var test = require('tape');
|
|
4
|
-
var parse = require('../').parse;
|
|
5
|
-
var quote = require('../').quote;
|
|
6
|
-
|
|
7
|
-
test('parse shell commands', function (t) {
|
|
8
|
-
t.same(parse(''), [], 'parses an empty string');
|
|
9
|
-
|
|
10
|
-
t['throws'](
|
|
11
|
-
function () { parse('${}'); },
|
|
12
|
-
Error,
|
|
13
|
-
'empty substitution throws'
|
|
14
|
-
);
|
|
15
|
-
t['throws'](
|
|
16
|
-
function () { parse('${'); },
|
|
17
|
-
Error,
|
|
18
|
-
'incomplete substitution throws'
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
t.same(parse('a \'b\' "c"'), ['a', 'b', 'c']);
|
|
22
|
-
t.same(
|
|
23
|
-
parse('beep "boop" \'foo bar baz\' "it\'s \\"so\\" groovy"'),
|
|
24
|
-
['beep', 'boop', 'foo bar baz', 'it\'s "so" groovy']
|
|
25
|
-
);
|
|
26
|
-
t.same(parse('a b\\ c d'), ['a', 'b c', 'd']);
|
|
27
|
-
t.same(parse('\\$beep bo\\`op'), ['$beep', 'bo`op']);
|
|
28
|
-
t.same(parse('echo "foo = \\"foo\\""'), ['echo', 'foo = "foo"']);
|
|
29
|
-
t.same(parse(''), []);
|
|
30
|
-
t.same(parse(' '), []);
|
|
31
|
-
t.same(parse('\t'), []);
|
|
32
|
-
t.same(parse('a"b c d"e'), ['ab c de']);
|
|
33
|
-
t.same(parse('a\\ b"c d"\\ e f'), ['a bc d e', 'f']);
|
|
34
|
-
t.same(parse('a\\ b"c d"\\ e\'f g\' h'), ['a bc d ef g', 'h']);
|
|
35
|
-
t.same(parse("x \"bl'a\"'h'"), ['x', "bl'ah"]);
|
|
36
|
-
|
|
37
|
-
// inside single quotes everything is literal, so a backslash does not escape
|
|
38
|
-
// the closing quote and a quoted token must end at its first closing quote
|
|
39
|
-
t.same(parse("'\\' '\\'"), ['\\', '\\'], 'single-quoted backslashes parse as two separate tokens');
|
|
40
|
-
t.same(parse("'\\'\\''"), ["\\'"], 'single-quoted backslash joined with an escaped quote');
|
|
41
|
-
t.same(parse(quote(['\\', '\\'])), ['\\', '\\'], 'quote/parse round-trips a pair of backslashes');
|
|
42
|
-
t.same(parse("x bl^'a^'h'", {}, { escape: '^' }), ['x', "bl'a'h"]);
|
|
43
|
-
t.same(parse('abcH def', {}, { escape: 'H' }), ['abc def']);
|
|
44
|
-
|
|
45
|
-
t.deepEqual(parse('# abc def ghi'), [{ comment: ' abc def ghi' }], 'start-of-line comment content is unparsed');
|
|
46
|
-
t.deepEqual(parse('xyz # abc def ghi'), ['xyz', { comment: ' abc def ghi' }], 'comment content is unparsed');
|
|
47
|
-
|
|
48
|
-
t.deepEqual(parse('-x "" -y'), ['-x', '', '-y'], 'empty string is preserved');
|
|
49
|
-
|
|
50
|
-
t.same(
|
|
51
|
-
parse('2;b', {}, { escape: 'd' }),
|
|
52
|
-
[{ op: '2;b' }],
|
|
53
|
-
'control char in unquoted context mid-token with regex-special escape returns op'
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
t.end();
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
test('single quotes are literal', function (t) {
|
|
60
|
-
t.same(parse("'\\'\\'"), ["\\'"], 'close-escape-reopen produces a quote after a quoted backslash');
|
|
61
|
-
t.same(parse("'a'\\''b'"), ["a'b"], 'close-escape-reopen embeds a quote mid-word');
|
|
62
|
-
t.same(parse("'\\'x"), ['\\x'], 'bareword joins a preceding quoted backslash');
|
|
63
|
-
t.same(parse("a'\\'b"), ['a\\b'], 'quoted backslash joins surrounding barewords');
|
|
64
|
-
t.same(parse("''"), [''], 'empty single quotes produce an empty token');
|
|
65
|
-
t.same(parse("''a''"), ['a'], 'empty single quotes join adjacent content');
|
|
66
|
-
t.same(parse("'*'"), ['*'], 'quoted glob char is a plain string, not a glob');
|
|
67
|
-
|
|
68
|
-
t.end();
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
test('unmatched single quotes', function (t) {
|
|
72
|
-
// real shells reject unterminated quotes; parse is lenient, and these pin the shape of that leniency
|
|
73
|
-
t.same(parse("'"), [], 'a lone quote is dropped');
|
|
74
|
-
t.same(parse("'a"), ['a'], 'an unterminated quote keeps its content');
|
|
75
|
-
t.same(parse("a'b"), ['a', 'b'], 'an unmatched quote mid-word splits the token');
|
|
76
|
-
|
|
77
|
-
t.end();
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
test('nested parameter expansion', function (t) {
|
|
81
|
-
t.same(parse('${a${b}c}'), [''], 'a nested ${} is consumed as one substitution, not split at the first }');
|
|
82
|
-
t.same(parse('${a${b}}'), [''], 'a nested ${} at the end is consumed as one substitution');
|
|
83
|
-
t.same(parse('${foo{bar}'), [''], 'a lone { that is not part of a nested ${} does not change brace depth');
|
|
84
|
-
t.same(
|
|
85
|
-
parse('level=${levels[$RANDOM%${#levels[@]}]}'),
|
|
86
|
-
['level='],
|
|
87
|
-
'a nested array-index expansion is consumed whole, without leaking a partial token'
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
t.end();
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
test('splitUnquoted: field-splits unquoted variable expansion (#1)', function (t) {
|
|
94
|
-
var env = { T: 'c d', E: '', S: ' c d ', W: ' ' };
|
|
95
|
-
var opts = { splitUnquoted: true };
|
|
96
|
-
|
|
97
|
-
t.same(parse('test a b $T', env, opts), ['test', 'a', 'b', 'c', 'd'], 'unquoted expansion splits into separate tokens');
|
|
98
|
-
t.same(parse('a$T', env, opts), ['ac', 'd'], 'the first field joins the preceding text');
|
|
99
|
-
t.same(parse('$T x', env, opts), ['c', 'd', 'x'], 'the last field is a token of its own');
|
|
100
|
-
t.same(parse('x${T}y', env, opts), ['xc', 'dy'], 'fields join text on both sides');
|
|
101
|
-
t.same(parse('$S', env, opts), ['c', 'd'], 'leading, trailing, and repeated whitespace collapses');
|
|
102
|
-
t.same(parse('a$S', env, opts), ['a', 'c', 'd'], 'leading whitespace closes the preceding field');
|
|
103
|
-
t.same(parse('$W', env, opts), [], 'an all-whitespace expansion produces no tokens');
|
|
104
|
-
t.same(parse('a$W b', env, opts), ['a', 'b'], 'an all-whitespace expansion just separates fields');
|
|
105
|
-
t.same(parse('$E', env, opts), [], 'an empty unquoted expansion produces no token');
|
|
106
|
-
t.same(parse('"$T"', env, opts), ['c d'], 'a quoted expansion is never split');
|
|
107
|
-
t.same(parse('-x "" -y', env, opts), ['-x', '', '-y'], 'a quoted empty string is still preserved');
|
|
108
|
-
t.same(parse('a $F b', function () { return 'c d'; }, opts), ['a', 'c', 'd', 'b'], 'the env-function path splits too');
|
|
109
|
-
|
|
110
|
-
t.same(parse('test a b $T', env), ['test', 'a', 'b', 'c d'], 'without the option, unquoted expansion is not split');
|
|
111
|
-
|
|
112
|
-
t.end();
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
test('splitUnquoted: a string value is a custom IFS (#1)', function (t) {
|
|
116
|
-
function o(ifs) { return { splitUnquoted: ifs }; }
|
|
117
|
-
|
|
118
|
-
t.same(parse('${V}', { V: 'a:b' }, o(':')), ['a', 'b'], 'a non-whitespace IFS char splits fields');
|
|
119
|
-
t.same(parse('${V}', { V: 'a::b' }, o(':')), ['a', '', 'b'], 'adjacent non-whitespace delimiters yield an empty field');
|
|
120
|
-
t.same(parse('${V}', { V: ':a:' }, o(':')), ['', 'a'], 'a leading delimiter yields a leading empty; a trailing one does not');
|
|
121
|
-
t.same(parse('${V}', { V: 'a::' }, o(':')), ['a', ''], 'a trailing double delimiter yields one empty field');
|
|
122
|
-
t.same(parse('${V}', { V: ':' }, o(':')), [''], 'a lone delimiter yields a single empty field');
|
|
123
|
-
t.same(parse('${V}', { V: '::' }, o(':')), ['', ''], 'two delimiters yield two empty fields');
|
|
124
|
-
t.same(parse('${V}${W}', { V: 'a:', W: ':b' }, o(':')), ['a', '', 'b'], 'delimiters spanning an expansion boundary merge into one run');
|
|
125
|
-
t.same(parse('a${V}${W}z', { V: ':x:', W: ':y:' }, o(':')), ['a', 'x', '', 'y', 'z'], 'fields join literal text on both sides across expansions');
|
|
126
|
-
t.same(parse('${V}', { V: 'a : b' }, o(' :')), ['a', 'b'], 'whitespace around a non-whitespace delimiter is absorbed');
|
|
127
|
-
t.same(parse('${V}', { V: 'a b:c' }, o(' :')), ['a', 'b', 'c'], 'mixed IFS: whitespace and non-whitespace each delimit');
|
|
128
|
-
t.same(parse('${V}', { V: 'a,b' }, o(',')), ['a', 'b'], 'any character can be the IFS');
|
|
129
|
-
t.same(parse('${V}', { V: 'a b' }, o('')), ['a b'], 'an empty IFS string disables splitting');
|
|
130
|
-
|
|
131
|
-
t.end();
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
test('parse stays linear in token count (GHSA-395f-4hp3-45gv)', function (t) {
|
|
135
|
-
// the old concat-in-reduce finalizer was O(n^2): this many tokens took
|
|
136
|
-
// ~minutes, so under the unfixed code this test hangs rather than passes
|
|
137
|
-
var n = 2e5;
|
|
138
|
-
var input = new Array(n + 1).join('x '); // avoid String#repeat for old engines
|
|
139
|
-
|
|
140
|
-
var words = parse(input);
|
|
141
|
-
t.equal(words.length, n, 'every token is returned');
|
|
142
|
-
t.equal(words[0], 'x', 'first token is correct');
|
|
143
|
-
t.equal(words[n - 1], 'x', 'last token is correct');
|
|
144
|
-
|
|
145
|
-
var withEnv = parse(input, function () { return 'v'; });
|
|
146
|
-
t.equal(withEnv.length, n, 'env-function path returns every token');
|
|
147
|
-
|
|
148
|
-
t.end();
|
|
149
|
-
});
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var test = require('tape');
|
|
4
|
-
var quote = require('../').quote;
|
|
5
|
-
|
|
6
|
-
test('quote', function (t) {
|
|
7
|
-
t.equal(quote(['a', 'b', 'c d']), 'a b \'c d\'');
|
|
8
|
-
t.equal(
|
|
9
|
-
quote(['a', 'b', "it's a \"neat thing\""]),
|
|
10
|
-
'a b "it\'s a \\"neat thing\\""'
|
|
11
|
-
);
|
|
12
|
-
t.equal(
|
|
13
|
-
quote(['$', '`', '\'']),
|
|
14
|
-
'\\$ \\` "\'"'
|
|
15
|
-
);
|
|
16
|
-
t.equal(quote([]), '');
|
|
17
|
-
t.equal(quote(['a\nb']), "'a\nb'");
|
|
18
|
-
t.equal(quote([' #(){}*|][!']), "' #(){}*|][!'");
|
|
19
|
-
t.equal(quote(["'#(){}*|][!"]), '"\'#(){}*|][\\!"');
|
|
20
|
-
t.equal(quote(['X#(){}*|][!']), 'X\\#\\(\\)\\{\\}\\*\\|\\]\\[\\!');
|
|
21
|
-
t.equal(quote(['a\n#\nb']), "'a\n#\nb'");
|
|
22
|
-
t.equal(quote(['><;{}']), '\\>\\<\\;\\{\\}');
|
|
23
|
-
t.equal(quote(['a', 1, true, false]), 'a 1 true false');
|
|
24
|
-
t.equal(quote(['a', 1, null, undefined]), 'a 1 null undefined');
|
|
25
|
-
t.equal(quote(['a\\x']), "'a\\x'");
|
|
26
|
-
t.equal(quote(['a"b']), '\'a"b\'');
|
|
27
|
-
t.equal(quote(['"a"b"']), '\'"a"b"\'');
|
|
28
|
-
t.equal(quote(['a\\"b']), '\'a\\"b\'');
|
|
29
|
-
t.equal(quote(['a\\b']), '\'a\\b\'');
|
|
30
|
-
t.end();
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
test('quote tilde (escapes every ~ to prevent shell tilde-expansion)', function (t) {
|
|
34
|
-
t.equal(quote(['~']), '\\~');
|
|
35
|
-
t.equal(quote(['~/foo']), '\\~/foo');
|
|
36
|
-
t.equal(quote(['~root']), '\\~root');
|
|
37
|
-
t.equal(quote(['~root/x']), '\\~root/x');
|
|
38
|
-
t.equal(quote(['~+']), '\\~+');
|
|
39
|
-
t.equal(quote(['~-']), '\\~-');
|
|
40
|
-
t.equal(quote(['a~b']), 'a\\~b');
|
|
41
|
-
t.equal(quote(['x~']), 'x\\~');
|
|
42
|
-
t.end();
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
test('backslash with whitespace is not doubled in single quotes (#14)', function (t) {
|
|
46
|
-
t.equal(quote(['foo \\ bar']), "'foo \\ bar'", 'a backslash between spaces stays a single literal backslash');
|
|
47
|
-
t.equal(quote(['foo \\\\ bar']), "'foo \\\\ bar'", 'a double backslash is preserved, not quadrupled');
|
|
48
|
-
t.equal(quote(['foo\\\nbar']), "'foo\\\nbar'", 'a backslash before a newline is preserved');
|
|
49
|
-
t.end();
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
test('escapes shell-special characters conservatively (issue #11)', function (t) {
|
|
53
|
-
t.equal(quote(['make', 'CFLAGS=-DRELEASE']), 'make CFLAGS\\=-DRELEASE', 'escapes = so a leading word is not read as an assignment');
|
|
54
|
-
t.equal(quote(['a@b']), 'a\\@b', 'escapes @ (zsh globbing)');
|
|
55
|
-
t.equal(quote(['a^b']), 'a\\^b', 'escapes ^ (zsh extendedglob, csh)');
|
|
56
|
-
t.equal(quote(['a:b']), 'a\\:b', 'escapes :');
|
|
57
|
-
t.equal(quote(['a,b']), 'a\\,b', 'escapes , (brace expansion)');
|
|
58
|
-
t.equal(quote(['a!b']), 'a\\!b', 'escapes ! (history expansion / pipeline negation)');
|
|
59
|
-
t.end();
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
test('quote ops', function (t) {
|
|
63
|
-
t.equal(quote(['a', { op: '|' }, 'b']), 'a \\| b');
|
|
64
|
-
t.equal(
|
|
65
|
-
quote(['a', { op: '&&' }, 'b', { op: ';' }, 'c']),
|
|
66
|
-
'a \\&\\& b \\; c'
|
|
67
|
-
);
|
|
68
|
-
t.end();
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
test('quote windows paths', { skip: 'breaking change, disabled until 2.x' }, function (t) {
|
|
72
|
-
var path = 'C:\\projects\\node-shell-quote\\index.js';
|
|
73
|
-
|
|
74
|
-
t.equal(quote([path, 'b', 'c d']), 'C:\\projects\\node-shell-quote\\index.js b \'c d\'');
|
|
75
|
-
|
|
76
|
-
t.end();
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
test("chars for windows paths don't break out", function (t) {
|
|
80
|
-
var x = '`:\\a\\b';
|
|
81
|
-
t.equal(quote([x]), "'`:\\a\\b'");
|
|
82
|
-
t.end();
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
test('empty strings', function (t) {
|
|
86
|
-
t.equal(quote(['-x', '', 'y']), '-x \'\' y');
|
|
87
|
-
|
|
88
|
-
t.end();
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
test('quote ops: allowlist', function (t) {
|
|
92
|
-
var ops = ['||', '&&', ';;', '|&', '<(', '<<<', '>>', '>&', '<&', '&', ';', '(', ')', '|', '<', '>'];
|
|
93
|
-
for (var i = 0; i < ops.length; i++) {
|
|
94
|
-
var op = ops[i];
|
|
95
|
-
var expected = '';
|
|
96
|
-
for (var j = 0; j < op.length; j++) { expected += '\\' + op.charAt(j); }
|
|
97
|
-
t.equal(quote([{ op: op }]), expected, 'op ' + op);
|
|
98
|
-
}
|
|
99
|
-
t.end();
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
test('quote ops: rejects line terminators (GHSA-w7jw-789q-3m8p)', function (t) {
|
|
103
|
-
t['throws'](function () { quote([{ op: ';\nid' }]); }, TypeError, 'newline in op');
|
|
104
|
-
t['throws'](function () { quote([{ op: ';\rid' }]); }, TypeError, 'carriage return in op');
|
|
105
|
-
t['throws'](function () { quote([{ op: ';\u2028id' }]); }, TypeError, 'U+2028 in op');
|
|
106
|
-
t['throws'](function () { quote([{ op: ';\u2029id' }]); }, TypeError, 'U+2029 in op');
|
|
107
|
-
t.end();
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
test('quote ops: rejects non-allowlisted values', function (t) {
|
|
111
|
-
t['throws'](function () { quote([{ op: '' }]); }, TypeError, 'empty op');
|
|
112
|
-
t['throws'](function () { quote([{ op: 'foo' }]); }, TypeError, 'arbitrary string');
|
|
113
|
-
t['throws'](function () { quote([{ op: '|||' }]); }, TypeError, 'near-miss');
|
|
114
|
-
t['throws'](function () { quote([{ op: 42 }]); }, TypeError, 'non-string op');
|
|
115
|
-
t.end();
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
test('quote glob pattern', function (t) {
|
|
119
|
-
t.equal(quote([{ op: 'glob', pattern: 'test/*.test.js' }]), 'test/*.test.js');
|
|
120
|
-
t.equal(quote([{ op: 'glob', pattern: '?ab' }]), '?ab');
|
|
121
|
-
t.equal(quote([{ op: 'glob', pattern: '[ab]c' }]), '[ab]c');
|
|
122
|
-
t.equal(quote([{ op: 'glob', pattern: '{a,b}' }]), '{a,b}');
|
|
123
|
-
t.equal(quote([{ op: 'glob', pattern: 'my dir/*.txt' }]), 'my\\ dir/*.txt');
|
|
124
|
-
t.equal(quote([{ op: 'glob', pattern: 'a$b' }]), 'a\\$b');
|
|
125
|
-
t['throws'](function () { quote([{ op: 'glob' }]); }, TypeError, 'missing pattern');
|
|
126
|
-
t['throws'](function () { quote([{ op: 'glob', pattern: 'a\nb' }]); }, TypeError, 'newline in pattern');
|
|
127
|
-
t['throws'](function () { quote([{ op: 'glob', pattern: 'a\u2028b' }]); }, TypeError, 'U+2028 in pattern');
|
|
128
|
-
t.end();
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
test('quote comment', function (t) {
|
|
132
|
-
t.equal(quote(['echo', 'hi', { comment: ' a comment' }]), 'echo hi # a comment');
|
|
133
|
-
t.equal(quote([{ comment: '' }]), '#');
|
|
134
|
-
t['throws'](function () { quote([{ comment: 'a\nb' }]); }, TypeError, 'newline in comment');
|
|
135
|
-
t['throws'](function () { quote([{ comment: 'a\rb' }]); }, TypeError, 'CR in comment');
|
|
136
|
-
t['throws'](function () { quote([{ comment: 'a\u2028b' }]); }, TypeError, 'U+2028 in comment');
|
|
137
|
-
t.end();
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
test('quote rejects unrecognized object shapes', function (t) {
|
|
141
|
-
t['throws'](function () { quote([{}]); }, TypeError, 'empty object');
|
|
142
|
-
t['throws'](function () { quote([{ foo: 'bar' }]); }, TypeError, 'unknown key');
|
|
143
|
-
t['throws'](function () { quote([{ op: null }]); }, TypeError, 'null op');
|
|
144
|
-
t.end();
|
|
145
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var test = require('tape');
|
|
4
|
-
var parse = require('../').parse;
|
|
5
|
-
|
|
6
|
-
test('set env vars', function (t) {
|
|
7
|
-
t.same(
|
|
8
|
-
parse('ABC=444 x y z'),
|
|
9
|
-
['ABC=444', 'x', 'y', 'z']
|
|
10
|
-
);
|
|
11
|
-
t.same(
|
|
12
|
-
parse('ABC=3\\ 4\\ 5 x y z'),
|
|
13
|
-
['ABC=3 4 5', 'x', 'y', 'z']
|
|
14
|
-
);
|
|
15
|
-
t.same(
|
|
16
|
-
parse('X="7 8 9" printx'),
|
|
17
|
-
['X=7 8 9', 'printx']
|
|
18
|
-
);
|
|
19
|
-
t.same(
|
|
20
|
-
parse('X="7 8 9"; printx'),
|
|
21
|
-
['X=7 8 9', { op: ';' }, 'printx']
|
|
22
|
-
);
|
|
23
|
-
t.same(
|
|
24
|
-
parse('X="7 8 9"; printx', function () {
|
|
25
|
-
t.fail('should not have matched any keys');
|
|
26
|
-
}),
|
|
27
|
-
['X=7 8 9', { op: ';' }, 'printx']
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
t.end();
|
|
31
|
-
});
|