Create an error from multiple errors
94
{
"context": "This evaluation assesses the engineer's ability to implement proper input validation patterns, specifically validating that a constructor parameter is an array and throwing appropriate TypeErrors with descriptive messages. The focus is on using Array.isArray() and typeof operator correctly as demonstrated in the aggregate-error package.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Array.isArray() validation",
"description": "Uses Array.isArray() method to check if the constructor parameter is an array before processing it",
"max_score": 30
},
{
"name": "TypeError throwing",
"description": "Throws a TypeError (not generic Error) when the input is not an array",
"max_score": 20
},
{
"name": "Descriptive error message",
"description": "Error message includes both the expected type ('Array') and the actual type received using typeof operator",
"max_score": 25
},
{
"name": "Validation before processing",
"description": "Performs the array validation check at the beginning of the constructor, before any other processing or storage operations",
"max_score": 15
},
{
"name": "typeof operator usage",
"description": "Uses typeof operator in the error message to provide information about the actual type that was passed",
"max_score": 10
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-aggregate-errordocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9