update node_modules

This commit is contained in:
bitkarrot
2022-03-20 23:27:54 -07:00
parent 563f63db2c
commit 860225cc69
107 changed files with 540 additions and 6815 deletions

114
node_modules/axios/CHANGELOG.md generated vendored
View File

@@ -1,5 +1,119 @@
# Changelog
### 0.26.1 (March 9, 2022)
Fixes and Functionality:
- Refactored project file structure to avoid circular imports ([##4220](https://github.com/axios/axios/pull/#4220))
### 0.26.0 (February 13, 2022)
Fixes and Functionality:
- Fixed The timeoutErrorMessage property in config not work with Node.js ([#3581](https://github.com/axios/axios/pull/3581))
- Added errors to be displayed when the query parsing process itself fails ([#3961](https://github.com/axios/axios/pull/3961))
- Fix/remove url required ([#4426](https://github.com/axios/axios/pull/4426))
- Update follow-redirects dependency due to Vurnerbility ([#4462](https://github.com/axios/axios/pull/4462))
- Bump karma from 6.3.11 to 6.3.14 ([#4461](https://github.com/axios/axios/pull/4461))
- Bump follow-redirects from 1.14.7 to 1.14.8 ([#4473](https://github.com/axios/axios/pull/4473))
### 0.25.0 (January 18, 2022)
Breaking changes:
- Fixing maxBodyLength enforcement ([#3786](https://github.com/axios/axios/pull/3786))
- Don't rely on strict mode behaviour for arguments ([#3470](https://github.com/axios/axios/pull/3470))
- Adding error handling when missing url ([#3791](https://github.com/axios/axios/pull/3791))
- Update isAbsoluteURL.js removing escaping of non-special characters ([#3809](https://github.com/axios/axios/pull/3809))
- Use native Array.isArray() in utils.js ([#3836](https://github.com/axios/axios/pull/3836))
- Adding error handling inside stream end callback ([#3967](https://github.com/axios/axios/pull/3967))
Fixes and Functionality:
- Added aborted even handler ([#3916](https://github.com/axios/axios/pull/3916))
- Header types expanded allowing `boolean` and `number` types ([#4144](https://github.com/axios/axios/pull/4144))
- Fix cancel signature allowing cancel message to be `undefined` ([#3153](https://github.com/axios/axios/pull/3153))
- Updated type checks to be formulated better ([#3342](https://github.com/axios/axios/pull/3342))
- Avoid unnecessary buffer allocations ([#3321](https://github.com/axios/axios/pull/3321))
- Adding a socket handler to keep TCP connection live when processing long living requests ([#3422](https://github.com/axios/axios/pull/3422))
- Added toFormData helper function ([#3757](https://github.com/axios/axios/pull/3757))
- Adding responseEncoding prop type in AxiosRequestConfig ([#3918](https://github.com/axios/axios/pull/3918))
Internal and Tests:
- Adding axios-test-instance to ecosystem ([#3786](https://github.com/axios/axios/pull/3786))
- Optimize the logic of isAxiosError ([#3546](https://github.com/axios/axios/pull/3546))
- Add tests and documentation to display how multiple inceptors work ([#3564](https://github.com/axios/axios/pull/3564))
- Updating follow-redirects to version 1.14.7 ([#4379](https://github.com/axios/axios/pull/4379))
Documentation:
- Fixing changelog to show corrext pull request ([#4219](https://github.com/axios/axios/pull/4219))
- Update upgrade guide for https proxy setting ([#3604](https://github.com/axios/axios/pull/3604))
Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub:
- [Jay](mailto:jasonsaayman@gmail.com)
- [Rijk van Zanten](https://github.com/rijkvanzanten)
- [Kohta Ito](https://github.com/koh110)
- [Brandon Faulkner](https://github.com/bfaulk96)
- [Stefano Magni](https://github.com/NoriSte)
- [enofan](https://github.com/fanguangyi)
- [Andrey Pechkurov](https://github.com/puzpuzpuz)
- [Doowonee](https://github.com/doowonee)
- [Emil Broman](https://github.com/emilbroman-eqt)
- [Remco Haszing](https://github.com/remcohaszing)
- [Black-Hole](https://github.com/BlackHole1)
- [Wolfram Kriesing](https://github.com/wolframkriesing)
- [Andrew Ovens](https://github.com/repl-andrew-ovens)
- [Paulo Renato](https://github.com/PauloRSF)
- [Ben Carp](https://github.com/carpben)
- [Hirotaka Tagawa](https://github.com/wafuwafu13)
- [狼族小狈](https://github.com/lzxb)
- [C. Lewis](https://github.com/ctjlewis)
- [Felipe Carvalho](https://github.com/FCarvalhoVII)
- [Daniel](https://github.com/djs113)
- [Gustavo Sales](https://github.com/gussalesdev)
### 0.24.0 (October 25, 2021)
Breaking changes:
- Revert: change type of AxiosResponse to any, please read lengthy discussion here: ([#4141](https://github.com/axios/axios/issues/4141)) pull request: ([#4186](https://github.com/axios/axios/pull/4186))
Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub:
- [Jay](mailto:jasonsaayman@gmail.com)
- [Rodry](https://github.com/ImRodry)
- [Remco Haszing](https://github.com/remcohaszing)
- [Isaiah Thomason](https://github.com/ITenthusiasm)
### 0.23.0 (October 12, 2021)
Breaking changes:
- Distinguish request and response data types ([#4116](https://github.com/axios/axios/pull/4116))
- Change never type to unknown ([#4142](https://github.com/axios/axios/pull/4142))
- Fixed TransitionalOptions typings ([#4147](https://github.com/axios/axios/pull/4147))
Fixes and Functionality:
- Adding globalObject: 'this' to webpack config ([#3176](https://github.com/axios/axios/pull/3176))
- Adding insecureHTTPParser type to AxiosRequestConfig ([#4066](https://github.com/axios/axios/pull/4066))
- Fix missing semicolon in typings ([#4115](https://github.com/axios/axios/pull/4115))
- Fix response headers types ([#4136](https://github.com/axios/axios/pull/4136))
Internal and Tests:
- Improve timeout error when timeout is browser default ([#3209](https://github.com/axios/axios/pull/3209))
- Fix node version on CI ([#4069](https://github.com/axios/axios/pull/4069))
- Added testing to TypeScript portion of project ([#4140](https://github.com/axios/axios/pull/4140))
Documentation:
- Rename Angular to AngularJS ([#4114](https://github.com/axios/axios/pull/4114))
Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub:
- [Jay](mailto:jasonsaayman@gmail.com)
- [Evan-Finkelstein](https://github.com/Evan-Finkelstein)
- [Paweł Szymański](https://github.com/Jezorko)
- [Dobes Vandermeer](https://github.com/dobesv)
- [Claas Augner](https://github.com/caugner)
- [Remco Haszing](https://github.com/remcohaszing)
- [Evgeniy](https://github.com/egmen)
- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS)
### 0.22.0 (October 01, 2021)
Fixes and Functionality:

19
node_modules/axios/README.md generated vendored
View File

@@ -9,6 +9,7 @@
[![npm downloads](https://img.shields.io/npm/dm/axios.svg?style=flat-square)](http://npm-stat.com/charts.html?package=axios)
[![gitter chat](https://img.shields.io/gitter/room/mzabriskie/axios.svg?style=flat-square)](https://gitter.im/mzabriskie/axios)
[![code helpers](https://www.codetriage.com/axios/axios/badges/users.svg)](https://www.codetriage.com/axios/axios)
[![Known Vulnerabilities](https://snyk.io/test/npm/axios/badge.svg)](https://snyk.io/test/npm/axios)
Promise based HTTP client for the browser and node.js
@@ -32,6 +33,7 @@ Promise based HTTP client for the browser and node.js
- [Custom instance defaults](#custom-instance-defaults)
- [Config order of precedence](#config-order-of-precedence)
- [Interceptors](#interceptors)
- [Multiple Interceptors](#multiple-interceptors)
- [Handling Errors](#handling-errors)
- [Cancellation](#cancellation)
- [Using application/x-www-form-urlencoded format](#using-applicationx-www-form-urlencoded-format)
@@ -645,6 +647,21 @@ axios.interceptors.request.use(function (config) {
}, null, { runWhen: onGetCall });
```
### Multiple Interceptors
Given you add multiple response interceptors
and when the response was fulfilled
- then each interceptor is executed
- then they are executed in the order they were added
- then only the last interceptor's result is returned
- then every interceptor receives the result of it's predecessor
- and when the fulfillment-interceptor throws
- then the following fulfillment-interceptor is not called
- then the following rejection-interceptor is called
- once caught, another following fulfill-interceptor is called again (just like in a promise chain).
Read [the interceptor tests](./test/specs/interceptors.spec.js) for seeing all this in code.
## Handling Errors
```js
@@ -885,7 +902,7 @@ You can use Gitpod an online IDE(which is free for Open Source) for contributing
## Credits
axios is heavily inspired by the [$http service](https://docs.angularjs.org/api/ng/service/$http) provided in [Angular](https://angularjs.org/). Ultimately axios is an effort to provide a standalone `$http`-like service for use outside of Angular.
axios is heavily inspired by the [$http service](https://docs.angularjs.org/api/ng/service/$http) provided in [AngularJS](https://angularjs.org/). Ultimately axios is an effort to provide a standalone `$http`-like service for use outside of AngularJS.
## License

View File

@@ -1,5 +1,11 @@
# Upgrade Guide
### 0.18.x -> 0.19.0
#### HTTPS Proxies
Routing through an https proxy now requires setting the `protocol` attribute of the proxy configuration to `https`
### 0.15.x -> 0.16.0
#### `Promise` Type Declarations

114
node_modules/axios/index.d.ts generated vendored
View File

@@ -1,9 +1,21 @@
export interface AxiosTransformer {
(data: any, headers?: Record<string, string>): any;
// TypeScript Version: 3.0
export type AxiosRequestHeaders = Record<string, string | number | boolean>;
export type AxiosResponseHeaders = Record<string, string> & {
"set-cookie"?: string[]
};
export interface AxiosRequestTransformer {
(data: any, headers?: AxiosRequestHeaders): any;
}
export interface AxiosResponseTransformer {
(data: any, headers?: AxiosResponseHeaders): any;
}
export interface AxiosAdapter {
(config: AxiosRequestConfig): AxiosPromise<any>;
(config: AxiosRequestConfig): AxiosPromise;
}
export interface AxiosBasicCredentials {
@@ -16,7 +28,7 @@ export interface AxiosProxyConfig {
port: number;
auth?: {
username: string;
password:string;
password: string;
};
protocol?: string;
}
@@ -31,7 +43,7 @@ export type Method =
| 'patch' | 'PATCH'
| 'purge' | 'PURGE'
| 'link' | 'LINK'
| 'unlink' | 'UNLINK'
| 'unlink' | 'UNLINK';
export type ResponseType =
| 'arraybuffer'
@@ -39,30 +51,45 @@ export type ResponseType =
| 'document'
| 'json'
| 'text'
| 'stream'
| 'stream';
export interface TransitionalOptions{
silentJSONParsing: boolean;
forcedJSONParsing: boolean;
clarifyTimeoutError: boolean;
export type responseEncoding =
| 'ascii' | 'ASCII'
| 'ansi' | 'ANSI'
| 'binary' | 'BINARY'
| 'base64' | 'BASE64'
| 'base64url' | 'BASE64URL'
| 'hex' | 'HEX'
| 'latin1' | 'LATIN1'
| 'ucs-2' | 'UCS-2'
| 'ucs2' | 'UCS2'
| 'utf-8' | 'UTF-8'
| 'utf8' | 'UTF8'
| 'utf16le' | 'UTF16LE';
export interface TransitionalOptions {
silentJSONParsing?: boolean;
forcedJSONParsing?: boolean;
clarifyTimeoutError?: boolean;
}
export interface AxiosRequestConfig<T = any> {
export interface AxiosRequestConfig<D = any> {
url?: string;
method?: Method;
baseURL?: string;
transformRequest?: AxiosTransformer | AxiosTransformer[];
transformResponse?: AxiosTransformer | AxiosTransformer[];
headers?: Record<string, string>;
transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[];
transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[];
headers?: AxiosRequestHeaders;
params?: any;
paramsSerializer?: (params: any) => string;
data?: T;
data?: D;
timeout?: number;
timeoutErrorMessage?: string;
withCredentials?: boolean;
adapter?: AxiosAdapter;
auth?: AxiosBasicCredentials;
responseType?: ResponseType;
responseEncoding?: responseEncoding | string;
xsrfCookieName?: string;
xsrfHeaderName?: string;
onUploadProgress?: (progressEvent: any) => void;
@@ -77,29 +104,48 @@ export interface AxiosRequestConfig<T = any> {
proxy?: AxiosProxyConfig | false;
cancelToken?: CancelToken;
decompress?: boolean;
transitional?: TransitionalOptions
transitional?: TransitionalOptions;
signal?: AbortSignal;
insecureHTTPParser?: boolean;
}
export interface AxiosResponse<T = never> {
export interface HeadersDefaults {
common: AxiosRequestHeaders;
delete: AxiosRequestHeaders;
get: AxiosRequestHeaders;
head: AxiosRequestHeaders;
post: AxiosRequestHeaders;
put: AxiosRequestHeaders;
patch: AxiosRequestHeaders;
options?: AxiosRequestHeaders;
purge?: AxiosRequestHeaders;
link?: AxiosRequestHeaders;
unlink?: AxiosRequestHeaders;
}
export interface AxiosDefaults<D = any> extends Omit<AxiosRequestConfig<D>, 'headers'> {
headers: HeadersDefaults;
}
export interface AxiosResponse<T = any, D = any> {
data: T;
status: number;
statusText: string;
headers: Record<string, string>;
config: AxiosRequestConfig<T>;
headers: AxiosResponseHeaders;
config: AxiosRequestConfig<D>;
request?: any;
}
export interface AxiosError<T = never> extends Error {
config: AxiosRequestConfig;
export interface AxiosError<T = any, D = any> extends Error {
config: AxiosRequestConfig<D>;
code?: string;
request?: any;
response?: AxiosResponse<T>;
response?: AxiosResponse<T, D>;
isAxiosError: boolean;
toJSON: () => object;
}
export interface AxiosPromise<T = never> extends Promise<AxiosResponse<T>> {
export interface AxiosPromise<T = any> extends Promise<AxiosResponse<T>> {
}
export interface CancelStatic {
@@ -107,7 +153,7 @@ export interface CancelStatic {
}
export interface Cancel {
message: string;
message: string | undefined;
}
export interface Canceler {
@@ -137,20 +183,20 @@ export interface AxiosInterceptorManager<V> {
export class Axios {
constructor(config?: AxiosRequestConfig);
defaults: AxiosRequestConfig;
defaults: AxiosDefaults;
interceptors: {
request: AxiosInterceptorManager<AxiosRequestConfig>;
response: AxiosInterceptorManager<AxiosResponse>;
};
getUri(config?: AxiosRequestConfig): string;
request<T = never, R = AxiosResponse<T>> (config: AxiosRequestConfig<T>): Promise<R>;
get<T = never, R = AxiosResponse<T>>(url: string, config?: AxiosRequestConfig<T>): Promise<R>;
delete<T = never, R = AxiosResponse<T>>(url: string, config?: AxiosRequestConfig<T>): Promise<R>;
head<T = never, R = AxiosResponse<T>>(url: string, config?: AxiosRequestConfig<T>): Promise<R>;
options<T = never, R = AxiosResponse<T>>(url: string, config?: AxiosRequestConfig<T>): Promise<R>;
post<T = never, R = AxiosResponse<T>>(url: string, data?: T, config?: AxiosRequestConfig<T>): Promise<R>;
put<T = never, R = AxiosResponse<T>>(url: string, data?: T, config?: AxiosRequestConfig<T>): Promise<R>;
patch<T = never, R = AxiosResponse<T>>(url: string, data?: T, config?: AxiosRequestConfig<T>): Promise<R>;
request<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
get<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
delete<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
head<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
options<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
post<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
put<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
patch<T = any, R = AxiosResponse<T>, D = any>(url: string, data?: D, config?: AxiosRequestConfig<D>): Promise<R>;
}
export interface AxiosInstance extends Axios {
@@ -165,7 +211,7 @@ export interface AxiosStatic extends AxiosInstance {
Axios: typeof Axios;
readonly VERSION: string;
isCancel(value: any): boolean;
all<T>(values: (T | Promise<T>)[]): Promise<T[]>;
all<T>(values: Array<T | Promise<T>>): Promise<T[]>;
spread<T, R>(callback: (...args: T[]) => R): (array: T[]) => R;
isAxiosError(payload: any): payload is AxiosError;
}

View File

@@ -13,7 +13,7 @@ var zlib = require('zlib');
var VERSION = require('./../env/data').version;
var createError = require('../core/createError');
var enhanceError = require('../core/enhanceError');
var defaults = require('../defaults');
var transitionalDefaults = require('../defaults/transitional');
var Cancel = require('../cancel/Cancel');
var isHttps = /https:?/;
@@ -60,8 +60,10 @@ module.exports = function httpAdapter(config) {
done();
resolvePromise(value);
};
var rejected = false;
var reject = function reject(value) {
done();
rejected = true;
rejectPromise(value);
};
var data = config.data;
@@ -99,6 +101,10 @@ module.exports = function httpAdapter(config) {
));
}
if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
return reject(createError('Request body larger than maxBodyLength limit', config));
}
// Add Content-Length header if data exists
if (!headerNames['content-length']) {
headers['Content-Length'] = data.length;
@@ -132,6 +138,16 @@ module.exports = function httpAdapter(config) {
var isHttpsRequest = isHttps.test(protocol);
var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
try {
buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, '');
} catch (err) {
var customErr = new Error(err.message);
customErr.config = config;
customErr.url = config.url;
customErr.exists = true;
reject(customErr);
}
var options = {
path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''),
method: config.method.toUpperCase(),
@@ -269,27 +285,40 @@ module.exports = function httpAdapter(config) {
// make sure the content length is not over the maxContentLength if specified
if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
// stream.destoy() emit aborted event before calling reject() on Node.js v16
rejected = true;
stream.destroy();
reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded',
config, null, lastRequest));
}
});
stream.on('aborted', function handlerStreamAborted() {
if (rejected) {
return;
}
stream.destroy();
reject(createError('error request aborted', config, 'ERR_REQUEST_ABORTED', lastRequest));
});
stream.on('error', function handleStreamError(err) {
if (req.aborted) return;
reject(enhanceError(err, config, null, lastRequest));
});
stream.on('end', function handleStreamEnd() {
var responseData = Buffer.concat(responseBuffer);
if (config.responseType !== 'arraybuffer') {
responseData = responseData.toString(config.responseEncoding);
if (!config.responseEncoding || config.responseEncoding === 'utf8') {
responseData = utils.stripBOM(responseData);
try {
var responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);
if (config.responseType !== 'arraybuffer') {
responseData = responseData.toString(config.responseEncoding);
if (!config.responseEncoding || config.responseEncoding === 'utf8') {
responseData = utils.stripBOM(responseData);
}
}
response.data = responseData;
} catch (err) {
reject(enhanceError(err, config, err.code, response.request, response));
}
response.data = responseData;
settle(resolve, reject, response);
});
}
@@ -301,6 +330,12 @@ module.exports = function httpAdapter(config) {
reject(enhanceError(err, config, null, req));
});
// set tcp keep alive to prevent drop connection by peer
req.on('socket', function handleRequestSocket(socket) {
// default interval of sending ack packet is 1 minute
socket.setKeepAlive(true, 1000 * 60);
});
// Handle request timeout
if (config.timeout) {
// This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.
@@ -324,9 +359,15 @@ module.exports = function httpAdapter(config) {
// ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.
req.setTimeout(timeout, function handleRequestTimeout() {
req.abort();
var transitional = config.transitional || defaults.transitional;
var timeoutErrorMessage = '';
if (config.timeoutErrorMessage) {
timeoutErrorMessage = config.timeoutErrorMessage;
} else {
timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
}
var transitional = config.transitional || transitionalDefaults;
reject(createError(
'timeout of ' + timeout + 'ms exceeded',
timeoutErrorMessage,
config,
transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',
req

View File

@@ -8,7 +8,7 @@ var buildFullPath = require('../core/buildFullPath');
var parseHeaders = require('./../helpers/parseHeaders');
var isURLSameOrigin = require('./../helpers/isURLSameOrigin');
var createError = require('../core/createError');
var defaults = require('../defaults');
var transitionalDefaults = require('../defaults/transitional');
var Cancel = require('../cancel/Cancel');
module.exports = function xhrAdapter(config) {
@@ -122,8 +122,8 @@ module.exports = function xhrAdapter(config) {
// Handle timeout
request.ontimeout = function handleTimeout() {
var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
var transitional = config.transitional || defaults.transitional;
var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
var transitional = config.transitional || transitionalDefaults;
if (config.timeoutErrorMessage) {
timeoutErrorMessage = config.timeoutErrorMessage;
}

10
node_modules/axios/lib/core/Axios.js generated vendored
View File

@@ -26,14 +26,14 @@ function Axios(instanceConfig) {
*
* @param {Object} config The config specific for this request (merged with this.defaults)
*/
Axios.prototype.request = function request(config) {
Axios.prototype.request = function request(configOrUrl, config) {
/*eslint no-param-reassign:0*/
// Allow for axios('example/url'[, config]) a la fetch API
if (typeof config === 'string') {
config = arguments[1] || {};
config.url = arguments[0];
} else {
if (typeof configOrUrl === 'string') {
config = config || {};
config.url = configOrUrl;
} else {
config = configOrUrl || {};
}
config = mergeConfig(this.defaults, config);

View File

@@ -1,7 +1,7 @@
'use strict';
var utils = require('./../utils');
var defaults = require('./../defaults');
var defaults = require('../defaults');
/**
* Transform the data for a request or a response

View File

@@ -1,8 +1,9 @@
'use strict';
var utils = require('./utils');
var normalizeHeaderName = require('./helpers/normalizeHeaderName');
var enhanceError = require('./core/enhanceError');
var utils = require('../utils');
var normalizeHeaderName = require('../helpers/normalizeHeaderName');
var enhanceError = require('../core/enhanceError');
var transitionalDefaults = require('./transitional');
var DEFAULT_CONTENT_TYPE = {
'Content-Type': 'application/x-www-form-urlencoded'
@@ -18,10 +19,10 @@ function getDefaultAdapter() {
var adapter;
if (typeof XMLHttpRequest !== 'undefined') {
// For browsers use XHR adapter
adapter = require('./adapters/xhr');
adapter = require('../adapters/xhr');
} else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
// For node use HTTP adapter
adapter = require('./adapters/http');
adapter = require('../adapters/http');
}
return adapter;
}
@@ -43,11 +44,7 @@ function stringifySafely(rawValue, parser, encoder) {
var defaults = {
transitional: {
silentJSONParsing: true,
forcedJSONParsing: true,
clarifyTimeoutError: false
},
transitional: transitionalDefaults,
adapter: getDefaultAdapter(),

7
node_modules/axios/lib/defaults/transitional.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
'use strict';
module.exports = {
silentJSONParsing: true,
forcedJSONParsing: true,
clarifyTimeoutError: false
};

View File

@@ -10,5 +10,5 @@ module.exports = function isAbsoluteURL(url) {
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
// by any combination of letters, digits, plus, period, or hyphen.
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
};

View File

@@ -1,5 +1,7 @@
'use strict';
var utils = require('./../utils');
/**
* Determines whether the payload is an error thrown by Axios
*
@@ -7,5 +9,5 @@
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
*/
module.exports = function isAxiosError(payload) {
return (typeof payload === 'object') && (payload.isAxiosError === true);
return utils.isObject(payload) && (payload.isAxiosError === true);
};

55
node_modules/axios/lib/helpers/toFormData.js generated vendored Normal file
View File

@@ -0,0 +1,55 @@
'use strict';
function combinedKey(parentKey, elKey) {
return parentKey + '.' + elKey;
}
function buildFormData(formData, data, parentKey) {
if (Array.isArray(data)) {
data.forEach(function buildArray(el, i) {
buildFormData(formData, el, combinedKey(parentKey, i));
});
} else if (
typeof data === 'object' &&
!(data instanceof File || data === null)
) {
Object.keys(data).forEach(function buildObject(key) {
buildFormData(
formData,
data[key],
parentKey ? combinedKey(parentKey, key) : key
);
});
} else {
if (data === undefined) {
return;
}
var value =
typeof data === 'boolean' || typeof data === 'number'
? data.toString()
: data;
formData.append(parentKey, value);
}
}
/**
* convert a data object to FormData
*
* type FormDataPrimitive = string | Blob | number | boolean
* interface FormDataNest {
* [x: string]: FormVal
* }
*
* type FormVal = FormDataNest | FormDataPrimitive
*
* @param {FormVal} data
*/
module.exports = function getFormData(data) {
var formData = new FormData();
buildFormData(formData, data);
return formData;
};

8
node_modules/axios/lib/utils.js generated vendored
View File

@@ -13,7 +13,7 @@ var toString = Object.prototype.toString;
* @returns {boolean} True if value is an Array, otherwise false
*/
function isArray(val) {
return toString.call(val) === '[object Array]';
return Array.isArray(val);
}
/**
@@ -54,7 +54,7 @@ function isArrayBuffer(val) {
* @returns {boolean} True if value is an FormData, otherwise false
*/
function isFormData(val) {
return (typeof FormData !== 'undefined') && (val instanceof FormData);
return toString.call(val) === '[object FormData]';
}
/**
@@ -68,7 +68,7 @@ function isArrayBufferView(val) {
if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
result = ArrayBuffer.isView(val);
} else {
result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
}
return result;
}
@@ -175,7 +175,7 @@ function isStream(val) {
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
*/
function isURLSearchParams(val) {
return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
return toString.call(val) === '[object URLSearchParams]';
}
/**

8
node_modules/axios/package.json generated vendored
View File

@@ -1,11 +1,11 @@
{
"name": "axios",
"version": "0.22.0",
"version": "0.26.1",
"description": "Promise based HTTP client for the browser and node.js",
"main": "index.js",
"types": "index.d.ts",
"scripts": {
"test": "grunt test",
"test": "grunt test && dtslint",
"start": "node ./sandbox/server.js",
"build": "NODE_ENV=production grunt build",
"preversion": "grunt version && npm test",
@@ -35,6 +35,7 @@
"devDependencies": {
"abortcontroller-polyfill": "^1.5.0",
"coveralls": "^3.0.0",
"dtslint": "^4.1.6",
"es6-promise": "^4.2.4",
"grunt": "^1.3.0",
"grunt-banner": "^0.6.0",
@@ -44,7 +45,6 @@
"grunt-eslint": "^23.0.0",
"grunt-karma": "^4.0.0",
"grunt-mocha-test": "^0.13.3",
"grunt-ts": "^6.0.0-beta.19",
"grunt-webpack": "^4.0.2",
"istanbul-instrumenter-loader": "^1.0.0",
"jasmine-core": "^2.4.1",
@@ -75,7 +75,7 @@
"unpkg": "dist/axios.min.js",
"typings": "./index.d.ts",
"dependencies": {
"follow-redirects": "^1.14.4"
"follow-redirects": "^1.14.8"
},
"bundlesize": [
{

14
node_modules/axios/tsconfig.json generated vendored Normal file
View File

@@ -0,0 +1,14 @@
{
"compilerOptions": {
"module": "es2015",
"lib": ["dom", "es2015"],
"types": [],
"moduleResolution": "node",
"strict": true,
"noEmit": true,
"baseUrl": ".",
"paths": {
"axios": ["."]
}
}
}

6
node_modules/axios/tslint.json generated vendored Normal file
View File

@@ -0,0 +1,6 @@
{
"extends": "dtslint/dtslint.json",
"rules": {
"no-unnecessary-generics": false
}
}