mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
Removing code relying on strict mode behaviour for arguments (#3470)
Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
+5
-5
@@ -26,14 +26,14 @@ function Axios(instanceConfig) {
|
|||||||
*
|
*
|
||||||
* @param {Object} config The config specific for this request (merged with this.defaults)
|
* @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*/
|
/*eslint no-param-reassign:0*/
|
||||||
// Allow for axios('example/url'[, config]) a la fetch API
|
// Allow for axios('example/url'[, config]) a la fetch API
|
||||||
if (typeof config === 'string') {
|
if (typeof configOrUrl === 'string') {
|
||||||
config = arguments[1] || {};
|
|
||||||
config.url = arguments[0];
|
|
||||||
} else {
|
|
||||||
config = config || {};
|
config = config || {};
|
||||||
|
config.url = configOrUrl;
|
||||||
|
} else {
|
||||||
|
config = configOrUrl || {};
|
||||||
}
|
}
|
||||||
|
|
||||||
config = mergeConfig(this.defaults, config);
|
config = mergeConfig(this.defaults, config);
|
||||||
|
|||||||
Reference in New Issue
Block a user