Bones/node_modules/socket.io-parser/is-buffer.js

14 lines
252 B
JavaScript
Raw Normal View History

2017-05-17 13:45:25 -04:00
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);
}