14 lines
252 B
JavaScript
14 lines
252 B
JavaScript
|
|
module.exports = isBuf;
|
|
|
|
/**
|
|
* Returns true if obj is a buffer or an arraybuffer.
|
|
*
|
|
* @api private
|
|
*/
|
|
|
|
function isBuf(obj) {
|
|
return (global.Buffer && global.Buffer.isBuffer(obj)) ||
|
|
(global.ArrayBuffer && obj instanceof ArrayBuffer);
|
|
}
|