A suite to track Project Diva score statistics and ratings / D4DJ event data.
 
 
 
 
 
 

26 lines
579 B

'use strict';
/**
* FUNCTION: isBuffer( value )
* Validates if a value is a Buffer object.
*
* @param {*} value - value to validate
* @returns {Boolean} boolean indicating if a value is a Buffer object
*/
function isBuffer( val ) {
return typeof val === 'object' &&
val !== null &&
(
val._isBuffer || // for envs missing Object.prototype.constructor (e.g., Safari 5-7)
(
val.constructor &&
typeof val.constructor.isBuffer === 'function' &&
val.constructor.isBuffer( val )
)
);
} // end FUNCTION isBuffer()
// EXPORTS //
module.exports = isBuffer;