mirror of
https://github.com/tenrok/axios.git
synced 2026-06-11 18:02:32 +03:00
Remove 'includes' API, fix CI build failure (#2574)
* Remove 'includes' API, fix CI build failure
This commit is contained in:
+11
-11
@@ -18,6 +18,15 @@ function isArray(val) {
|
||||
return toString.call(val) === '[object Array]';
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a value is undefined
|
||||
*
|
||||
* @param {Object} val The value to test
|
||||
* @returns {boolean} True if the value is undefined, otherwise false
|
||||
*/
|
||||
function isUndefined(val) {
|
||||
return typeof val === 'undefined';
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a value is a Buffer
|
||||
@@ -26,7 +35,8 @@ function isArray(val) {
|
||||
* @returns {boolean} True if value is a Buffer, otherwise false
|
||||
*/
|
||||
function isBuffer(val) {
|
||||
return ![undefined, null].includes(val) && val.constructor === Buffer;
|
||||
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
|
||||
&& typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,16 +95,6 @@ function isNumber(val) {
|
||||
return typeof val === 'number';
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a value is undefined
|
||||
*
|
||||
* @param {Object} val The value to test
|
||||
* @returns {boolean} True if the value is undefined, otherwise false
|
||||
*/
|
||||
function isUndefined(val) {
|
||||
return typeof val === 'undefined';
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a value is an Object
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user