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
{
"context": "This evaluation assesses how well the engineer uses the is-buffer package for Buffer type detection, specifically testing understanding of its constructor-based validation approach. The focus is on proper usage of the package's API rather than general coding practices.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Imports is-buffer",
"description": "The solution correctly imports the is-buffer package using require('is-buffer') or appropriate import syntax.",
"max_score": 15
},
{
"name": "Uses is-buffer function",
"description": "The solution calls the is-buffer function (typically named isBuffer) to check if input data is a Buffer, rather than using instanceof or other type checking methods.",
"max_score": 30
},
{
"name": "Buffer passthrough logic",
"description": "When is-buffer returns true, the solution returns the Buffer unchanged without unnecessary conversion or processing.",
"max_score": 20
},
{
"name": "Non-Buffer handling",
"description": "When is-buffer returns false, the solution correctly branches to handle string conversion or error throwing based on input type.",
"max_score": 20
},
{
"name": "Proper error handling",
"description": "The solution uses is-buffer to distinguish Buffers from non-Buffers before throwing errors for invalid types (not strings or Buffers).",
"max_score": 15
}
]
}docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9