Helper function to get function arity by analyzing parameter lists for assignment patterns and rest parameters
95
{
"context": "This criteria evaluates how well the engineer uses @babel/types utilities to analyze and categorize different JavaScript function parameter types within Babel AST nodes. The focus is on correctly identifying identifiers, assignment patterns (default parameters), rest elements, and destructuring patterns.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Identifier detection",
"description": "Uses isIdentifier() or checks node type to correctly identify simple parameter identifiers (e.g., 'a', 'b', 'c') in function parameter lists",
"max_score": 20
},
{
"name": "AssignmentPattern detection",
"description": "Uses isAssignmentPattern() or equivalent type checking to correctly identify default parameters (e.g., 'b = 10') in function parameter lists",
"max_score": 25
},
{
"name": "RestElement detection",
"description": "Uses isRestElement() or equivalent type checking to correctly identify rest parameters (e.g., '...rest') in function parameter lists",
"max_score": 25
},
{
"name": "Pattern detection",
"description": "Uses isPattern(), isObjectPattern(), isArrayPattern(), or equivalent type checking to correctly identify destructuring patterns (e.g., '{x, y}', '[a, b]') in function parameter lists",
"max_score": 20
},
{
"name": "Parameter iteration",
"description": "Correctly accesses and iterates through the function node's params array to analyze all parameters in the function signature",
"max_score": 10
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-babel--helper-get-function-aritydocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10