Determine if an object is a Buffer without including the full buffer module
93
Pending
Does it follow best practices?
Impact
93%
1.02xAverage score across 9 eval scenarios
Pending
The risk profile of this skill
A utility library that safely validates data types without throwing errors on null or undefined inputs.
Create a validation utility that can check if values are of specific types while gracefully handling null and undefined inputs. The validator should never throw errors when given null or undefined values, but instead return false.
@generates
/**
* Validates if a value is a Buffer.
* Safely handles null and undefined without throwing errors.
*
* @param {any} value - The value to check
* @returns {boolean} true if value is a Buffer, false otherwise
*/
function isBuffer(value) {
// IMPLEMENTATION HERE
}
/**
* Validates if a value is an array.
* Safely handles null and undefined without throwing errors.
*
* @param {any} value - The value to check
* @returns {boolean} true if value is an array, false otherwise
*/
function isArray(value) {
// IMPLEMENTATION HERE
}
/**
* Validates if a value is a plain object.
* Safely handles null and undefined without throwing errors.
* Returns false for arrays, functions, and other non-plain objects.
*
* @param {any} value - The value to check
* @returns {boolean} true if value is a plain object, false otherwise
*/
function isPlainObject(value) {
// IMPLEMENTATION HERE
}
module.exports = {
isBuffer,
isArray,
isPlainObject
};Provides Buffer type detection with null/undefined safety.
@satisfied-by
docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9