mirror of
https://github.com/tenrok/axios.git
synced 2026-06-17 19:21:29 +03:00
support node buffers less than 8192 bytes (#773)
This commit is contained in:
committed by
Rubén Norte
parent
bbfbeff4bc
commit
188334439f
@@ -18,6 +18,16 @@ function isArray(val) {
|
||||
return toString.call(val) === '[object Array]';
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a value is a Node Buffer
|
||||
*
|
||||
* @param {Object} val The value to test
|
||||
* @returns {boolean} True if value is a Node Buffer, otherwise false
|
||||
*/
|
||||
function isBuffer(val) {
|
||||
return ((typeof Buffer !== 'undefined') && (Buffer.isBuffer) && (Buffer.isBuffer(val)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a value is an ArrayBuffer
|
||||
*
|
||||
@@ -281,6 +291,7 @@ function extend(a, b, thisArg) {
|
||||
module.exports = {
|
||||
isArray: isArray,
|
||||
isArrayBuffer: isArrayBuffer,
|
||||
isBuffer: isBuffer,
|
||||
isFormData: isFormData,
|
||||
isArrayBufferView: isArrayBufferView,
|
||||
isString: isString,
|
||||
|
||||
Reference in New Issue
Block a user