提交 c82753ce 编写于 作者: F Felix Gnass

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.
上级 f31317ae
'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
*
......
......@@ -72,6 +72,7 @@
},
"typings": "./index.d.ts",
"dependencies": {
"follow-redirects": "^1.2.3"
"follow-redirects": "^1.2.3",
"is-buffer": "^1.1.5"
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册