A suite to track Project Diva score statistics and ratings / D4DJ event data.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
projectdivar/server/node_modules/validate.io-buffer/lib/index.js

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;