2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-05 16:42:32 +03:00

Use is-buffer instead of Buffer.isBuffer

The is-buffer module checks if an object is a Buffer without causing
Webpack or Browserify to include the whole Buffer module in the bundle.
This commit is contained in:
Felix Gnass
2017-05-04 23:41:52 +02:00
parent f31317aeca
commit c82753ce54
2 changed files with 3 additions and 11 deletions
+1 -10
View File
@@ -1,6 +1,7 @@
'use strict';
var bind = require('./helpers/bind');
var isBuffer = require('is-buffer');
/*global toString:true*/
@@ -18,16 +19,6 @@ 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
*