aboutsummaryrefslogtreecommitdiffhomepage
path: root/node_modules/socket.io-parser/is-buffer.js
blob: 977df883f2ae20aafd0810ba047cec2b72d18fec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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);
}