Slugify a string with comprehensive Unicode transliteration and extensive customization options
94
Build a product code normalizer that converts product names into standardized codes for an e-commerce inventory system. The system needs to handle special symbols commonly found in product names and produce consistent, URL-safe identifiers.
Your solution must:
normalizeProductCode(productName: string): string that takes a product name and returns the normalized codenormalizeProductCode("Coffee @ Home") returns "coffee-at-home" @testnormalizeProductCode("Discount $50") returns "discount-dollar-50" @testnormalizeProductCode("Widget+Tool") returns "widget-plus-tool" @testnormalizeProductCode("Product #123") returns "product-number-123" @testnormalizeProductCode("Save 25%!") returns "save-25-percent" @test@generates
export function normalizeProductCode(productName: string): string;Provides string slugification with custom character replacement support.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-sindresorhus--slugifydocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10