mirror of
https://github.com/abrendan/MicDropMessages.git
synced 2025-08-25 22:12:02 +02:00
Initial commit
This commit is contained in:
20
node_modules/socket.io-parser/is-buffer.js
generated
vendored
Normal file
20
node_modules/socket.io-parser/is-buffer.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
module.exports = isBuf;
|
||||
|
||||
var withNativeBuffer = typeof Buffer === 'function' && typeof Buffer.isBuffer === 'function';
|
||||
var withNativeArrayBuffer = typeof ArrayBuffer === 'function';
|
||||
|
||||
var isView = function (obj) {
|
||||
return typeof ArrayBuffer.isView === 'function' ? ArrayBuffer.isView(obj) : (obj.buffer instanceof ArrayBuffer);
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns true if obj is a buffer or an arraybuffer.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function isBuf(obj) {
|
||||
return (withNativeBuffer && Buffer.isBuffer(obj)) ||
|
||||
(withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));
|
||||
}
|
Reference in New Issue
Block a user