Wordwrap a string with ANSI escape codes
Overall
score
100%
{
"context": "This criteria evaluates how well the engineer uses the wrap-ansi package to implement text wrapping functionality. The focus is on correct usage of the package's core API and understanding of its text wrapping capabilities with ANSI code support.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Uses wrapAnsi function",
"description": "The solution imports and uses the wrapAnsi function from the wrap-ansi package as the primary mechanism for text wrapping",
"max_score": 30
},
{
"name": "Passes text parameter",
"description": "The solution correctly passes the input text as the first parameter to wrapAnsi",
"max_score": 15
},
{
"name": "Passes columns parameter",
"description": "The solution correctly passes the column width as the second parameter to wrapAnsi",
"max_score": 15
},
{
"name": "Handles plain text",
"description": "The solution correctly wraps plain text without ANSI codes at word boundaries within the specified column width",
"max_score": 15
},
{
"name": "Handles ANSI codes",
"description": "The solution correctly wraps text containing ANSI escape codes, preserving the styling while calculating width based on visible characters only",
"max_score": 15
},
{
"name": "Returns wrapped output",
"description": "The solution returns the output from wrapAnsi without unnecessary post-processing that would break the wrapping functionality",
"max_score": 10
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-wrap-ansidocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10