2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-08 17:22:34 +03:00

Remove dependency on is-buffer (#1816)

* Remove dependency on is-buffer from package.json
This commit is contained in:
Angelos Chalaris
2019-11-18 08:53:27 +02:00
committed by Yasu Flores
parent 0cc22c2f42
commit 1a32ca0601
3 changed files with 18 additions and 3 deletions
+11 -1
View File
@@ -1,7 +1,6 @@
'use strict';
var bind = require('./helpers/bind');
var isBuffer = require('is-buffer');
/*global toString:true*/
@@ -19,6 +18,17 @@ function isArray(val) {
return toString.call(val) === '[object Array]';
}
/**
* Determine if a value is a Buffer
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Buffer, otherwise false
*/
function isBuffer(val) {
return ![undefined, null].includes(val) && val.constructor === Buffer;
}
/**
* Determine if a value is an ArrayBuffer
*