or run

npx @tessl/cli init
Log in

Version

Files

docs

index.md
tile.json

task.mdevals/scenario-5/

Brand Text Formatter

Normalize marketing text for consistent casing, slugs, truncation, and badge padding so branding strings stay predictable across surfaces.

Capabilities

Title normalization

  • It trims whitespace and turns mixed separators like " flash_sale-banner " into "Flash Sale Banner" with single spaces between words @test
  • It converts camelCase or delimiter-heavy input like "newArrivalsToday" into "New Arrivals Today" @test

Slug creation

  • It produces lowercase hyphen-separated slugs without leading or trailing hyphens; e.g., "Flash Sale Banner" becomes "flash-sale-banner" @test
  • It converts camelCase identifiers like "newArrivalsToday" into "new-arrivals-today" @test

Copy shortening

  • When given text longer than the limit, it trims and shortens with an ellipsis so the total length equals the limit; e.g., input " Adventure-ready duffels for weekend trips " with 24 yields "Adventure-ready duffe..." @test
  • When text fits within the limit, it returns the trimmed text unchanged; e.g., "Daypack" with 10 stays "Daypack" @test

Badge padding

  • It centers short labels within a target width using a fill string; e.g., text "OK" width 6 fill "*" yields "OK" @test
  • If the label already meets or exceeds the width, it returns the trimmed label unchanged; e.g., "READY" width 4 stays "READY" @test

Implementation

@generates

API

export function formatTitle(input: string): string;
export function makeSlug(input: string): string;
export function shortenCopy(input: string, maxLength: number): string;
export function padBadge(label: string, width: number, fill?: string): string;

Dependencies { .dependencies }

lodash { .dependency }

Provides string casing and text formatting utilities.