@dartcom/ui-kit 2.9.1 → 3.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/dist/cjs/components/layers/leaflet/hooks/useGetLeafletLayer.js +51 -0
- package/dist/cjs/components/layers/leaflet/hooks/useGetLeafletLayer.js.map +1 -0
- package/dist/cjs/components/layers/leaflet/leaflet.js +47 -0
- package/dist/cjs/components/layers/leaflet/leaflet.js.map +1 -0
- package/dist/cjs/configs/global/constants.js +13 -0
- package/dist/cjs/configs/global/constants.js.map +1 -0
- package/dist/cjs/configs/global/global.js +32 -8
- package/dist/cjs/configs/global/global.js.map +1 -1
- package/dist/cjs/index.js +6 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/node_modules/@react-leaflet/core/lib/context.js +19 -0
- package/dist/cjs/node_modules/@react-leaflet/core/lib/context.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/adapters/adapters.js +88 -0
- package/dist/cjs/node_modules/axios/lib/adapters/adapters.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/adapters/fetch.js +293 -0
- package/dist/cjs/node_modules/axios/lib/adapters/fetch.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/adapters/xhr.js +207 -0
- package/dist/cjs/node_modules/axios/lib/adapters/xhr.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/axios.js +95 -0
- package/dist/cjs/node_modules/axios/lib/axios.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/cancel/CancelToken.js +141 -0
- package/dist/cjs/node_modules/axios/lib/cancel/CancelToken.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/cancel/CanceledError.js +29 -0
- package/dist/cjs/node_modules/axios/lib/cancel/CanceledError.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/cancel/isCancel.js +11 -0
- package/dist/cjs/node_modules/axios/lib/cancel/isCancel.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/core/Axios.js +244 -0
- package/dist/cjs/node_modules/axios/lib/core/Axios.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/core/AxiosError.js +114 -0
- package/dist/cjs/node_modules/axios/lib/core/AxiosError.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/core/AxiosHeaders.js +320 -0
- package/dist/cjs/node_modules/axios/lib/core/AxiosHeaders.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/core/InterceptorManager.js +77 -0
- package/dist/cjs/node_modules/axios/lib/core/InterceptorManager.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/core/buildFullPath.js +28 -0
- package/dist/cjs/node_modules/axios/lib/core/buildFullPath.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/core/dispatchRequest.js +87 -0
- package/dist/cjs/node_modules/axios/lib/core/dispatchRequest.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/core/mergeConfig.js +112 -0
- package/dist/cjs/node_modules/axios/lib/core/mergeConfig.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/core/settle.js +33 -0
- package/dist/cjs/node_modules/axios/lib/core/settle.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/core/transformData.js +34 -0
- package/dist/cjs/node_modules/axios/lib/core/transformData.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/defaults/index.js +167 -0
- package/dist/cjs/node_modules/axios/lib/defaults/index.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/defaults/transitional.js +13 -0
- package/dist/cjs/node_modules/axios/lib/defaults/transitional.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/env/data.js +8 -0
- package/dist/cjs/node_modules/axios/lib/env/data.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +62 -0
- package/dist/cjs/node_modules/axios/lib/helpers/AxiosURLSearchParams.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/HttpStatusCode.js +78 -0
- package/dist/cjs/node_modules/axios/lib/helpers/HttpStatusCode.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/bind.js +13 -0
- package/dist/cjs/node_modules/axios/lib/helpers/bind.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/buildURL.js +73 -0
- package/dist/cjs/node_modules/axios/lib/helpers/buildURL.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/combineURLs.js +21 -0
- package/dist/cjs/node_modules/axios/lib/helpers/combineURLs.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/composeSignals.js +55 -0
- package/dist/cjs/node_modules/axios/lib/helpers/composeSignals.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/cookies.js +48 -0
- package/dist/cjs/node_modules/axios/lib/helpers/cookies.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/formDataToJSON.js +99 -0
- package/dist/cjs/node_modules/axios/lib/helpers/formDataToJSON.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/isAbsoluteURL.js +21 -0
- package/dist/cjs/node_modules/axios/lib/helpers/isAbsoluteURL.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/isAxiosError.js +20 -0
- package/dist/cjs/node_modules/axios/lib/helpers/isAxiosError.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/isURLSameOrigin.js +21 -0
- package/dist/cjs/node_modules/axios/lib/helpers/isURLSameOrigin.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/null.js +9 -0
- package/dist/cjs/node_modules/axios/lib/helpers/null.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/parseHeaders.js +61 -0
- package/dist/cjs/node_modules/axios/lib/helpers/parseHeaders.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/parseProtocol.js +12 -0
- package/dist/cjs/node_modules/axios/lib/helpers/parseProtocol.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/progressEventReducer.js +53 -0
- package/dist/cjs/node_modules/axios/lib/helpers/progressEventReducer.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/resolveConfig.js +67 -0
- package/dist/cjs/node_modules/axios/lib/helpers/resolveConfig.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/speedometer.js +59 -0
- package/dist/cjs/node_modules/axios/lib/helpers/speedometer.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/spread.js +34 -0
- package/dist/cjs/node_modules/axios/lib/helpers/spread.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/throttle.js +49 -0
- package/dist/cjs/node_modules/axios/lib/helpers/throttle.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/toFormData.js +225 -0
- package/dist/cjs/node_modules/axios/lib/helpers/toFormData.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/toURLEncodedForm.js +25 -0
- package/dist/cjs/node_modules/axios/lib/helpers/toURLEncodedForm.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/trackStream.js +95 -0
- package/dist/cjs/node_modules/axios/lib/helpers/trackStream.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/helpers/validator.js +105 -0
- package/dist/cjs/node_modules/axios/lib/helpers/validator.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/platform/browser/classes/Blob.js +9 -0
- package/dist/cjs/node_modules/axios/lib/platform/browser/classes/Blob.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/platform/browser/classes/FormData.js +9 -0
- package/dist/cjs/node_modules/axios/lib/platform/browser/classes/FormData.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +11 -0
- package/dist/cjs/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/platform/browser/index.js +20 -0
- package/dist/cjs/node_modules/axios/lib/platform/browser/index.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/platform/common/utils.js +54 -0
- package/dist/cjs/node_modules/axios/lib/platform/common/utils.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/platform/index.js +14 -0
- package/dist/cjs/node_modules/axios/lib/platform/index.js.map +1 -0
- package/dist/cjs/node_modules/axios/lib/utils.js +788 -0
- package/dist/cjs/node_modules/axios/lib/utils.js.map +1 -0
- package/dist/cjs/node_modules/react-leaflet/lib/hooks.js +13 -0
- package/dist/cjs/node_modules/react-leaflet/lib/hooks.js.map +1 -0
- package/dist/cjs/node_modules/tangram/dist/tangram.min.js +58 -0
- package/dist/cjs/node_modules/tangram/dist/tangram.min.js.map +1 -0
- package/dist/cjs/services/api/api.service.js +45 -0
- package/dist/cjs/services/api/api.service.js.map +1 -0
- package/dist/esm/components/layers/leaflet/hooks/useGetLeafletLayer.js +2 -0
- package/dist/esm/components/layers/leaflet/hooks/useGetLeafletLayer.js.map +1 -0
- package/dist/esm/components/layers/leaflet/leaflet.js +2 -0
- package/dist/esm/components/layers/leaflet/leaflet.js.map +1 -0
- package/dist/esm/configs/global/constants.js +2 -0
- package/dist/esm/configs/global/constants.js.map +1 -0
- package/dist/esm/configs/global/global.js +1 -1
- package/dist/esm/configs/global/global.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/node_modules/@react-leaflet/core/lib/context.js +2 -0
- package/dist/esm/node_modules/@react-leaflet/core/lib/context.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/adapters/adapters.js +2 -0
- package/dist/esm/node_modules/axios/lib/adapters/adapters.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/adapters/fetch.js +2 -0
- package/dist/esm/node_modules/axios/lib/adapters/fetch.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/adapters/xhr.js +2 -0
- package/dist/esm/node_modules/axios/lib/adapters/xhr.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/axios.js +3 -0
- package/dist/esm/node_modules/axios/lib/axios.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/cancel/CancelToken.js +3 -0
- package/dist/esm/node_modules/axios/lib/cancel/CancelToken.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/cancel/CanceledError.js +3 -0
- package/dist/esm/node_modules/axios/lib/cancel/CanceledError.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/cancel/isCancel.js +3 -0
- package/dist/esm/node_modules/axios/lib/cancel/isCancel.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/core/Axios.js +3 -0
- package/dist/esm/node_modules/axios/lib/core/Axios.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/core/AxiosError.js +3 -0
- package/dist/esm/node_modules/axios/lib/core/AxiosError.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/core/AxiosHeaders.js +3 -0
- package/dist/esm/node_modules/axios/lib/core/AxiosHeaders.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/core/InterceptorManager.js +3 -0
- package/dist/esm/node_modules/axios/lib/core/InterceptorManager.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/core/buildFullPath.js +3 -0
- package/dist/esm/node_modules/axios/lib/core/buildFullPath.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/core/dispatchRequest.js +3 -0
- package/dist/esm/node_modules/axios/lib/core/dispatchRequest.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/core/mergeConfig.js +3 -0
- package/dist/esm/node_modules/axios/lib/core/mergeConfig.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/core/settle.js +3 -0
- package/dist/esm/node_modules/axios/lib/core/settle.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/core/transformData.js +3 -0
- package/dist/esm/node_modules/axios/lib/core/transformData.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/defaults/index.js +3 -0
- package/dist/esm/node_modules/axios/lib/defaults/index.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/defaults/transitional.js +3 -0
- package/dist/esm/node_modules/axios/lib/defaults/transitional.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/env/data.js +2 -0
- package/dist/esm/node_modules/axios/lib/env/data.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +3 -0
- package/dist/esm/node_modules/axios/lib/helpers/AxiosURLSearchParams.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/helpers/HttpStatusCode.js +2 -0
- package/dist/esm/node_modules/axios/lib/helpers/HttpStatusCode.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/helpers/bind.js +3 -0
- package/dist/esm/node_modules/axios/lib/helpers/bind.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/helpers/buildURL.js +3 -0
- package/dist/esm/node_modules/axios/lib/helpers/buildURL.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/helpers/combineURLs.js +3 -0
- package/dist/esm/node_modules/axios/lib/helpers/combineURLs.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/helpers/composeSignals.js +2 -0
- package/dist/esm/node_modules/axios/lib/helpers/composeSignals.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/helpers/cookies.js +2 -0
- package/dist/esm/node_modules/axios/lib/helpers/cookies.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/helpers/formDataToJSON.js +3 -0
- package/dist/esm/node_modules/axios/lib/helpers/formDataToJSON.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/helpers/isAbsoluteURL.js +3 -0
- package/dist/esm/node_modules/axios/lib/helpers/isAbsoluteURL.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/helpers/isAxiosError.js +3 -0
- package/dist/esm/node_modules/axios/lib/helpers/isAxiosError.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/helpers/isURLSameOrigin.js +2 -0
- package/dist/esm/node_modules/axios/lib/helpers/isURLSameOrigin.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/helpers/null.js +2 -0
- package/dist/esm/node_modules/axios/lib/helpers/null.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/helpers/parseHeaders.js +3 -0
- package/dist/esm/node_modules/axios/lib/helpers/parseHeaders.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/helpers/parseProtocol.js +3 -0
- package/dist/esm/node_modules/axios/lib/helpers/parseProtocol.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/helpers/progressEventReducer.js +2 -0
- package/dist/esm/node_modules/axios/lib/helpers/progressEventReducer.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/helpers/resolveConfig.js +2 -0
- package/dist/esm/node_modules/axios/lib/helpers/resolveConfig.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/helpers/speedometer.js +3 -0
- package/dist/esm/node_modules/axios/lib/helpers/speedometer.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/helpers/spread.js +3 -0
- package/dist/esm/node_modules/axios/lib/helpers/spread.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/helpers/throttle.js +2 -0
- package/dist/esm/node_modules/axios/lib/helpers/throttle.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/helpers/toFormData.js +3 -0
- package/dist/esm/node_modules/axios/lib/helpers/toFormData.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/helpers/toURLEncodedForm.js +3 -0
- package/dist/esm/node_modules/axios/lib/helpers/toURLEncodedForm.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/helpers/trackStream.js +2 -0
- package/dist/esm/node_modules/axios/lib/helpers/trackStream.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/helpers/validator.js +3 -0
- package/dist/esm/node_modules/axios/lib/helpers/validator.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/platform/browser/classes/Blob.js +3 -0
- package/dist/esm/node_modules/axios/lib/platform/browser/classes/Blob.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/platform/browser/classes/FormData.js +3 -0
- package/dist/esm/node_modules/axios/lib/platform/browser/classes/FormData.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +3 -0
- package/dist/esm/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/platform/browser/index.js +2 -0
- package/dist/esm/node_modules/axios/lib/platform/browser/index.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/platform/common/utils.js +2 -0
- package/dist/esm/node_modules/axios/lib/platform/common/utils.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/platform/index.js +2 -0
- package/dist/esm/node_modules/axios/lib/platform/index.js.map +1 -0
- package/dist/esm/node_modules/axios/lib/utils.js +3 -0
- package/dist/esm/node_modules/axios/lib/utils.js.map +1 -0
- package/dist/esm/node_modules/react-leaflet/lib/hooks.js +2 -0
- package/dist/esm/node_modules/react-leaflet/lib/hooks.js.map +1 -0
- package/dist/esm/node_modules/tangram/dist/tangram.min.js +2 -0
- package/dist/esm/node_modules/tangram/dist/tangram.min.js.map +1 -0
- package/dist/esm/scene.js +2 -0
- package/dist/esm/scene.js.map +1 -0
- package/dist/esm/services/api/api.service.js +2 -0
- package/dist/esm/services/api/api.service.js.map +1 -0
- package/dist/esm/types/components/index.d.ts +1 -0
- package/dist/esm/types/components/index.d.ts.map +1 -1
- package/dist/esm/types/components/layers/index.d.ts +2 -0
- package/dist/esm/types/components/layers/index.d.ts.map +1 -0
- package/dist/esm/types/components/layers/leaflet/hooks/index.d.ts +2 -0
- package/dist/esm/types/components/layers/leaflet/hooks/index.d.ts.map +1 -0
- package/dist/esm/types/components/layers/leaflet/hooks/useGetLeafletLayer.d.ts +4 -0
- package/dist/esm/types/components/layers/leaflet/hooks/useGetLeafletLayer.d.ts.map +1 -0
- package/dist/esm/types/components/layers/leaflet/index.d.ts +4 -0
- package/dist/esm/types/components/layers/leaflet/index.d.ts.map +1 -0
- package/dist/esm/types/components/layers/leaflet/leaflet.d.ts +4 -0
- package/dist/esm/types/components/layers/leaflet/leaflet.d.ts.map +1 -0
- package/dist/esm/types/components/layers/leaflet/leaflet.stories.d.ts +8 -0
- package/dist/esm/types/components/layers/leaflet/leaflet.stories.d.ts.map +1 -0
- package/dist/esm/types/components/layers/leaflet/types.d.ts +23 -0
- package/dist/esm/types/components/layers/leaflet/types.d.ts.map +1 -0
- package/dist/esm/types/configs/global/constants.d.ts +7 -0
- package/dist/esm/types/configs/global/constants.d.ts.map +1 -0
- package/dist/esm/types/configs/global/global.d.ts +2 -1
- package/dist/esm/types/configs/global/global.d.ts.map +1 -1
- package/dist/esm/types/configs/global/index.d.ts +1 -0
- package/dist/esm/types/configs/global/index.d.ts.map +1 -1
- package/dist/esm/types/services/api/api.service.d.ts +27 -0
- package/dist/esm/types/services/api/api.service.d.ts.map +1 -0
- package/dist/esm/types/services/api/index.d.ts +2 -0
- package/dist/esm/types/services/api/index.d.ts.map +1 -0
- package/dist/esm/types/services/index.d.ts +2 -0
- package/dist/esm/types/services/index.d.ts.map +1 -0
- package/package.json +8 -2
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var utils = require('../utils.js');
|
|
7
|
+
|
|
8
|
+
// RawAxiosHeaders whose duplicates are ignored by node
|
|
9
|
+
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
|
10
|
+
const ignoreDuplicateOf = utils["default"].toObjectSet([
|
|
11
|
+
'age', 'authorization', 'content-length', 'content-type', 'etag',
|
|
12
|
+
'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
|
|
13
|
+
'last-modified', 'location', 'max-forwards', 'proxy-authorization',
|
|
14
|
+
'referer', 'retry-after', 'user-agent'
|
|
15
|
+
]);
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Parse headers into an object
|
|
19
|
+
*
|
|
20
|
+
* ```
|
|
21
|
+
* Date: Wed, 27 Aug 2014 08:58:49 GMT
|
|
22
|
+
* Content-Type: application/json
|
|
23
|
+
* Connection: keep-alive
|
|
24
|
+
* Transfer-Encoding: chunked
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @param {String} rawHeaders Headers needing to be parsed
|
|
28
|
+
*
|
|
29
|
+
* @returns {Object} Headers parsed into an object
|
|
30
|
+
*/
|
|
31
|
+
var parseHeaders = rawHeaders => {
|
|
32
|
+
const parsed = {};
|
|
33
|
+
let key;
|
|
34
|
+
let val;
|
|
35
|
+
let i;
|
|
36
|
+
|
|
37
|
+
rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
|
|
38
|
+
i = line.indexOf(':');
|
|
39
|
+
key = line.substring(0, i).trim().toLowerCase();
|
|
40
|
+
val = line.substring(i + 1).trim();
|
|
41
|
+
|
|
42
|
+
if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (key === 'set-cookie') {
|
|
47
|
+
if (parsed[key]) {
|
|
48
|
+
parsed[key].push(val);
|
|
49
|
+
} else {
|
|
50
|
+
parsed[key] = [val];
|
|
51
|
+
}
|
|
52
|
+
} else {
|
|
53
|
+
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
return parsed;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
exports["default"] = parseHeaders;
|
|
61
|
+
//# sourceMappingURL=parseHeaders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseHeaders.js","sources":["../../../../../../node_modules/axios/lib/helpers/parseHeaders.js"],"sourcesContent":["'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n"],"names":[],"mappings":";;;;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
function parseProtocol(url) {
|
|
7
|
+
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
8
|
+
return match && match[1] || '';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
exports["default"] = parseProtocol;
|
|
12
|
+
//# sourceMappingURL=parseProtocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseProtocol.js","sources":["../../../../../../node_modules/axios/lib/helpers/parseProtocol.js"],"sourcesContent":["'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n"],"names":[],"mappings":";;;;;AAEe;AACf;AACA;AACA;;"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var speedometer = require('./speedometer.js');
|
|
6
|
+
var throttle = require('./throttle.js');
|
|
7
|
+
var utils = require('../utils.js');
|
|
8
|
+
|
|
9
|
+
const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
10
|
+
let bytesNotified = 0;
|
|
11
|
+
const _speedometer = speedometer["default"](50, 250);
|
|
12
|
+
|
|
13
|
+
return throttle["default"](e => {
|
|
14
|
+
const loaded = e.loaded;
|
|
15
|
+
const total = e.lengthComputable ? e.total : undefined;
|
|
16
|
+
const progressBytes = loaded - bytesNotified;
|
|
17
|
+
const rate = _speedometer(progressBytes);
|
|
18
|
+
const inRange = loaded <= total;
|
|
19
|
+
|
|
20
|
+
bytesNotified = loaded;
|
|
21
|
+
|
|
22
|
+
const data = {
|
|
23
|
+
loaded,
|
|
24
|
+
total,
|
|
25
|
+
progress: total ? (loaded / total) : undefined,
|
|
26
|
+
bytes: progressBytes,
|
|
27
|
+
rate: rate ? rate : undefined,
|
|
28
|
+
estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
|
|
29
|
+
event: e,
|
|
30
|
+
lengthComputable: total != null,
|
|
31
|
+
[isDownloadStream ? 'download' : 'upload']: true
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
listener(data);
|
|
35
|
+
}, freq);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const progressEventDecorator = (total, throttled) => {
|
|
39
|
+
const lengthComputable = total != null;
|
|
40
|
+
|
|
41
|
+
return [(loaded) => throttled[0]({
|
|
42
|
+
lengthComputable,
|
|
43
|
+
total,
|
|
44
|
+
loaded
|
|
45
|
+
}), throttled[1]];
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const asyncDecorator = (fn) => (...args) => utils["default"].asap(() => fn(...args));
|
|
49
|
+
|
|
50
|
+
exports.asyncDecorator = asyncDecorator;
|
|
51
|
+
exports.progressEventDecorator = progressEventDecorator;
|
|
52
|
+
exports.progressEventReducer = progressEventReducer;
|
|
53
|
+
//# sourceMappingURL=progressEventReducer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progressEventReducer.js","sources":["../../../../../../node_modules/axios/lib/helpers/progressEventReducer.js"],"sourcesContent":["import speedometer from \"./speedometer.js\";\nimport throttle from \"./throttle.js\";\nimport utils from \"../utils.js\";\n\nexport const progressEventReducer = (listener, isDownloadStream, freq = 3) => {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return throttle(e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e,\n lengthComputable: total != null,\n [isDownloadStream ? 'download' : 'upload']: true\n };\n\n listener(data);\n }, freq);\n}\n\nexport const progressEventDecorator = (total, throttled) => {\n const lengthComputable = total != null;\n\n return [(loaded) => throttled[0]({\n lengthComputable,\n total,\n loaded\n }), throttled[1]];\n}\n\nexport const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args));\n"],"names":["speedometer","throttle","utils"],"mappings":";;;;;;;;AAIY,MAAC,oBAAoB,GAAG,CAAC,QAAQ,EAAE,gBAAgB,EAAE,IAAI,GAAG,CAAC,KAAK;AAC9E,EAAE,IAAI,aAAa,GAAG,CAAC,CAAC;AACxB,EAAE,MAAM,YAAY,GAAGA,sBAAW,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;AAC5C;AACA,EAAE,OAAOC,mBAAQ,CAAC,CAAC,IAAI;AACvB,IAAI,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;AAC5B,IAAI,MAAM,KAAK,GAAG,CAAC,CAAC,gBAAgB,GAAG,CAAC,CAAC,KAAK,GAAG,SAAS,CAAC;AAC3D,IAAI,MAAM,aAAa,GAAG,MAAM,GAAG,aAAa,CAAC;AACjD,IAAI,MAAM,IAAI,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;AAC7C,IAAI,MAAM,OAAO,GAAG,MAAM,IAAI,KAAK,CAAC;AACpC;AACA,IAAI,aAAa,GAAG,MAAM,CAAC;AAC3B;AACA,IAAI,MAAM,IAAI,GAAG;AACjB,MAAM,MAAM;AACZ,MAAM,KAAK;AACX,MAAM,QAAQ,EAAE,KAAK,IAAI,MAAM,GAAG,KAAK,IAAI,SAAS;AACpD,MAAM,KAAK,EAAE,aAAa;AAC1B,MAAM,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS;AACnC,MAAM,SAAS,EAAE,IAAI,IAAI,KAAK,IAAI,OAAO,GAAG,CAAC,KAAK,GAAG,MAAM,IAAI,IAAI,GAAG,SAAS;AAC/E,MAAM,KAAK,EAAE,CAAC;AACd,MAAM,gBAAgB,EAAE,KAAK,IAAI,IAAI;AACrC,MAAM,CAAC,gBAAgB,GAAG,UAAU,GAAG,QAAQ,GAAG,IAAI;AACtD,KAAK,CAAC;AACN;AACA,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;AACnB,GAAG,EAAE,IAAI,CAAC,CAAC;AACX,EAAC;AACD;AACY,MAAC,sBAAsB,GAAG,CAAC,KAAK,EAAE,SAAS,KAAK;AAC5D,EAAE,MAAM,gBAAgB,GAAG,KAAK,IAAI,IAAI,CAAC;AACzC;AACA,EAAE,OAAO,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC;AACnC,IAAI,gBAAgB;AACpB,IAAI,KAAK;AACT,IAAI,MAAM;AACV,GAAG,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACpB,EAAC;AACD;AACY,MAAC,cAAc,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,IAAI,KAAKC,gBAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC;;;;;;"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var index = require('../platform/index.js');
|
|
6
|
+
var utils = require('../utils.js');
|
|
7
|
+
var isURLSameOrigin = require('./isURLSameOrigin.js');
|
|
8
|
+
var cookies = require('./cookies.js');
|
|
9
|
+
var buildFullPath = require('../core/buildFullPath.js');
|
|
10
|
+
var mergeConfig = require('../core/mergeConfig.js');
|
|
11
|
+
var AxiosHeaders = require('../core/AxiosHeaders.js');
|
|
12
|
+
var buildURL = require('./buildURL.js');
|
|
13
|
+
|
|
14
|
+
var resolveConfig = (config) => {
|
|
15
|
+
const newConfig = mergeConfig["default"]({}, config);
|
|
16
|
+
|
|
17
|
+
let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
|
|
18
|
+
|
|
19
|
+
newConfig.headers = headers = AxiosHeaders["default"].from(headers);
|
|
20
|
+
|
|
21
|
+
newConfig.url = buildURL["default"](buildFullPath["default"](newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
|
|
22
|
+
|
|
23
|
+
// HTTP basic authentication
|
|
24
|
+
if (auth) {
|
|
25
|
+
headers.set('Authorization', 'Basic ' +
|
|
26
|
+
btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (utils["default"].isFormData(data)) {
|
|
31
|
+
if (index["default"].hasStandardBrowserEnv || index["default"].hasStandardBrowserWebWorkerEnv) {
|
|
32
|
+
headers.setContentType(undefined); // browser handles it
|
|
33
|
+
} else if (utils["default"].isFunction(data.getHeaders)) {
|
|
34
|
+
// Node.js FormData (like form-data package)
|
|
35
|
+
const formHeaders = data.getHeaders();
|
|
36
|
+
// Only set safe headers to avoid overwriting security headers
|
|
37
|
+
const allowedHeaders = ['content-type', 'content-length'];
|
|
38
|
+
Object.entries(formHeaders).forEach(([key, val]) => {
|
|
39
|
+
if (allowedHeaders.includes(key.toLowerCase())) {
|
|
40
|
+
headers.set(key, val);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Add xsrf header
|
|
47
|
+
// This is only done if running in a standard browser environment.
|
|
48
|
+
// Specifically not if we're in a web worker, or react-native.
|
|
49
|
+
|
|
50
|
+
if (index["default"].hasStandardBrowserEnv) {
|
|
51
|
+
withXSRFToken && utils["default"].isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
|
|
52
|
+
|
|
53
|
+
if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin["default"](newConfig.url))) {
|
|
54
|
+
// Add xsrf header
|
|
55
|
+
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies["default"].read(xsrfCookieName);
|
|
56
|
+
|
|
57
|
+
if (xsrfValue) {
|
|
58
|
+
headers.set(xsrfHeaderName, xsrfValue);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return newConfig;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
exports["default"] = resolveConfig;
|
|
67
|
+
//# sourceMappingURL=resolveConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveConfig.js","sources":["../../../../../../node_modules/axios/lib/helpers/resolveConfig.js"],"sourcesContent":["import platform from \"../platform/index.js\";\nimport utils from \"../utils.js\";\nimport isURLSameOrigin from \"./isURLSameOrigin.js\";\nimport cookies from \"./cookies.js\";\nimport buildFullPath from \"../core/buildFullPath.js\";\nimport mergeConfig from \"../core/mergeConfig.js\";\nimport AxiosHeaders from \"../core/AxiosHeaders.js\";\nimport buildURL from \"./buildURL.js\";\n\nexport default (config) => {\n const newConfig = mergeConfig({}, config);\n\n let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;\n\n newConfig.headers = headers = AxiosHeaders.from(headers);\n\n newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);\n\n // HTTP basic authentication\n if (auth) {\n headers.set('Authorization', 'Basic ' +\n btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))\n );\n }\n\n if (utils.isFormData(data)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n headers.setContentType(undefined); // browser handles it\n } else if (utils.isFunction(data.getHeaders)) {\n // Node.js FormData (like form-data package)\n const formHeaders = data.getHeaders();\n // Only set safe headers to avoid overwriting security headers\n const allowedHeaders = ['content-type', 'content-length'];\n Object.entries(formHeaders).forEach(([key, val]) => {\n if (allowedHeaders.includes(key.toLowerCase())) {\n headers.set(key, val);\n }\n });\n }\n } \n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n if (platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {\n // Add xsrf header\n const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);\n\n if (xsrfValue) {\n headers.set(xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n return newConfig;\n}\n\n"],"names":["mergeConfig","AxiosHeaders","buildURL","buildFullPath","utils","platform","isURLSameOrigin","cookies"],"mappings":";;;;;;;;;;;;;AASA,oBAAe,CAAC,MAAM,KAAK;AAC3B,EAAE,MAAM,SAAS,GAAGA,sBAAW,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;AAC5C;AACA,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC;AACzF;AACA,EAAE,SAAS,CAAC,OAAO,GAAG,OAAO,GAAGC,uBAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC3D;AACA,EAAE,SAAS,CAAC,GAAG,GAAGC,mBAAQ,CAACC,wBAAa,CAAC,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,EAAE,SAAS,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,gBAAgB,CAAC,CAAC;AACjJ;AACA;AACA,EAAE,IAAI,IAAI,EAAE;AACZ,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,QAAQ;AACzC,MAAM,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;AAC5G,KAAK,CAAC;AACN,GAAG;AACH;AACA,EAAE,IAAIC,gBAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;AAC9B,IAAI,IAAIC,gBAAQ,CAAC,qBAAqB,IAAIA,gBAAQ,CAAC,8BAA8B,EAAE;AACnF,MAAM,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;AACxC,KAAK,MAAM,IAAID,gBAAK,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;AAClD;AACA,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;AAC5C;AACA,MAAM,MAAM,cAAc,GAAG,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;AAChE,MAAM,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK;AAC1D,QAAQ,IAAI,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,EAAE;AACxD,UAAU,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAChC,SAAS;AACT,OAAO,CAAC,CAAC;AACT,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,EAAE,IAAIC,gBAAQ,CAAC,qBAAqB,EAAE;AACtC,IAAI,aAAa,IAAID,gBAAK,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,aAAa,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC;AACnG;AACA,IAAI,IAAI,aAAa,KAAK,aAAa,KAAK,KAAK,IAAIE,0BAAe,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE;AACtF;AACA,MAAM,MAAM,SAAS,GAAG,cAAc,IAAI,cAAc,IAAIC,kBAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AACzF;AACA,MAAM,IAAI,SAAS,EAAE;AACrB,QAAQ,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;AAC/C,OAAO;AACP,KAAK;AACL,GAAG;AACH;AACA,EAAE,OAAO,SAAS,CAAC;AACnB;;;;"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Calculate data maxRate
|
|
8
|
+
* @param {Number} [samplesCount= 10]
|
|
9
|
+
* @param {Number} [min= 1000]
|
|
10
|
+
* @returns {Function}
|
|
11
|
+
*/
|
|
12
|
+
function speedometer(samplesCount, min) {
|
|
13
|
+
samplesCount = samplesCount || 10;
|
|
14
|
+
const bytes = new Array(samplesCount);
|
|
15
|
+
const timestamps = new Array(samplesCount);
|
|
16
|
+
let head = 0;
|
|
17
|
+
let tail = 0;
|
|
18
|
+
let firstSampleTS;
|
|
19
|
+
|
|
20
|
+
min = min !== undefined ? min : 1000;
|
|
21
|
+
|
|
22
|
+
return function push(chunkLength) {
|
|
23
|
+
const now = Date.now();
|
|
24
|
+
|
|
25
|
+
const startedAt = timestamps[tail];
|
|
26
|
+
|
|
27
|
+
if (!firstSampleTS) {
|
|
28
|
+
firstSampleTS = now;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
bytes[head] = chunkLength;
|
|
32
|
+
timestamps[head] = now;
|
|
33
|
+
|
|
34
|
+
let i = tail;
|
|
35
|
+
let bytesCount = 0;
|
|
36
|
+
|
|
37
|
+
while (i !== head) {
|
|
38
|
+
bytesCount += bytes[i++];
|
|
39
|
+
i = i % samplesCount;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
head = (head + 1) % samplesCount;
|
|
43
|
+
|
|
44
|
+
if (head === tail) {
|
|
45
|
+
tail = (tail + 1) % samplesCount;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (now - firstSampleTS < min) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const passed = startedAt && now - startedAt;
|
|
53
|
+
|
|
54
|
+
return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
exports["default"] = speedometer;
|
|
59
|
+
//# sourceMappingURL=speedometer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"speedometer.js","sources":["../../../../../../node_modules/axios/lib/helpers/speedometer.js"],"sourcesContent":["'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n"],"names":[],"mappings":";;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Syntactic sugar for invoking a function and expanding an array for arguments.
|
|
8
|
+
*
|
|
9
|
+
* Common use case would be to use `Function.prototype.apply`.
|
|
10
|
+
*
|
|
11
|
+
* ```js
|
|
12
|
+
* function f(x, y, z) {}
|
|
13
|
+
* var args = [1, 2, 3];
|
|
14
|
+
* f.apply(null, args);
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* With `spread` this example can be re-written.
|
|
18
|
+
*
|
|
19
|
+
* ```js
|
|
20
|
+
* spread(function(x, y, z) {})([1, 2, 3]);
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @param {Function} callback
|
|
24
|
+
*
|
|
25
|
+
* @returns {Function}
|
|
26
|
+
*/
|
|
27
|
+
function spread(callback) {
|
|
28
|
+
return function wrap(arr) {
|
|
29
|
+
return callback.apply(null, arr);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
exports["default"] = spread;
|
|
34
|
+
//# sourceMappingURL=spread.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spread.js","sources":["../../../../../../node_modules/axios/lib/helpers/spread.js"],"sourcesContent":["'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n"],"names":[],"mappings":";;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe;AACf;AACA;AACA;AACA;;"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Throttle decorator
|
|
7
|
+
* @param {Function} fn
|
|
8
|
+
* @param {Number} freq
|
|
9
|
+
* @return {Function}
|
|
10
|
+
*/
|
|
11
|
+
function throttle(fn, freq) {
|
|
12
|
+
let timestamp = 0;
|
|
13
|
+
let threshold = 1000 / freq;
|
|
14
|
+
let lastArgs;
|
|
15
|
+
let timer;
|
|
16
|
+
|
|
17
|
+
const invoke = (args, now = Date.now()) => {
|
|
18
|
+
timestamp = now;
|
|
19
|
+
lastArgs = null;
|
|
20
|
+
if (timer) {
|
|
21
|
+
clearTimeout(timer);
|
|
22
|
+
timer = null;
|
|
23
|
+
}
|
|
24
|
+
fn(...args);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const throttled = (...args) => {
|
|
28
|
+
const now = Date.now();
|
|
29
|
+
const passed = now - timestamp;
|
|
30
|
+
if ( passed >= threshold) {
|
|
31
|
+
invoke(args, now);
|
|
32
|
+
} else {
|
|
33
|
+
lastArgs = args;
|
|
34
|
+
if (!timer) {
|
|
35
|
+
timer = setTimeout(() => {
|
|
36
|
+
timer = null;
|
|
37
|
+
invoke(lastArgs);
|
|
38
|
+
}, threshold - passed);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const flush = () => lastArgs && invoke(lastArgs);
|
|
44
|
+
|
|
45
|
+
return [throttled, flush];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
exports["default"] = throttle;
|
|
49
|
+
//# sourceMappingURL=throttle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throttle.js","sources":["../../../../../../node_modules/axios/lib/helpers/throttle.js"],"sourcesContent":["/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Function}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n let threshold = 1000 / freq;\n let lastArgs;\n let timer;\n\n const invoke = (args, now = Date.now()) => {\n timestamp = now;\n lastArgs = null;\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n fn(...args);\n }\n\n const throttled = (...args) => {\n const now = Date.now();\n const passed = now - timestamp;\n if ( passed >= threshold) {\n invoke(args, now);\n } else {\n lastArgs = args;\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n invoke(lastArgs)\n }, threshold - passed);\n }\n }\n }\n\n const flush = () => lastArgs && invoke(lastArgs);\n\n return [throttled, flush];\n}\n\nexport default throttle;\n"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE;AAC5B,EAAE,IAAI,SAAS,GAAG,CAAC,CAAC;AACpB,EAAE,IAAI,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC;AAC9B,EAAE,IAAI,QAAQ,CAAC;AACf,EAAE,IAAI,KAAK,CAAC;AACZ;AACA,EAAE,MAAM,MAAM,GAAG,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,KAAK;AAC7C,IAAI,SAAS,GAAG,GAAG,CAAC;AACpB,IAAI,QAAQ,GAAG,IAAI,CAAC;AACpB,IAAI,IAAI,KAAK,EAAE;AACf,MAAM,YAAY,CAAC,KAAK,CAAC,CAAC;AAC1B,MAAM,KAAK,GAAG,IAAI,CAAC;AACnB,KAAK;AACL,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;AAChB,IAAG;AACH;AACA,EAAE,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,KAAK;AACjC,IAAI,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AAC3B,IAAI,MAAM,MAAM,GAAG,GAAG,GAAG,SAAS,CAAC;AACnC,IAAI,KAAK,MAAM,IAAI,SAAS,EAAE;AAC9B,MAAM,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AACxB,KAAK,MAAM;AACX,MAAM,QAAQ,GAAG,IAAI,CAAC;AACtB,MAAM,IAAI,CAAC,KAAK,EAAE;AAClB,QAAQ,KAAK,GAAG,UAAU,CAAC,MAAM;AACjC,UAAU,KAAK,GAAG,IAAI,CAAC;AACvB,UAAU,MAAM,CAAC,QAAQ,EAAC;AAC1B,SAAS,EAAE,SAAS,GAAG,MAAM,CAAC,CAAC;AAC/B,OAAO;AACP,KAAK;AACL,IAAG;AACH;AACA,EAAE,MAAM,KAAK,GAAG,MAAM,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC;AACnD;AACA,EAAE,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;AAC5B;;;;"}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var utils = require('../utils.js');
|
|
7
|
+
var AxiosError = require('../core/AxiosError.js');
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Determines if the given thing is a array or js object.
|
|
11
|
+
*
|
|
12
|
+
* @param {string} thing - The object or array to be visited.
|
|
13
|
+
*
|
|
14
|
+
* @returns {boolean}
|
|
15
|
+
*/
|
|
16
|
+
function isVisitable(thing) {
|
|
17
|
+
return utils["default"].isPlainObject(thing) || utils["default"].isArray(thing);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* It removes the brackets from the end of a string
|
|
22
|
+
*
|
|
23
|
+
* @param {string} key - The key of the parameter.
|
|
24
|
+
*
|
|
25
|
+
* @returns {string} the key without the brackets.
|
|
26
|
+
*/
|
|
27
|
+
function removeBrackets(key) {
|
|
28
|
+
return utils["default"].endsWith(key, '[]') ? key.slice(0, -2) : key;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* It takes a path, a key, and a boolean, and returns a string
|
|
33
|
+
*
|
|
34
|
+
* @param {string} path - The path to the current key.
|
|
35
|
+
* @param {string} key - The key of the current object being iterated over.
|
|
36
|
+
* @param {string} dots - If true, the key will be rendered with dots instead of brackets.
|
|
37
|
+
*
|
|
38
|
+
* @returns {string} The path to the current key.
|
|
39
|
+
*/
|
|
40
|
+
function renderKey(path, key, dots) {
|
|
41
|
+
if (!path) return key;
|
|
42
|
+
return path.concat(key).map(function each(token, i) {
|
|
43
|
+
// eslint-disable-next-line no-param-reassign
|
|
44
|
+
token = removeBrackets(token);
|
|
45
|
+
return !dots && i ? '[' + token + ']' : token;
|
|
46
|
+
}).join(dots ? '.' : '');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* If the array is an array and none of its elements are visitable, then it's a flat array.
|
|
51
|
+
*
|
|
52
|
+
* @param {Array<any>} arr - The array to check
|
|
53
|
+
*
|
|
54
|
+
* @returns {boolean}
|
|
55
|
+
*/
|
|
56
|
+
function isFlatArray(arr) {
|
|
57
|
+
return utils["default"].isArray(arr) && !arr.some(isVisitable);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const predicates = utils["default"].toFlatObject(utils["default"], {}, null, function filter(prop) {
|
|
61
|
+
return /^is[A-Z]/.test(prop);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Convert a data object to FormData
|
|
66
|
+
*
|
|
67
|
+
* @param {Object} obj
|
|
68
|
+
* @param {?Object} [formData]
|
|
69
|
+
* @param {?Object} [options]
|
|
70
|
+
* @param {Function} [options.visitor]
|
|
71
|
+
* @param {Boolean} [options.metaTokens = true]
|
|
72
|
+
* @param {Boolean} [options.dots = false]
|
|
73
|
+
* @param {?Boolean} [options.indexes = false]
|
|
74
|
+
*
|
|
75
|
+
* @returns {Object}
|
|
76
|
+
**/
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* It converts an object into a FormData object
|
|
80
|
+
*
|
|
81
|
+
* @param {Object<any, any>} obj - The object to convert to form data.
|
|
82
|
+
* @param {string} formData - The FormData object to append to.
|
|
83
|
+
* @param {Object<string, any>} options
|
|
84
|
+
*
|
|
85
|
+
* @returns
|
|
86
|
+
*/
|
|
87
|
+
function toFormData(obj, formData, options) {
|
|
88
|
+
if (!utils["default"].isObject(obj)) {
|
|
89
|
+
throw new TypeError('target must be an object');
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// eslint-disable-next-line no-param-reassign
|
|
93
|
+
formData = formData || new (FormData)();
|
|
94
|
+
|
|
95
|
+
// eslint-disable-next-line no-param-reassign
|
|
96
|
+
options = utils["default"].toFlatObject(options, {
|
|
97
|
+
metaTokens: true,
|
|
98
|
+
dots: false,
|
|
99
|
+
indexes: false
|
|
100
|
+
}, false, function defined(option, source) {
|
|
101
|
+
// eslint-disable-next-line no-eq-null,eqeqeq
|
|
102
|
+
return !utils["default"].isUndefined(source[option]);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
const metaTokens = options.metaTokens;
|
|
106
|
+
// eslint-disable-next-line no-use-before-define
|
|
107
|
+
const visitor = options.visitor || defaultVisitor;
|
|
108
|
+
const dots = options.dots;
|
|
109
|
+
const indexes = options.indexes;
|
|
110
|
+
const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
|
|
111
|
+
const useBlob = _Blob && utils["default"].isSpecCompliantForm(formData);
|
|
112
|
+
|
|
113
|
+
if (!utils["default"].isFunction(visitor)) {
|
|
114
|
+
throw new TypeError('visitor must be a function');
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function convertValue(value) {
|
|
118
|
+
if (value === null) return '';
|
|
119
|
+
|
|
120
|
+
if (utils["default"].isDate(value)) {
|
|
121
|
+
return value.toISOString();
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (utils["default"].isBoolean(value)) {
|
|
125
|
+
return value.toString();
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (!useBlob && utils["default"].isBlob(value)) {
|
|
129
|
+
throw new AxiosError["default"]('Blob is not supported. Use a Buffer instead.');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (utils["default"].isArrayBuffer(value) || utils["default"].isTypedArray(value)) {
|
|
133
|
+
return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return value;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Default visitor.
|
|
141
|
+
*
|
|
142
|
+
* @param {*} value
|
|
143
|
+
* @param {String|Number} key
|
|
144
|
+
* @param {Array<String|Number>} path
|
|
145
|
+
* @this {FormData}
|
|
146
|
+
*
|
|
147
|
+
* @returns {boolean} return true to visit the each prop of the value recursively
|
|
148
|
+
*/
|
|
149
|
+
function defaultVisitor(value, key, path) {
|
|
150
|
+
let arr = value;
|
|
151
|
+
|
|
152
|
+
if (value && !path && typeof value === 'object') {
|
|
153
|
+
if (utils["default"].endsWith(key, '{}')) {
|
|
154
|
+
// eslint-disable-next-line no-param-reassign
|
|
155
|
+
key = metaTokens ? key : key.slice(0, -2);
|
|
156
|
+
// eslint-disable-next-line no-param-reassign
|
|
157
|
+
value = JSON.stringify(value);
|
|
158
|
+
} else if (
|
|
159
|
+
(utils["default"].isArray(value) && isFlatArray(value)) ||
|
|
160
|
+
((utils["default"].isFileList(value) || utils["default"].endsWith(key, '[]')) && (arr = utils["default"].toArray(value))
|
|
161
|
+
)) {
|
|
162
|
+
// eslint-disable-next-line no-param-reassign
|
|
163
|
+
key = removeBrackets(key);
|
|
164
|
+
|
|
165
|
+
arr.forEach(function each(el, index) {
|
|
166
|
+
!(utils["default"].isUndefined(el) || el === null) && formData.append(
|
|
167
|
+
// eslint-disable-next-line no-nested-ternary
|
|
168
|
+
indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
|
|
169
|
+
convertValue(el)
|
|
170
|
+
);
|
|
171
|
+
});
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (isVisitable(value)) {
|
|
177
|
+
return true;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
181
|
+
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const stack = [];
|
|
186
|
+
|
|
187
|
+
const exposedHelpers = Object.assign(predicates, {
|
|
188
|
+
defaultVisitor,
|
|
189
|
+
convertValue,
|
|
190
|
+
isVisitable
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
function build(value, path) {
|
|
194
|
+
if (utils["default"].isUndefined(value)) return;
|
|
195
|
+
|
|
196
|
+
if (stack.indexOf(value) !== -1) {
|
|
197
|
+
throw Error('Circular reference detected in ' + path.join('.'));
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
stack.push(value);
|
|
201
|
+
|
|
202
|
+
utils["default"].forEach(value, function each(el, key) {
|
|
203
|
+
const result = !(utils["default"].isUndefined(el) || el === null) && visitor.call(
|
|
204
|
+
formData, el, utils["default"].isString(key) ? key.trim() : key, path, exposedHelpers
|
|
205
|
+
);
|
|
206
|
+
|
|
207
|
+
if (result === true) {
|
|
208
|
+
build(el, path ? path.concat(key) : [key]);
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
stack.pop();
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
if (!utils["default"].isObject(obj)) {
|
|
216
|
+
throw new TypeError('data must be an object');
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
build(obj);
|
|
220
|
+
|
|
221
|
+
return formData;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
exports["default"] = toFormData;
|
|
225
|
+
//# sourceMappingURL=toFormData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toFormData.js","sources":["../../../../../../node_modules/axios/lib/helpers/toFormData.js"],"sourcesContent":["'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array<any>} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object<any, any>} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object<string, any>} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (utils.isBoolean(value)) {\n return value.toString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array<String|Number>} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n"],"names":[],"mappings":";;;;;;;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var utils = require('../utils.js');
|
|
7
|
+
var toFormData = require('./toFormData.js');
|
|
8
|
+
var index = require('../platform/index.js');
|
|
9
|
+
|
|
10
|
+
function toURLEncodedForm(data, options) {
|
|
11
|
+
return toFormData["default"](data, new index["default"].classes.URLSearchParams(), {
|
|
12
|
+
visitor: function(value, key, path, helpers) {
|
|
13
|
+
if (index["default"].isNode && utils["default"].isBuffer(value)) {
|
|
14
|
+
this.append(key, value.toString('base64'));
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return helpers.defaultVisitor.apply(this, arguments);
|
|
19
|
+
},
|
|
20
|
+
...options
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
exports["default"] = toURLEncodedForm;
|
|
25
|
+
//# sourceMappingURL=toURLEncodedForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toURLEncodedForm.js","sources":["../../../../../../node_modules/axios/lib/helpers/toURLEncodedForm.js"],"sourcesContent":["'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), {\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n },\n ...options\n });\n}\n"],"names":[],"mappings":";;;;;;;;;AAMe;AACf;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;"}
|