@wopee-io/wopee.wdio 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getDocumentScrollHeight.d.ts +5 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getDocumentScrollHeight.d.ts.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getDocumentScrollHeight.js +48 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getDocumentScrollHeight.js.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopDom.d.ts +9 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopDom.d.ts.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopDom.js +20 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopDom.js.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopWindow.d.ts +9 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopWindow.d.ts.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopWindow.js +22 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopWindow.js.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getScreenDimensions.d.ts +8 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getScreenDimensions.d.ts.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getScreenDimensions.js +39 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getScreenDimensions.js.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/screenDimensions.interfaces.d.ts +85 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/screenDimensions.interfaces.d.ts.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/screenDimensions.interfaces.js +2 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/screenDimensions.interfaces.js.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/scrollElementIntoView.d.ts +8 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/scrollElementIntoView.d.ts.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/scrollElementIntoView.js +35 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/scrollElementIntoView.js.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/scrollToPosition.d.ts +8 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/scrollToPosition.d.ts.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/scrollToPosition.js +27 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/scrollToPosition.js.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/desktopBrowserClientOperationAdapter.d.ts +13 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/desktopBrowserClientOperationAdapter.d.ts.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/desktopBrowserClientOperationAdapter.js +27 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/desktopBrowserClientOperationAdapter.js.map +1 -0
- package/build/adapter/driven/localSaveScreenshot/default.d.ts +14 -0
- package/build/adapter/driven/localSaveScreenshot/default.d.ts.map +1 -0
- package/build/adapter/driven/localSaveScreenshot/default.js +20 -0
- package/build/adapter/driven/localSaveScreenshot/default.js.map +1 -0
- package/build/adapter/driven/localSaveScreenshot/localSaveScreenshot.d.ts +42 -0
- package/build/adapter/driven/localSaveScreenshot/localSaveScreenshot.d.ts.map +1 -0
- package/build/adapter/driven/localSaveScreenshot/localSaveScreenshot.interface.d.ts +43 -0
- package/build/adapter/driven/localSaveScreenshot/localSaveScreenshot.interface.d.ts.map +1 -0
- package/build/adapter/driven/localSaveScreenshot/localSaveScreenshot.interface.js +2 -0
- package/build/adapter/driven/localSaveScreenshot/localSaveScreenshot.interface.js.map +1 -0
- package/build/adapter/driven/localSaveScreenshot/localSaveScreenshot.js +76 -0
- package/build/adapter/driven/localSaveScreenshot/localSaveScreenshot.js.map +1 -0
- package/build/adapter/driven/wdioLoggerAdapter/wdioLoggerAdapter.d.ts +10 -0
- package/build/adapter/driven/wdioLoggerAdapter/wdioLoggerAdapter.d.ts.map +1 -0
- package/build/adapter/driven/wdioLoggerAdapter/wdioLoggerAdapter.js +20 -0
- package/build/adapter/driven/wdioLoggerAdapter/wdioLoggerAdapter.js.map +1 -0
- package/build/adapter/fullPageScreenshotAdapter/fullPageScreenshotAdapter.d.ts +31 -0
- package/build/adapter/fullPageScreenshotAdapter/fullPageScreenshotAdapter.d.ts.map +1 -0
- package/build/adapter/fullPageScreenshotAdapter/fullPageScreenshotAdapter.js +138 -0
- package/build/adapter/fullPageScreenshotAdapter/fullPageScreenshotAdapter.js.map +1 -0
- package/build/adapter/wdioConfigAdapter/wdioConfigAdapter.d.ts +10 -0
- package/build/adapter/wdioConfigAdapter/wdioConfigAdapter.d.ts.map +1 -0
- package/build/adapter/wdioConfigAdapter/wdioConfigAdapter.interface.d.ts +28 -0
- package/build/adapter/wdioConfigAdapter/wdioConfigAdapter.interface.d.ts.map +1 -0
- package/build/adapter/wdioConfigAdapter/wdioConfigAdapter.interface.js +12 -0
- package/build/adapter/wdioConfigAdapter/wdioConfigAdapter.interface.js.map +1 -0
- package/build/adapter/wdioConfigAdapter/wdioConfigAdapter.js +57 -0
- package/build/adapter/wdioConfigAdapter/wdioConfigAdapter.js.map +1 -0
- package/build/adapter/wdioLoggerAdapter/wdioLoggerAdapter.d.ts +10 -0
- package/build/adapter/wdioLoggerAdapter/wdioLoggerAdapter.d.ts.map +1 -0
- package/build/adapter/wdioLoggerAdapter/wdioLoggerAdapter.js +20 -0
- package/build/adapter/wdioLoggerAdapter/wdioLoggerAdapter.js.map +1 -0
- package/build/core/domain/valueObjects/elementPosition.interface.d.ts +7 -0
- package/build/core/domain/valueObjects/elementPosition.interface.d.ts.map +1 -0
- package/build/core/domain/valueObjects/elementPosition.interface.js +2 -0
- package/build/core/domain/valueObjects/elementPosition.interface.js.map +1 -0
- package/build/core/domain/valueObjects/index.d.ts +4 -0
- package/build/core/domain/valueObjects/index.d.ts.map +1 -0
- package/build/core/domain/valueObjects/index.js +2 -0
- package/build/core/domain/valueObjects/index.js.map +1 -0
- package/build/core/domain/valueObjects/track.interface.d.ts +22 -0
- package/build/core/domain/valueObjects/track.interface.d.ts.map +1 -0
- package/build/core/domain/valueObjects/track.interface.js +2 -0
- package/build/core/domain/valueObjects/track.interface.js.map +1 -0
- package/build/desktopBrowser/clientSideScript/screenDimensions.interfaces.d.ts +85 -0
- package/build/desktopBrowser/clientSideScript/screenDimensions.interfaces.d.ts.map +1 -0
- package/build/desktopBrowser/clientSideScript/screenDimensions.interfaces.js +2 -0
- package/build/desktopBrowser/clientSideScript/screenDimensions.interfaces.js.map +1 -0
- package/build/desktopBrowser/commands/element.interfaces.d.ts +11 -0
- package/build/desktopBrowser/commands/element.interfaces.d.ts.map +1 -0
- package/build/desktopBrowser/commands/element.interfaces.js +2 -0
- package/build/desktopBrowser/commands/element.interfaces.js.map +1 -0
- package/build/desktopBrowser/commands/fullPage.interfaces.d.ts +11 -0
- package/build/desktopBrowser/commands/fullPage.interfaces.d.ts.map +1 -0
- package/build/desktopBrowser/commands/fullPage.interfaces.js +2 -0
- package/build/desktopBrowser/commands/fullPage.interfaces.js.map +1 -0
- package/build/desktopBrowser/commands/screen.interfaces.d.ts +8 -0
- package/build/desktopBrowser/commands/screen.interfaces.d.ts.map +1 -0
- package/build/desktopBrowser/commands/screen.interfaces.js +2 -0
- package/build/desktopBrowser/commands/screen.interfaces.js.map +1 -0
- package/build/desktopBrowser/commands/trackElement.d.ts +7 -0
- package/build/desktopBrowser/commands/trackElement.d.ts.map +1 -0
- package/build/desktopBrowser/commands/trackElement.js +63 -0
- package/build/desktopBrowser/commands/trackElement.js.map +1 -0
- package/build/desktopBrowser/commands/trackFullPageScreen.d.ts +7 -0
- package/build/desktopBrowser/commands/trackFullPageScreen.d.ts.map +1 -0
- package/build/desktopBrowser/commands/trackFullPageScreen.js +49 -0
- package/build/desktopBrowser/commands/trackFullPageScreen.js.map +1 -0
- package/build/desktopBrowser/commands/trackImage.d.ts +6 -0
- package/build/desktopBrowser/commands/trackImage.d.ts.map +1 -0
- package/build/desktopBrowser/commands/trackImage.interface.d.ts +8 -0
- package/build/desktopBrowser/commands/trackImage.interface.d.ts.map +1 -0
- package/build/desktopBrowser/commands/trackImage.interface.js +2 -0
- package/build/desktopBrowser/commands/trackImage.interface.js.map +1 -0
- package/build/desktopBrowser/commands/trackImage.js +27 -0
- package/build/desktopBrowser/commands/trackImage.js.map +1 -0
- package/build/desktopBrowser/commands/trackScreen.d.ts +7 -0
- package/build/desktopBrowser/commands/trackScreen.d.ts.map +1 -0
- package/build/desktopBrowser/commands/trackScreen.js +52 -0
- package/build/desktopBrowser/commands/trackScreen.js.map +1 -0
- package/build/desktopBrowser/helpers/utils.d.ts +33 -0
- package/build/desktopBrowser/helpers/utils.d.ts.map +1 -0
- package/build/desktopBrowser/helpers/utils.js +77 -0
- package/build/desktopBrowser/helpers/utils.js.map +1 -0
- package/build/desktopBrowser/index.d.ts +8 -0
- package/build/desktopBrowser/index.d.ts.map +1 -0
- package/build/desktopBrowser/index.js +6 -0
- package/build/desktopBrowser/index.js.map +1 -0
- package/build/desktopBrowser/methods/elementPosition.d.ts +23 -0
- package/build/desktopBrowser/methods/elementPosition.d.ts.map +1 -0
- package/build/desktopBrowser/methods/elementPosition.js +26 -0
- package/build/desktopBrowser/methods/elementPosition.js.map +1 -0
- package/build/desktopBrowser/methods/images.d.ts +27 -0
- package/build/desktopBrowser/methods/images.d.ts.map +1 -0
- package/build/desktopBrowser/methods/images.interfaces.d.ts +31 -0
- package/build/desktopBrowser/methods/images.interfaces.d.ts.map +1 -0
- package/build/desktopBrowser/methods/images.interfaces.js +2 -0
- package/build/desktopBrowser/methods/images.interfaces.js.map +1 -0
- package/build/desktopBrowser/methods/images.js +109 -0
- package/build/desktopBrowser/methods/images.js.map +1 -0
- package/build/desktopBrowser/methods/instanceData.interfaces.d.ts +10 -0
- package/build/desktopBrowser/methods/instanceData.interfaces.d.ts.map +1 -0
- package/build/desktopBrowser/methods/instanceData.interfaces.js +2 -0
- package/build/desktopBrowser/methods/instanceData.interfaces.js.map +1 -0
- package/build/desktopBrowser/methods/methods.interface.d.ts +13 -0
- package/build/desktopBrowser/methods/methods.interface.d.ts.map +1 -0
- package/build/desktopBrowser/methods/methods.interface.js +2 -0
- package/build/desktopBrowser/methods/methods.interface.js.map +1 -0
- package/build/desktopBrowser/methods/rectangles.d.ts +23 -0
- package/build/desktopBrowser/methods/rectangles.d.ts.map +1 -0
- package/build/desktopBrowser/methods/rectangles.interfaces.d.ts +23 -0
- package/build/desktopBrowser/methods/rectangles.interfaces.d.ts.map +1 -0
- package/build/desktopBrowser/methods/rectangles.interfaces.js +2 -0
- package/build/desktopBrowser/methods/rectangles.interfaces.js.map +1 -0
- package/build/desktopBrowser/methods/rectangles.js +51 -0
- package/build/desktopBrowser/methods/rectangles.js.map +1 -0
- package/build/desktopBrowser/methods/screenshots.d.ts +29 -0
- package/build/desktopBrowser/methods/screenshots.d.ts.map +1 -0
- package/build/desktopBrowser/methods/screenshots.interfaces.d.ts +27 -0
- package/build/desktopBrowser/methods/screenshots.interfaces.d.ts.map +1 -0
- package/build/desktopBrowser/methods/screenshots.interfaces.js +2 -0
- package/build/desktopBrowser/methods/screenshots.interfaces.js.map +1 -0
- package/build/desktopBrowser/methods/screenshots.js +91 -0
- package/build/desktopBrowser/methods/screenshots.js.map +1 -0
- package/build/domain/model/afterScreenshotOptions.interface.d.ts +11 -0
- package/build/domain/model/afterScreenshotOptions.interface.d.ts.map +1 -0
- package/build/domain/model/afterScreenshotOptions.interface.js +2 -0
- package/build/domain/model/afterScreenshotOptions.interface.js.map +1 -0
- package/build/domain/model/beforeScreenshotOptions.interface.d.ts +7 -0
- package/build/domain/model/beforeScreenshotOptions.interface.d.ts.map +1 -0
- package/build/domain/model/beforeScreenshotOptions.interface.js +2 -0
- package/build/domain/model/beforeScreenshotOptions.interface.js.map +1 -0
- package/build/domain/model/config.interface.d.ts +19 -0
- package/build/domain/model/config.interface.d.ts.map +1 -0
- package/build/domain/model/config.interface.js +2 -0
- package/build/domain/model/config.interface.js.map +1 -0
- package/build/domain/model/constants.d.ts +9 -0
- package/build/domain/model/constants.d.ts.map +1 -0
- package/build/domain/model/constants.js +9 -0
- package/build/domain/model/constants.js.map +1 -0
- package/build/domain/model/croppingOptions.interface.d.ts +8 -0
- package/build/domain/model/croppingOptions.interface.d.ts.map +1 -0
- package/build/domain/model/croppingOptions.interface.js +12 -0
- package/build/domain/model/croppingOptions.interface.js.map +1 -0
- package/build/domain/model/instances.interface.d.ts +16 -0
- package/build/domain/model/instances.interface.d.ts.map +1 -0
- package/build/domain/model/instances.interface.js +2 -0
- package/build/domain/model/instances.interface.js.map +1 -0
- package/build/domain/model/instancesOptions.interface.d.ts +7 -0
- package/build/domain/model/instancesOptions.interface.d.ts.map +1 -0
- package/build/domain/model/instancesOptions.interface.js +10 -0
- package/build/domain/model/instancesOptions.interface.js.map +1 -0
- package/build/domain/model/methods.interface.d.ts +17 -0
- package/build/domain/model/methods.interface.d.ts.map +1 -0
- package/build/domain/model/methods.interface.js +2 -0
- package/build/domain/model/methods.interface.js.map +1 -0
- package/build/domain/model/permanentStorageResult.interface.d.ts +14 -0
- package/build/domain/model/permanentStorageResult.interface.d.ts.map +1 -0
- package/build/domain/model/permanentStorageResult.interface.js +2 -0
- package/build/domain/model/permanentStorageResult.interface.js.map +1 -0
- package/build/domain/model/saveBase64ImageOptions.interface.d.ts +54 -0
- package/build/domain/model/saveBase64ImageOptions.interface.d.ts.map +1 -0
- package/build/domain/model/saveBase64ImageOptions.interface.js +2 -0
- package/build/domain/model/saveBase64ImageOptions.interface.js.map +1 -0
- package/build/domain/model/screenshotOutput.interface.d.ts +16 -0
- package/build/domain/model/screenshotOutput.interface.d.ts.map +1 -0
- package/build/domain/model/screenshotOutput.interface.js +2 -0
- package/build/domain/model/screenshotOutput.interface.js.map +1 -0
- package/build/domain/model/screenshotSize.interface.d.ts +14 -0
- package/build/domain/model/screenshotSize.interface.d.ts.map +1 -0
- package/build/domain/model/screenshotSize.interface.js +2 -0
- package/build/domain/model/screenshotSize.interface.js.map +1 -0
- package/build/domain/model/screenshotValidationPayload.interface.d.ts +47 -0
- package/build/domain/model/screenshotValidationPayload.interface.d.ts.map +1 -0
- package/build/domain/model/screenshotValidationPayload.interface.js +2 -0
- package/build/domain/model/screenshotValidationPayload.interface.js.map +1 -0
- package/build/domain/model/screenshotValidationResult.interface.d.ts +23 -0
- package/build/domain/model/screenshotValidationResult.interface.d.ts.map +1 -0
- package/build/domain/model/screenshotValidationResult.interface.js +11 -0
- package/build/domain/model/screenshotValidationResult.interface.js.map +1 -0
- package/build/domain/model/service.interface.d.ts +33 -0
- package/build/domain/model/service.interface.d.ts.map +1 -0
- package/build/domain/model/service.interface.js +2 -0
- package/build/domain/model/service.interface.js.map +1 -0
- package/build/domain/model/trackImage.interface.d.ts +17 -0
- package/build/domain/model/trackImage.interface.d.ts.map +1 -0
- package/build/domain/model/trackImage.interface.js +2 -0
- package/build/domain/model/trackImage.interface.js.map +1 -0
- package/build/domain/service/afterScreenshot.d.ts +11 -0
- package/build/domain/service/afterScreenshot.d.ts.map +1 -0
- package/build/domain/service/afterScreenshot.js +15 -0
- package/build/domain/service/afterScreenshot.js.map +1 -0
- package/build/domain/service/beforeScreenshot.d.ts +12 -0
- package/build/domain/service/beforeScreenshot.d.ts.map +1 -0
- package/build/domain/service/beforeScreenshot.js +41 -0
- package/build/domain/service/beforeScreenshot.js.map +1 -0
- package/build/domain/service/webdriverService.d.ts +19 -0
- package/build/domain/service/webdriverService.d.ts.map +1 -0
- package/build/domain/service/webdriverService.js +98 -0
- package/build/domain/service/webdriverService.js.map +1 -0
- package/build/domain/service/wopeeService.d.ts +37 -0
- package/build/domain/service/wopeeService.d.ts.map +1 -0
- package/build/domain/service/wopeeService.js +83 -0
- package/build/domain/service/wopeeService.js.map +1 -0
- package/build/index.d.ts +59 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +4 -0
- package/build/index.js.map +1 -0
- package/build/port/clientSideOperationPort/clientSideOperationPort.d.ts +12 -0
- package/build/port/clientSideOperationPort/clientSideOperationPort.d.ts.map +1 -0
- package/build/port/clientSideOperationPort/clientSideOperationPort.js +3 -0
- package/build/port/clientSideOperationPort/clientSideOperationPort.js.map +1 -0
- package/build/port/driven/configDrivingPort/configDrivingPort.d.ts +9 -0
- package/build/port/driven/configDrivingPort/configDrivingPort.d.ts.map +1 -0
- package/build/port/driven/configDrivingPort/configDrivingPort.js +15 -0
- package/build/port/driven/configDrivingPort/configDrivingPort.js.map +1 -0
- package/build/port/driven/configDrivingPort/configDrivingPortDefaults.d.ts +6 -0
- package/build/port/driven/configDrivingPort/configDrivingPortDefaults.d.ts.map +1 -0
- package/build/port/driven/configDrivingPort/configDrivingPortDefaults.js +36 -0
- package/build/port/driven/configDrivingPort/configDrivingPortDefaults.js.map +1 -0
- package/build/port/driven/permanentStoragePort.d.ts +15 -0
- package/build/port/driven/permanentStoragePort.d.ts.map +1 -0
- package/build/port/driven/permanentStoragePort.js +6 -0
- package/build/port/driven/permanentStoragePort.js.map +1 -0
- package/build/port/driven/screenshotValidationPort.d.ts +28 -0
- package/build/port/driven/screenshotValidationPort.d.ts.map +1 -0
- package/build/port/driven/screenshotValidationPort.js +6 -0
- package/build/port/driven/screenshotValidationPort.js.map +1 -0
- package/build/types.d.ts +1 -0
- package/build/types.d.ts.map +1 -0
- package/build/types.js +2 -0
- package/build/types.js.map +1 -0
- package/build/utils/versionMetadata.d.ts +10 -0
- package/build/utils/versionMetadata.d.ts.map +1 -0
- package/build/utils/versionMetadata.js +26 -0
- package/build/utils/versionMetadata.js.map +1 -0
- package/build/utils/wopeeError.d.ts +4 -0
- package/build/utils/wopeeError.d.ts.map +1 -0
- package/build/utils/wopeeError.js +8 -0
- package/build/utils/wopeeError.js.map +1 -0
- package/build/utils.d.ts +34 -0
- package/build/utils.d.ts.map +1 -0
- package/build/utils.js +57 -0
- package/build/utils.js.map +1 -0
- package/docs/commands.md +37 -0
- package/docs/configuration.md +241 -0
- package/docs/mobile_native.md +31 -0
- package/node_modules/@autonomous-testing/sdk/.commitlintrc.json +3 -0
- package/node_modules/@autonomous-testing/sdk/.eslintignore +2 -0
- package/node_modules/@autonomous-testing/sdk/.eslintrc +21 -0
- package/node_modules/@autonomous-testing/sdk/.github/actions/npm_clean_install/action.yaml +35 -0
- package/node_modules/@autonomous-testing/sdk/.github/workflows/ci_cd.yaml +137 -0
- package/node_modules/@autonomous-testing/sdk/.prettierignore +3 -0
- package/node_modules/@autonomous-testing/sdk/.prettierrc +12 -0
- package/node_modules/@autonomous-testing/sdk/README.md +57 -0
- package/node_modules/@autonomous-testing/sdk/build/core/domain/index.d.ts +2 -0
- package/node_modules/@autonomous-testing/sdk/build/core/domain/index.js +18 -0
- package/node_modules/@autonomous-testing/sdk/build/core/domain/valueObjects/imageTrackingResult.interface.d.ts +3 -0
- package/node_modules/@autonomous-testing/sdk/build/core/domain/valueObjects/imageTrackingResult.interface.js +3 -0
- package/node_modules/@autonomous-testing/sdk/build/core/domain/valueObjects/index.d.ts +4 -0
- package/node_modules/@autonomous-testing/sdk/build/core/domain/valueObjects/index.js +3 -0
- package/node_modules/@autonomous-testing/sdk/build/core/domain/valueObjects/trackPayload.interface.d.ts +3 -0
- package/node_modules/@autonomous-testing/sdk/build/core/domain/valueObjects/trackPayload.interface.js +3 -0
- package/node_modules/@autonomous-testing/sdk/build/core/index.d.ts +3 -0
- package/node_modules/@autonomous-testing/sdk/build/core/index.js +19 -0
- package/node_modules/@autonomous-testing/sdk/build/core/ports/imageTracker.d.ts +6 -0
- package/node_modules/@autonomous-testing/sdk/build/core/ports/imageTracker.js +7 -0
- package/node_modules/@autonomous-testing/sdk/build/core/ports/index.d.ts +4 -0
- package/node_modules/@autonomous-testing/sdk/build/core/ports/index.js +8 -0
- package/node_modules/@autonomous-testing/sdk/build/core/ports/logger.d.ts +7 -0
- package/node_modules/@autonomous-testing/sdk/build/core/ports/logger.js +7 -0
- package/node_modules/@autonomous-testing/sdk/build/index.d.ts +4 -0
- package/node_modules/@autonomous-testing/sdk/build/index.js +20 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapter.d.ts +39 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapter.default.d.ts +16 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapter.default.js +31 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapter.interface.d.ts +93 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapter.interface.js +14 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapter.js +153 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapterQueries.d.ts +5 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapterQueries.js +102 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapterUtils.d.ts +9 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapterUtils.js +26 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/index.d.ts +7 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/index.js +8 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/consoleLogger/consoleLogger.d.ts +36 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/consoleLogger/consoleLogger.js +49 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/consoleLogger/index.d.ts +3 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/consoleLogger/index.js +6 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/index.d.ts +4 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/index.js +20 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/noLogger/index.d.ts +3 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/noLogger/index.js +6 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/noLogger/noLogger.d.ts +31 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/noLogger/noLogger.js +34 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/index.d.ts +3 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/index.js +19 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloTrackAdapterService/apolloTrackAdapterService.d.ts +4 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloTrackAdapterService/apolloTrackAdapterService.interface.d.ts +51 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloTrackAdapterService/apolloTrackAdapterService.interface.js +24 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloTrackAdapterService/apolloTrackAdapterService.js +13 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloTrackAdapterService/index.d.ts +4 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloTrackAdapterService/index.js +6 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/index.d.ts +3 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/index.js +19 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/loggerService/consoleLoggerOptions.interface.d.ts +4 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/loggerService/consoleLoggerOptions.interface.js +3 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/loggerService/index.d.ts +4 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/loggerService/index.js +6 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/loggerService/loggerOptions.interface.d.ts +8 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/loggerService/loggerOptions.interface.js +3 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/loggerService/loggerService.d.ts +4 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/loggerService/loggerService.js +24 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/index.d.ts +3 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/index.js +19 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/metadata/index.d.ts +3 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/metadata/index.js +7 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/metadata/versionMetadata.d.ts +3 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/metadata/versionMetadata.js +6 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/utils/error.interface.d.ts +4 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/utils/error.interface.js +12 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/utils/index.d.ts +4 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/utils/index.js +21 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/utils/zodHelper/index.d.ts +3 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/utils/zodHelper/index.js +6 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/utils/zodHelper/zodHelper.d.ts +14 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/utils/zodHelper/zodHelper.js +39 -0
- package/node_modules/@autonomous-testing/sdk/package.json +53 -0
- package/node_modules/asynckit/LICENSE +21 -0
- package/node_modules/asynckit/README.md +233 -0
- package/node_modules/asynckit/bench.js +76 -0
- package/node_modules/asynckit/index.js +6 -0
- package/node_modules/asynckit/lib/abort.js +29 -0
- package/node_modules/asynckit/lib/async.js +34 -0
- package/node_modules/asynckit/lib/defer.js +26 -0
- package/node_modules/asynckit/lib/iterate.js +75 -0
- package/node_modules/asynckit/lib/readable_asynckit.js +91 -0
- package/node_modules/asynckit/lib/readable_parallel.js +25 -0
- package/node_modules/asynckit/lib/readable_serial.js +25 -0
- package/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
- package/node_modules/asynckit/lib/state.js +37 -0
- package/node_modules/asynckit/lib/streamify.js +141 -0
- package/node_modules/asynckit/lib/terminator.js +29 -0
- package/node_modules/asynckit/package.json +63 -0
- package/node_modules/asynckit/parallel.js +43 -0
- package/node_modules/asynckit/serial.js +17 -0
- package/node_modules/asynckit/serialOrdered.js +75 -0
- package/node_modules/asynckit/stream.js +21 -0
- package/node_modules/axios/CHANGELOG.md +952 -0
- package/node_modules/axios/LICENSE +7 -0
- package/node_modules/axios/MIGRATION_GUIDE.md +3 -0
- package/node_modules/axios/README.md +1695 -0
- package/node_modules/axios/SECURITY.md +6 -0
- package/node_modules/axios/dist/axios.js +4172 -0
- package/node_modules/axios/dist/axios.js.map +1 -0
- package/node_modules/axios/dist/axios.min.js +2 -0
- package/node_modules/axios/dist/axios.min.js.map +1 -0
- package/node_modules/axios/dist/browser/axios.cjs +3638 -0
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -0
- package/node_modules/axios/dist/esm/axios.js +3661 -0
- package/node_modules/axios/dist/esm/axios.js.map +1 -0
- package/node_modules/axios/dist/esm/axios.min.js +2 -0
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -0
- package/node_modules/axios/dist/node/axios.cjs +4705 -0
- package/node_modules/axios/dist/node/axios.cjs.map +1 -0
- package/node_modules/axios/index.d.cts +545 -0
- package/node_modules/axios/index.d.ts +562 -0
- package/node_modules/axios/index.js +43 -0
- package/node_modules/axios/lib/adapters/README.md +37 -0
- package/node_modules/axios/lib/adapters/adapters.js +79 -0
- package/node_modules/axios/lib/adapters/fetch.js +227 -0
- package/node_modules/axios/lib/adapters/http.js +685 -0
- package/node_modules/axios/lib/adapters/xhr.js +190 -0
- package/node_modules/axios/lib/axios.js +89 -0
- package/node_modules/axios/lib/cancel/CancelToken.js +121 -0
- package/node_modules/axios/lib/cancel/CanceledError.js +25 -0
- package/node_modules/axios/lib/cancel/isCancel.js +5 -0
- package/node_modules/axios/lib/core/Axios.js +228 -0
- package/node_modules/axios/lib/core/AxiosError.js +100 -0
- package/node_modules/axios/lib/core/AxiosHeaders.js +302 -0
- package/node_modules/axios/lib/core/InterceptorManager.js +71 -0
- package/node_modules/axios/lib/core/README.md +8 -0
- package/node_modules/axios/lib/core/buildFullPath.js +21 -0
- package/node_modules/axios/lib/core/dispatchRequest.js +81 -0
- package/node_modules/axios/lib/core/mergeConfig.js +106 -0
- package/node_modules/axios/lib/core/settle.js +27 -0
- package/node_modules/axios/lib/core/transformData.js +28 -0
- package/node_modules/axios/lib/defaults/index.js +161 -0
- package/node_modules/axios/lib/defaults/transitional.js +7 -0
- package/node_modules/axios/lib/env/README.md +3 -0
- package/node_modules/axios/lib/env/classes/FormData.js +2 -0
- package/node_modules/axios/lib/env/data.js +1 -0
- package/node_modules/axios/lib/helpers/AxiosTransformStream.js +192 -0
- package/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +58 -0
- package/node_modules/axios/lib/helpers/HttpStatusCode.js +71 -0
- package/node_modules/axios/lib/helpers/README.md +7 -0
- package/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +28 -0
- package/node_modules/axios/lib/helpers/bind.js +7 -0
- package/node_modules/axios/lib/helpers/buildURL.js +63 -0
- package/node_modules/axios/lib/helpers/callbackify.js +16 -0
- package/node_modules/axios/lib/helpers/combineURLs.js +15 -0
- package/node_modules/axios/lib/helpers/composeSignals.js +46 -0
- package/node_modules/axios/lib/helpers/cookies.js +42 -0
- package/node_modules/axios/lib/helpers/deprecatedMethod.js +26 -0
- package/node_modules/axios/lib/helpers/formDataToJSON.js +95 -0
- package/node_modules/axios/lib/helpers/formDataToStream.js +111 -0
- package/node_modules/axios/lib/helpers/fromDataURI.js +53 -0
- package/node_modules/axios/lib/helpers/isAbsoluteURL.js +15 -0
- package/node_modules/axios/lib/helpers/isAxiosError.js +14 -0
- package/node_modules/axios/lib/helpers/isURLSameOrigin.js +67 -0
- package/node_modules/axios/lib/helpers/null.js +2 -0
- package/node_modules/axios/lib/helpers/parseHeaders.js +55 -0
- package/node_modules/axios/lib/helpers/parseProtocol.js +6 -0
- package/node_modules/axios/lib/helpers/progressEventReducer.js +32 -0
- package/node_modules/axios/lib/helpers/readBlob.js +15 -0
- package/node_modules/axios/lib/helpers/resolveConfig.js +57 -0
- package/node_modules/axios/lib/helpers/speedometer.js +55 -0
- package/node_modules/axios/lib/helpers/spread.js +28 -0
- package/node_modules/axios/lib/helpers/throttle.js +35 -0
- package/node_modules/axios/lib/helpers/toFormData.js +219 -0
- package/node_modules/axios/lib/helpers/toURLEncodedForm.js +18 -0
- package/node_modules/axios/lib/helpers/trackStream.js +55 -0
- package/node_modules/axios/lib/helpers/validator.js +91 -0
- package/node_modules/axios/lib/platform/browser/classes/Blob.js +3 -0
- package/node_modules/axios/lib/platform/browser/classes/FormData.js +3 -0
- package/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +4 -0
- package/node_modules/axios/lib/platform/browser/index.js +13 -0
- package/node_modules/axios/lib/platform/common/utils.js +50 -0
- package/node_modules/axios/lib/platform/index.js +7 -0
- package/node_modules/axios/lib/platform/node/classes/FormData.js +3 -0
- package/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +4 -0
- package/node_modules/axios/lib/platform/node/index.js +12 -0
- package/node_modules/axios/lib/utils.js +728 -0
- package/node_modules/axios/package.json +219 -0
- package/node_modules/combined-stream/License +19 -0
- package/node_modules/combined-stream/Readme.md +138 -0
- package/node_modules/combined-stream/lib/combined_stream.js +208 -0
- package/node_modules/combined-stream/package.json +25 -0
- package/node_modules/delayed-stream/.npmignore +1 -0
- package/node_modules/delayed-stream/License +19 -0
- package/node_modules/delayed-stream/Makefile +7 -0
- package/node_modules/delayed-stream/Readme.md +141 -0
- package/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
- package/node_modules/delayed-stream/package.json +27 -0
- package/node_modules/follow-redirects/LICENSE +18 -0
- package/node_modules/follow-redirects/README.md +155 -0
- package/node_modules/follow-redirects/debug.js +15 -0
- package/node_modules/follow-redirects/http.js +1 -0
- package/node_modules/follow-redirects/https.js +1 -0
- package/node_modules/follow-redirects/index.js +672 -0
- package/node_modules/follow-redirects/package.json +58 -0
- package/node_modules/form-data/License +19 -0
- package/node_modules/form-data/README.md.bak +358 -0
- package/node_modules/form-data/Readme.md +358 -0
- package/node_modules/form-data/index.d.ts +62 -0
- package/node_modules/form-data/lib/browser.js +2 -0
- package/node_modules/form-data/lib/form_data.js +501 -0
- package/node_modules/form-data/lib/populate.js +10 -0
- package/node_modules/form-data/package.json +68 -0
- package/node_modules/mime-db/HISTORY.md +507 -0
- package/node_modules/mime-db/LICENSE +23 -0
- package/node_modules/mime-db/README.md +100 -0
- package/node_modules/mime-db/db.json +8519 -0
- package/node_modules/mime-db/index.js +12 -0
- package/node_modules/mime-db/package.json +60 -0
- package/node_modules/mime-types/HISTORY.md +397 -0
- package/node_modules/mime-types/LICENSE +23 -0
- package/node_modules/mime-types/README.md +113 -0
- package/node_modules/mime-types/index.js +188 -0
- package/node_modules/mime-types/package.json +44 -0
- package/node_modules/proxy-from-env/.eslintrc +29 -0
- package/node_modules/proxy-from-env/.travis.yml +10 -0
- package/node_modules/proxy-from-env/LICENSE +20 -0
- package/node_modules/proxy-from-env/README.md +131 -0
- package/node_modules/proxy-from-env/index.js +108 -0
- package/node_modules/proxy-from-env/package.json +34 -0
- package/node_modules/proxy-from-env/test.js +483 -0
- package/node_modules/zod/LICENSE +21 -0
- package/node_modules/zod/README.md +2876 -0
- package/node_modules/zod/index.d.ts +2 -0
- package/node_modules/zod/lib/ZodError.d.ts +164 -0
- package/node_modules/zod/lib/ZodError.js +137 -0
- package/node_modules/zod/lib/__tests__/Mocker.d.ts +17 -0
- package/node_modules/zod/lib/__tests__/Mocker.js +57 -0
- package/node_modules/zod/lib/benchmarks/datetime.d.ts +5 -0
- package/node_modules/zod/lib/benchmarks/datetime.js +54 -0
- package/node_modules/zod/lib/benchmarks/discriminatedUnion.d.ts +5 -0
- package/node_modules/zod/lib/benchmarks/discriminatedUnion.js +79 -0
- package/node_modules/zod/lib/benchmarks/index.d.ts +1 -0
- package/node_modules/zod/lib/benchmarks/index.js +59 -0
- package/node_modules/zod/lib/benchmarks/ipv4.d.ts +5 -0
- package/node_modules/zod/lib/benchmarks/ipv4.js +54 -0
- package/node_modules/zod/lib/benchmarks/object.d.ts +5 -0
- package/node_modules/zod/lib/benchmarks/object.js +70 -0
- package/node_modules/zod/lib/benchmarks/primitives.d.ts +5 -0
- package/node_modules/zod/lib/benchmarks/primitives.js +170 -0
- package/node_modules/zod/lib/benchmarks/realworld.d.ts +5 -0
- package/node_modules/zod/lib/benchmarks/realworld.js +56 -0
- package/node_modules/zod/lib/benchmarks/string.d.ts +5 -0
- package/node_modules/zod/lib/benchmarks/string.js +55 -0
- package/node_modules/zod/lib/benchmarks/union.d.ts +5 -0
- package/node_modules/zod/lib/benchmarks/union.js +79 -0
- package/node_modules/zod/lib/errors.d.ts +5 -0
- package/node_modules/zod/lib/errors.js +17 -0
- package/node_modules/zod/lib/external.d.ts +6 -0
- package/node_modules/zod/lib/external.js +18 -0
- package/node_modules/zod/lib/helpers/enumUtil.d.ts +8 -0
- package/node_modules/zod/lib/helpers/enumUtil.js +2 -0
- package/node_modules/zod/lib/helpers/errorUtil.d.ts +9 -0
- package/node_modules/zod/lib/helpers/errorUtil.js +8 -0
- package/node_modules/zod/lib/helpers/parseUtil.d.ts +78 -0
- package/node_modules/zod/lib/helpers/parseUtil.js +125 -0
- package/node_modules/zod/lib/helpers/partialUtil.d.ts +8 -0
- package/node_modules/zod/lib/helpers/partialUtil.js +2 -0
- package/node_modules/zod/lib/helpers/typeAliases.d.ts +2 -0
- package/node_modules/zod/lib/helpers/typeAliases.js +2 -0
- package/node_modules/zod/lib/helpers/util.d.ts +82 -0
- package/node_modules/zod/lib/helpers/util.js +142 -0
- package/node_modules/zod/lib/index.d.ts +4 -0
- package/node_modules/zod/lib/index.js +29 -0
- package/node_modules/zod/lib/index.mjs +4236 -0
- package/node_modules/zod/lib/index.umd.js +4351 -0
- package/node_modules/zod/lib/locales/en.d.ts +3 -0
- package/node_modules/zod/lib/locales/en.js +129 -0
- package/node_modules/zod/lib/types.d.ts +1127 -0
- package/node_modules/zod/lib/types.js +3677 -0
- package/node_modules/zod/package.json +119 -0
- package/package.json +79 -0
|
@@ -0,0 +1,728 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import bind from './helpers/bind.js';
|
|
4
|
+
|
|
5
|
+
// utils is a library of generic helper functions non-specific to axios
|
|
6
|
+
|
|
7
|
+
const {toString} = Object.prototype;
|
|
8
|
+
const {getPrototypeOf} = Object;
|
|
9
|
+
|
|
10
|
+
const kindOf = (cache => thing => {
|
|
11
|
+
const str = toString.call(thing);
|
|
12
|
+
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
13
|
+
})(Object.create(null));
|
|
14
|
+
|
|
15
|
+
const kindOfTest = (type) => {
|
|
16
|
+
type = type.toLowerCase();
|
|
17
|
+
return (thing) => kindOf(thing) === type
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const typeOfTest = type => thing => typeof thing === type;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Determine if a value is an Array
|
|
24
|
+
*
|
|
25
|
+
* @param {Object} val The value to test
|
|
26
|
+
*
|
|
27
|
+
* @returns {boolean} True if value is an Array, otherwise false
|
|
28
|
+
*/
|
|
29
|
+
const {isArray} = Array;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Determine if a value is undefined
|
|
33
|
+
*
|
|
34
|
+
* @param {*} val The value to test
|
|
35
|
+
*
|
|
36
|
+
* @returns {boolean} True if the value is undefined, otherwise false
|
|
37
|
+
*/
|
|
38
|
+
const isUndefined = typeOfTest('undefined');
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Determine if a value is a Buffer
|
|
42
|
+
*
|
|
43
|
+
* @param {*} val The value to test
|
|
44
|
+
*
|
|
45
|
+
* @returns {boolean} True if value is a Buffer, otherwise false
|
|
46
|
+
*/
|
|
47
|
+
function isBuffer(val) {
|
|
48
|
+
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
|
|
49
|
+
&& isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Determine if a value is an ArrayBuffer
|
|
54
|
+
*
|
|
55
|
+
* @param {*} val The value to test
|
|
56
|
+
*
|
|
57
|
+
* @returns {boolean} True if value is an ArrayBuffer, otherwise false
|
|
58
|
+
*/
|
|
59
|
+
const isArrayBuffer = kindOfTest('ArrayBuffer');
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Determine if a value is a view on an ArrayBuffer
|
|
64
|
+
*
|
|
65
|
+
* @param {*} val The value to test
|
|
66
|
+
*
|
|
67
|
+
* @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
|
|
68
|
+
*/
|
|
69
|
+
function isArrayBufferView(val) {
|
|
70
|
+
let result;
|
|
71
|
+
if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
|
|
72
|
+
result = ArrayBuffer.isView(val);
|
|
73
|
+
} else {
|
|
74
|
+
result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
|
|
75
|
+
}
|
|
76
|
+
return result;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Determine if a value is a String
|
|
81
|
+
*
|
|
82
|
+
* @param {*} val The value to test
|
|
83
|
+
*
|
|
84
|
+
* @returns {boolean} True if value is a String, otherwise false
|
|
85
|
+
*/
|
|
86
|
+
const isString = typeOfTest('string');
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Determine if a value is a Function
|
|
90
|
+
*
|
|
91
|
+
* @param {*} val The value to test
|
|
92
|
+
* @returns {boolean} True if value is a Function, otherwise false
|
|
93
|
+
*/
|
|
94
|
+
const isFunction = typeOfTest('function');
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Determine if a value is a Number
|
|
98
|
+
*
|
|
99
|
+
* @param {*} val The value to test
|
|
100
|
+
*
|
|
101
|
+
* @returns {boolean} True if value is a Number, otherwise false
|
|
102
|
+
*/
|
|
103
|
+
const isNumber = typeOfTest('number');
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Determine if a value is an Object
|
|
107
|
+
*
|
|
108
|
+
* @param {*} thing The value to test
|
|
109
|
+
*
|
|
110
|
+
* @returns {boolean} True if value is an Object, otherwise false
|
|
111
|
+
*/
|
|
112
|
+
const isObject = (thing) => thing !== null && typeof thing === 'object';
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Determine if a value is a Boolean
|
|
116
|
+
*
|
|
117
|
+
* @param {*} thing The value to test
|
|
118
|
+
* @returns {boolean} True if value is a Boolean, otherwise false
|
|
119
|
+
*/
|
|
120
|
+
const isBoolean = thing => thing === true || thing === false;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Determine if a value is a plain Object
|
|
124
|
+
*
|
|
125
|
+
* @param {*} val The value to test
|
|
126
|
+
*
|
|
127
|
+
* @returns {boolean} True if value is a plain Object, otherwise false
|
|
128
|
+
*/
|
|
129
|
+
const isPlainObject = (val) => {
|
|
130
|
+
if (kindOf(val) !== 'object') {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const prototype = getPrototypeOf(val);
|
|
135
|
+
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Determine if a value is a Date
|
|
140
|
+
*
|
|
141
|
+
* @param {*} val The value to test
|
|
142
|
+
*
|
|
143
|
+
* @returns {boolean} True if value is a Date, otherwise false
|
|
144
|
+
*/
|
|
145
|
+
const isDate = kindOfTest('Date');
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Determine if a value is a File
|
|
149
|
+
*
|
|
150
|
+
* @param {*} val The value to test
|
|
151
|
+
*
|
|
152
|
+
* @returns {boolean} True if value is a File, otherwise false
|
|
153
|
+
*/
|
|
154
|
+
const isFile = kindOfTest('File');
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Determine if a value is a Blob
|
|
158
|
+
*
|
|
159
|
+
* @param {*} val The value to test
|
|
160
|
+
*
|
|
161
|
+
* @returns {boolean} True if value is a Blob, otherwise false
|
|
162
|
+
*/
|
|
163
|
+
const isBlob = kindOfTest('Blob');
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Determine if a value is a FileList
|
|
167
|
+
*
|
|
168
|
+
* @param {*} val The value to test
|
|
169
|
+
*
|
|
170
|
+
* @returns {boolean} True if value is a File, otherwise false
|
|
171
|
+
*/
|
|
172
|
+
const isFileList = kindOfTest('FileList');
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Determine if a value is a Stream
|
|
176
|
+
*
|
|
177
|
+
* @param {*} val The value to test
|
|
178
|
+
*
|
|
179
|
+
* @returns {boolean} True if value is a Stream, otherwise false
|
|
180
|
+
*/
|
|
181
|
+
const isStream = (val) => isObject(val) && isFunction(val.pipe);
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Determine if a value is a FormData
|
|
185
|
+
*
|
|
186
|
+
* @param {*} thing The value to test
|
|
187
|
+
*
|
|
188
|
+
* @returns {boolean} True if value is an FormData, otherwise false
|
|
189
|
+
*/
|
|
190
|
+
const isFormData = (thing) => {
|
|
191
|
+
let kind;
|
|
192
|
+
return thing && (
|
|
193
|
+
(typeof FormData === 'function' && thing instanceof FormData) || (
|
|
194
|
+
isFunction(thing.append) && (
|
|
195
|
+
(kind = kindOf(thing)) === 'formdata' ||
|
|
196
|
+
// detect form-data instance
|
|
197
|
+
(kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')
|
|
198
|
+
)
|
|
199
|
+
)
|
|
200
|
+
)
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Determine if a value is a URLSearchParams object
|
|
205
|
+
*
|
|
206
|
+
* @param {*} val The value to test
|
|
207
|
+
*
|
|
208
|
+
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
|
|
209
|
+
*/
|
|
210
|
+
const isURLSearchParams = kindOfTest('URLSearchParams');
|
|
211
|
+
|
|
212
|
+
const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Trim excess whitespace off the beginning and end of a string
|
|
216
|
+
*
|
|
217
|
+
* @param {String} str The String to trim
|
|
218
|
+
*
|
|
219
|
+
* @returns {String} The String freed of excess whitespace
|
|
220
|
+
*/
|
|
221
|
+
const trim = (str) => str.trim ?
|
|
222
|
+
str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Iterate over an Array or an Object invoking a function for each item.
|
|
226
|
+
*
|
|
227
|
+
* If `obj` is an Array callback will be called passing
|
|
228
|
+
* the value, index, and complete array for each item.
|
|
229
|
+
*
|
|
230
|
+
* If 'obj' is an Object callback will be called passing
|
|
231
|
+
* the value, key, and complete object for each property.
|
|
232
|
+
*
|
|
233
|
+
* @param {Object|Array} obj The object to iterate
|
|
234
|
+
* @param {Function} fn The callback to invoke for each item
|
|
235
|
+
*
|
|
236
|
+
* @param {Boolean} [allOwnKeys = false]
|
|
237
|
+
* @returns {any}
|
|
238
|
+
*/
|
|
239
|
+
function forEach(obj, fn, {allOwnKeys = false} = {}) {
|
|
240
|
+
// Don't bother if no value provided
|
|
241
|
+
if (obj === null || typeof obj === 'undefined') {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
let i;
|
|
246
|
+
let l;
|
|
247
|
+
|
|
248
|
+
// Force an array if not already something iterable
|
|
249
|
+
if (typeof obj !== 'object') {
|
|
250
|
+
/*eslint no-param-reassign:0*/
|
|
251
|
+
obj = [obj];
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
if (isArray(obj)) {
|
|
255
|
+
// Iterate over array values
|
|
256
|
+
for (i = 0, l = obj.length; i < l; i++) {
|
|
257
|
+
fn.call(null, obj[i], i, obj);
|
|
258
|
+
}
|
|
259
|
+
} else {
|
|
260
|
+
// Iterate over object keys
|
|
261
|
+
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
|
|
262
|
+
const len = keys.length;
|
|
263
|
+
let key;
|
|
264
|
+
|
|
265
|
+
for (i = 0; i < len; i++) {
|
|
266
|
+
key = keys[i];
|
|
267
|
+
fn.call(null, obj[key], key, obj);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
function findKey(obj, key) {
|
|
273
|
+
key = key.toLowerCase();
|
|
274
|
+
const keys = Object.keys(obj);
|
|
275
|
+
let i = keys.length;
|
|
276
|
+
let _key;
|
|
277
|
+
while (i-- > 0) {
|
|
278
|
+
_key = keys[i];
|
|
279
|
+
if (key === _key.toLowerCase()) {
|
|
280
|
+
return _key;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
return null;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
const _global = (() => {
|
|
287
|
+
/*eslint no-undef:0*/
|
|
288
|
+
if (typeof globalThis !== "undefined") return globalThis;
|
|
289
|
+
return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
|
|
290
|
+
})();
|
|
291
|
+
|
|
292
|
+
const isContextDefined = (context) => !isUndefined(context) && context !== _global;
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Accepts varargs expecting each argument to be an object, then
|
|
296
|
+
* immutably merges the properties of each object and returns result.
|
|
297
|
+
*
|
|
298
|
+
* When multiple objects contain the same key the later object in
|
|
299
|
+
* the arguments list will take precedence.
|
|
300
|
+
*
|
|
301
|
+
* Example:
|
|
302
|
+
*
|
|
303
|
+
* ```js
|
|
304
|
+
* var result = merge({foo: 123}, {foo: 456});
|
|
305
|
+
* console.log(result.foo); // outputs 456
|
|
306
|
+
* ```
|
|
307
|
+
*
|
|
308
|
+
* @param {Object} obj1 Object to merge
|
|
309
|
+
*
|
|
310
|
+
* @returns {Object} Result of all merge properties
|
|
311
|
+
*/
|
|
312
|
+
function merge(/* obj1, obj2, obj3, ... */) {
|
|
313
|
+
const {caseless} = isContextDefined(this) && this || {};
|
|
314
|
+
const result = {};
|
|
315
|
+
const assignValue = (val, key) => {
|
|
316
|
+
const targetKey = caseless && findKey(result, key) || key;
|
|
317
|
+
if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
|
|
318
|
+
result[targetKey] = merge(result[targetKey], val);
|
|
319
|
+
} else if (isPlainObject(val)) {
|
|
320
|
+
result[targetKey] = merge({}, val);
|
|
321
|
+
} else if (isArray(val)) {
|
|
322
|
+
result[targetKey] = val.slice();
|
|
323
|
+
} else {
|
|
324
|
+
result[targetKey] = val;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
for (let i = 0, l = arguments.length; i < l; i++) {
|
|
329
|
+
arguments[i] && forEach(arguments[i], assignValue);
|
|
330
|
+
}
|
|
331
|
+
return result;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Extends object a by mutably adding to it the properties of object b.
|
|
336
|
+
*
|
|
337
|
+
* @param {Object} a The object to be extended
|
|
338
|
+
* @param {Object} b The object to copy properties from
|
|
339
|
+
* @param {Object} thisArg The object to bind function to
|
|
340
|
+
*
|
|
341
|
+
* @param {Boolean} [allOwnKeys]
|
|
342
|
+
* @returns {Object} The resulting value of object a
|
|
343
|
+
*/
|
|
344
|
+
const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
|
|
345
|
+
forEach(b, (val, key) => {
|
|
346
|
+
if (thisArg && isFunction(val)) {
|
|
347
|
+
a[key] = bind(val, thisArg);
|
|
348
|
+
} else {
|
|
349
|
+
a[key] = val;
|
|
350
|
+
}
|
|
351
|
+
}, {allOwnKeys});
|
|
352
|
+
return a;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
|
|
357
|
+
*
|
|
358
|
+
* @param {string} content with BOM
|
|
359
|
+
*
|
|
360
|
+
* @returns {string} content value without BOM
|
|
361
|
+
*/
|
|
362
|
+
const stripBOM = (content) => {
|
|
363
|
+
if (content.charCodeAt(0) === 0xFEFF) {
|
|
364
|
+
content = content.slice(1);
|
|
365
|
+
}
|
|
366
|
+
return content;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Inherit the prototype methods from one constructor into another
|
|
371
|
+
* @param {function} constructor
|
|
372
|
+
* @param {function} superConstructor
|
|
373
|
+
* @param {object} [props]
|
|
374
|
+
* @param {object} [descriptors]
|
|
375
|
+
*
|
|
376
|
+
* @returns {void}
|
|
377
|
+
*/
|
|
378
|
+
const inherits = (constructor, superConstructor, props, descriptors) => {
|
|
379
|
+
constructor.prototype = Object.create(superConstructor.prototype, descriptors);
|
|
380
|
+
constructor.prototype.constructor = constructor;
|
|
381
|
+
Object.defineProperty(constructor, 'super', {
|
|
382
|
+
value: superConstructor.prototype
|
|
383
|
+
});
|
|
384
|
+
props && Object.assign(constructor.prototype, props);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Resolve object with deep prototype chain to a flat object
|
|
389
|
+
* @param {Object} sourceObj source object
|
|
390
|
+
* @param {Object} [destObj]
|
|
391
|
+
* @param {Function|Boolean} [filter]
|
|
392
|
+
* @param {Function} [propFilter]
|
|
393
|
+
*
|
|
394
|
+
* @returns {Object}
|
|
395
|
+
*/
|
|
396
|
+
const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
|
|
397
|
+
let props;
|
|
398
|
+
let i;
|
|
399
|
+
let prop;
|
|
400
|
+
const merged = {};
|
|
401
|
+
|
|
402
|
+
destObj = destObj || {};
|
|
403
|
+
// eslint-disable-next-line no-eq-null,eqeqeq
|
|
404
|
+
if (sourceObj == null) return destObj;
|
|
405
|
+
|
|
406
|
+
do {
|
|
407
|
+
props = Object.getOwnPropertyNames(sourceObj);
|
|
408
|
+
i = props.length;
|
|
409
|
+
while (i-- > 0) {
|
|
410
|
+
prop = props[i];
|
|
411
|
+
if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
|
|
412
|
+
destObj[prop] = sourceObj[prop];
|
|
413
|
+
merged[prop] = true;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
sourceObj = filter !== false && getPrototypeOf(sourceObj);
|
|
417
|
+
} while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
|
|
418
|
+
|
|
419
|
+
return destObj;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* Determines whether a string ends with the characters of a specified string
|
|
424
|
+
*
|
|
425
|
+
* @param {String} str
|
|
426
|
+
* @param {String} searchString
|
|
427
|
+
* @param {Number} [position= 0]
|
|
428
|
+
*
|
|
429
|
+
* @returns {boolean}
|
|
430
|
+
*/
|
|
431
|
+
const endsWith = (str, searchString, position) => {
|
|
432
|
+
str = String(str);
|
|
433
|
+
if (position === undefined || position > str.length) {
|
|
434
|
+
position = str.length;
|
|
435
|
+
}
|
|
436
|
+
position -= searchString.length;
|
|
437
|
+
const lastIndex = str.indexOf(searchString, position);
|
|
438
|
+
return lastIndex !== -1 && lastIndex === position;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Returns new array from array like object or null if failed
|
|
444
|
+
*
|
|
445
|
+
* @param {*} [thing]
|
|
446
|
+
*
|
|
447
|
+
* @returns {?Array}
|
|
448
|
+
*/
|
|
449
|
+
const toArray = (thing) => {
|
|
450
|
+
if (!thing) return null;
|
|
451
|
+
if (isArray(thing)) return thing;
|
|
452
|
+
let i = thing.length;
|
|
453
|
+
if (!isNumber(i)) return null;
|
|
454
|
+
const arr = new Array(i);
|
|
455
|
+
while (i-- > 0) {
|
|
456
|
+
arr[i] = thing[i];
|
|
457
|
+
}
|
|
458
|
+
return arr;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* Checking if the Uint8Array exists and if it does, it returns a function that checks if the
|
|
463
|
+
* thing passed in is an instance of Uint8Array
|
|
464
|
+
*
|
|
465
|
+
* @param {TypedArray}
|
|
466
|
+
*
|
|
467
|
+
* @returns {Array}
|
|
468
|
+
*/
|
|
469
|
+
// eslint-disable-next-line func-names
|
|
470
|
+
const isTypedArray = (TypedArray => {
|
|
471
|
+
// eslint-disable-next-line func-names
|
|
472
|
+
return thing => {
|
|
473
|
+
return TypedArray && thing instanceof TypedArray;
|
|
474
|
+
};
|
|
475
|
+
})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* For each entry in the object, call the function with the key and value.
|
|
479
|
+
*
|
|
480
|
+
* @param {Object<any, any>} obj - The object to iterate over.
|
|
481
|
+
* @param {Function} fn - The function to call for each entry.
|
|
482
|
+
*
|
|
483
|
+
* @returns {void}
|
|
484
|
+
*/
|
|
485
|
+
const forEachEntry = (obj, fn) => {
|
|
486
|
+
const generator = obj && obj[Symbol.iterator];
|
|
487
|
+
|
|
488
|
+
const iterator = generator.call(obj);
|
|
489
|
+
|
|
490
|
+
let result;
|
|
491
|
+
|
|
492
|
+
while ((result = iterator.next()) && !result.done) {
|
|
493
|
+
const pair = result.value;
|
|
494
|
+
fn.call(obj, pair[0], pair[1]);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* It takes a regular expression and a string, and returns an array of all the matches
|
|
500
|
+
*
|
|
501
|
+
* @param {string} regExp - The regular expression to match against.
|
|
502
|
+
* @param {string} str - The string to search.
|
|
503
|
+
*
|
|
504
|
+
* @returns {Array<boolean>}
|
|
505
|
+
*/
|
|
506
|
+
const matchAll = (regExp, str) => {
|
|
507
|
+
let matches;
|
|
508
|
+
const arr = [];
|
|
509
|
+
|
|
510
|
+
while ((matches = regExp.exec(str)) !== null) {
|
|
511
|
+
arr.push(matches);
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
return arr;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
|
|
518
|
+
const isHTMLForm = kindOfTest('HTMLFormElement');
|
|
519
|
+
|
|
520
|
+
const toCamelCase = str => {
|
|
521
|
+
return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
|
|
522
|
+
function replacer(m, p1, p2) {
|
|
523
|
+
return p1.toUpperCase() + p2;
|
|
524
|
+
}
|
|
525
|
+
);
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
/* Creating a function that will check if an object has a property. */
|
|
529
|
+
const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* Determine if a value is a RegExp object
|
|
533
|
+
*
|
|
534
|
+
* @param {*} val The value to test
|
|
535
|
+
*
|
|
536
|
+
* @returns {boolean} True if value is a RegExp object, otherwise false
|
|
537
|
+
*/
|
|
538
|
+
const isRegExp = kindOfTest('RegExp');
|
|
539
|
+
|
|
540
|
+
const reduceDescriptors = (obj, reducer) => {
|
|
541
|
+
const descriptors = Object.getOwnPropertyDescriptors(obj);
|
|
542
|
+
const reducedDescriptors = {};
|
|
543
|
+
|
|
544
|
+
forEach(descriptors, (descriptor, name) => {
|
|
545
|
+
let ret;
|
|
546
|
+
if ((ret = reducer(descriptor, name, obj)) !== false) {
|
|
547
|
+
reducedDescriptors[name] = ret || descriptor;
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
|
|
551
|
+
Object.defineProperties(obj, reducedDescriptors);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* Makes all methods read-only
|
|
556
|
+
* @param {Object} obj
|
|
557
|
+
*/
|
|
558
|
+
|
|
559
|
+
const freezeMethods = (obj) => {
|
|
560
|
+
reduceDescriptors(obj, (descriptor, name) => {
|
|
561
|
+
// skip restricted props in strict mode
|
|
562
|
+
if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
|
|
563
|
+
return false;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
const value = obj[name];
|
|
567
|
+
|
|
568
|
+
if (!isFunction(value)) return;
|
|
569
|
+
|
|
570
|
+
descriptor.enumerable = false;
|
|
571
|
+
|
|
572
|
+
if ('writable' in descriptor) {
|
|
573
|
+
descriptor.writable = false;
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
if (!descriptor.set) {
|
|
578
|
+
descriptor.set = () => {
|
|
579
|
+
throw Error('Can not rewrite read-only method \'' + name + '\'');
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
});
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
const toObjectSet = (arrayOrString, delimiter) => {
|
|
586
|
+
const obj = {};
|
|
587
|
+
|
|
588
|
+
const define = (arr) => {
|
|
589
|
+
arr.forEach(value => {
|
|
590
|
+
obj[value] = true;
|
|
591
|
+
});
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
|
|
595
|
+
|
|
596
|
+
return obj;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
const noop = () => {}
|
|
600
|
+
|
|
601
|
+
const toFiniteNumber = (value, defaultValue) => {
|
|
602
|
+
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
const ALPHA = 'abcdefghijklmnopqrstuvwxyz'
|
|
606
|
+
|
|
607
|
+
const DIGIT = '0123456789';
|
|
608
|
+
|
|
609
|
+
const ALPHABET = {
|
|
610
|
+
DIGIT,
|
|
611
|
+
ALPHA,
|
|
612
|
+
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
|
616
|
+
let str = '';
|
|
617
|
+
const {length} = alphabet;
|
|
618
|
+
while (size--) {
|
|
619
|
+
str += alphabet[Math.random() * length|0]
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
return str;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* If the thing is a FormData object, return true, otherwise return false.
|
|
627
|
+
*
|
|
628
|
+
* @param {unknown} thing - The thing to check.
|
|
629
|
+
*
|
|
630
|
+
* @returns {boolean}
|
|
631
|
+
*/
|
|
632
|
+
function isSpecCompliantForm(thing) {
|
|
633
|
+
return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
const toJSONObject = (obj) => {
|
|
637
|
+
const stack = new Array(10);
|
|
638
|
+
|
|
639
|
+
const visit = (source, i) => {
|
|
640
|
+
|
|
641
|
+
if (isObject(source)) {
|
|
642
|
+
if (stack.indexOf(source) >= 0) {
|
|
643
|
+
return;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
if(!('toJSON' in source)) {
|
|
647
|
+
stack[i] = source;
|
|
648
|
+
const target = isArray(source) ? [] : {};
|
|
649
|
+
|
|
650
|
+
forEach(source, (value, key) => {
|
|
651
|
+
const reducedValue = visit(value, i + 1);
|
|
652
|
+
!isUndefined(reducedValue) && (target[key] = reducedValue);
|
|
653
|
+
});
|
|
654
|
+
|
|
655
|
+
stack[i] = undefined;
|
|
656
|
+
|
|
657
|
+
return target;
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
return source;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
return visit(obj, 0);
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
const isAsyncFn = kindOfTest('AsyncFunction');
|
|
668
|
+
|
|
669
|
+
const isThenable = (thing) =>
|
|
670
|
+
thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
|
671
|
+
|
|
672
|
+
export default {
|
|
673
|
+
isArray,
|
|
674
|
+
isArrayBuffer,
|
|
675
|
+
isBuffer,
|
|
676
|
+
isFormData,
|
|
677
|
+
isArrayBufferView,
|
|
678
|
+
isString,
|
|
679
|
+
isNumber,
|
|
680
|
+
isBoolean,
|
|
681
|
+
isObject,
|
|
682
|
+
isPlainObject,
|
|
683
|
+
isReadableStream,
|
|
684
|
+
isRequest,
|
|
685
|
+
isResponse,
|
|
686
|
+
isHeaders,
|
|
687
|
+
isUndefined,
|
|
688
|
+
isDate,
|
|
689
|
+
isFile,
|
|
690
|
+
isBlob,
|
|
691
|
+
isRegExp,
|
|
692
|
+
isFunction,
|
|
693
|
+
isStream,
|
|
694
|
+
isURLSearchParams,
|
|
695
|
+
isTypedArray,
|
|
696
|
+
isFileList,
|
|
697
|
+
forEach,
|
|
698
|
+
merge,
|
|
699
|
+
extend,
|
|
700
|
+
trim,
|
|
701
|
+
stripBOM,
|
|
702
|
+
inherits,
|
|
703
|
+
toFlatObject,
|
|
704
|
+
kindOf,
|
|
705
|
+
kindOfTest,
|
|
706
|
+
endsWith,
|
|
707
|
+
toArray,
|
|
708
|
+
forEachEntry,
|
|
709
|
+
matchAll,
|
|
710
|
+
isHTMLForm,
|
|
711
|
+
hasOwnProperty,
|
|
712
|
+
hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection
|
|
713
|
+
reduceDescriptors,
|
|
714
|
+
freezeMethods,
|
|
715
|
+
toObjectSet,
|
|
716
|
+
toCamelCase,
|
|
717
|
+
noop,
|
|
718
|
+
toFiniteNumber,
|
|
719
|
+
findKey,
|
|
720
|
+
global: _global,
|
|
721
|
+
isContextDefined,
|
|
722
|
+
ALPHABET,
|
|
723
|
+
generateString,
|
|
724
|
+
isSpecCompliantForm,
|
|
725
|
+
toJSONObject,
|
|
726
|
+
isAsyncFn,
|
|
727
|
+
isThenable
|
|
728
|
+
};
|