Wordwrap a string with ANSI escape codes
Overall
score
100%
{
"context": "This criteria evaluates how well the engineer uses wrap-ansi's whitespace handling capabilities, specifically the trim option and its interaction with text wrapping. The evaluation focuses on correct usage of wrap-ansi's API to control whitespace behavior on wrapped lines.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Uses wrapAnsi function",
"description": "Implementation correctly imports and uses the wrapAnsi function from the wrap-ansi package",
"max_score": 15
},
{
"name": "Passes columns parameter",
"description": "Correctly passes the width parameter as the second argument (columns) to wrapAnsi",
"max_score": 10
},
{
"name": "Uses trim option",
"description": "Correctly uses the trim option in the third parameter (options object) to control whitespace handling",
"max_score": 25
},
{
"name": "Maps preserveWhitespace parameter",
"description": "Correctly maps the preserveWhitespace parameter to wrap-ansi's trim option (preserveWhitespace=false means trim=true, and vice versa)",
"max_score": 20
},
{
"name": "Handles default behavior",
"description": "Correctly implements the default behavior where preserveWhitespace=false results in trimming (trim: true)",
"max_score": 15
},
{
"name": "Returns wrapped result",
"description": "Returns the result from wrapAnsi directly without unnecessary post-processing",
"max_score": 10
},
{
"name": "No reimplementation",
"description": "Does not reimplement wrapping or trimming logic that wrap-ansi already provides",
"max_score": 5
}
]
}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