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 module that validates input data types for buffer processing operations. The module ensures that only valid buffer-like data structures are accepted for processing.
Validates that input data is of the correct type before processing.
null, the validator returns false @testundefined, the validator returns false @test"hello", the validator returns false @test42, the validator returns false @testtrue, the validator returns false @test{}, the validator returns false @test[1, 2, 3], the validator returns false @testCorrectly identifies and accepts actual Buffer instances.
Buffer.from([1, 2, 3]), the validator returns true @testBuffer.alloc(10), the validator returns true @test@generates
/**
* Validates whether the input is a Buffer.
*
* @param {*} data - The input to validate
* @returns {boolean} true if input is a Buffer, false otherwise
*/
function validateBuffer(data) {
// Implementation here
}
module.exports = { validateBuffer };Provides buffer type detection functionality.
@satisfied-by
docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9