Helper function to get function arity by analyzing parameter lists for assignment patterns and rest parameters
Overall
score
95%
Integration with Babel plugin ecosystem
Import getFunctionArity
100%
100%
Import @babel/types
100%
100%
Plugin structure
100%
100%
Call getFunctionArity
100%
100%
AST node creation
100%
100%
Arity validation logic
100%
100%
Error generation
100%
100%
Function replacement
100%
100%
Multiple function type support
Uses getFunctionArity function
100%
100%
Accepts t.Function type
100%
100%
Handles parameter analysis
100%
100%
Integrates @babel/types
100%
100%
Function arity determination
Import getFunctionArity
100%
100%
Call getFunctionArity
100%
100%
Return arity value
100%
100%
Import Babel types
0%
100%
Complex parameter pattern handling
Uses @babel/parser
100%
100%
Uses getFunctionArity
0%
0%
Extracts function node
70%
100%
Passes to getFunctionArity
0%
0%
Uses @babel/types checks
100%
100%
Detects rest parameters
100%
100%
Edge case handling
Import getFunctionArity
100%
100%
Use getFunctionArity function
100%
100%
Empty parameter test
100%
100%
All optional parameters test
100%
100%
Rest parameter only test
100%
100%
Mixed required and optional test
100%
100%
Required plus rest test
100%
100%
Static code analysis applications
AST parsing
100%
100%
AST traversal
100%
100%
Arity calculation
0%
100%
Parameter type detection
100%
100%
Function name extraction
100%
100%
Summary statistics
100%
100%
Dynamic arity calculation for transformations
Uses getFunctionArity
100%
100%
Creates wrapper function
100%
100%
Preserves parameters
100%
100%
Generates arity check
100%
100%
Throws error correctly
100%
100%
Calls original function
100%
100%
Higher-order function composition
Import helper function
100%
100%
Use getFunctionArity directly
100%
100%
Pass function node
100%
100%
Handle arity result
80%
100%
Use @babel/types builders
100%
100%
Generate recursive curry
80%
100%
Respect parameter boundaries
30%
100%
Parameter type analysis
Identifier detection
100%
100%
AssignmentPattern detection
100%
100%
RestElement detection
100%
100%
Pattern detection
100%
100%
Parameter iteration
100%
100%
Babel plugin integration
Import getFunctionArity
100%
100%
Babel plugin structure
100%
100%
Function node visiting
100%
100%
Call getFunctionArity
100%
100%
Add leading comment
100%
100%
Install with Tessl CLI
npx tessl i tessl/npm-babel--helper-get-function-arity