diff --git a/lib/utils.js b/lib/utils.js index df604da860..4e97511a19 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -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 * diff --git a/package.json b/package.json index 9c8b0aa81a..2dff2da3f1 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ }, "typings": "./index.d.ts", "dependencies": { - "follow-redirects": "^1.2.3" + "follow-redirects": "^1.2.3", + "is-buffer": "^1.1.5" } }